Update
Thank you for the replying. Here is the test method I'm using:
@IsTest(SeeAllData=true)
Private class LastLogintest
{
String ids = UserInfo.getUserId();
// Making the assumption that at least one user will match this. Better to assign to list and check that has at least one record.
Schema.User testUser = [Select Id, LastLoginDate__c from User where LastLoginDate != null limit 1];
// Set it to anything other than LastLoginDate so we can tell it has changed.
testUser.LastLoginDate__c = null;
update testUser;
Test.startTest();
CaptureLastLoginDate captureBatch = new CaptureLastLoginDate();
// Modify the query here so we only get our one testing user of interest
captureBatch.query = 'SELECT id, LastLoginDate,LastLoginDate__c FROM User where Id =: testUser.Id limit 1';
ID batchprocessid = Database.executeBatch(captureBatch);
Test.StopTest();
User afterBatchUser = [Select Id, LastLoginDate, LastLoginDate__c from User where Id =:testUser.Id limit 1];
System.AssertEquals(afterBatchUser.LastLoginDate, afterBatchUser.LastLoginDate__c);
}
ERROR:Error: Compile Error: unexpected token: 'testUser.LastLoginDate__c' at line 10 column 3