3333use OCP \AppFramework \Db \DoesNotExistException ;
3434use OCP \ILogger ;
3535use OCP \IUser ;
36+ use function fwrite ;
3637
3738class SyncJobTest extends TestCase {
3839
@@ -43,52 +44,68 @@ class SyncJobTest extends TestCase {
4344 private $ job ;
4445
4546 protected function setUp (): void {
47+ fwrite (STDERR , "1 \n" );
4648 parent ::setUp ();
49+ fwrite (STDERR , "2 \n" );
4750
4851 $ this ->serviceMock = $ this ->createServiceMock (SyncJob::class);
52+ fwrite (STDERR , "10 \n" );
4953 $ this ->job = $ this ->serviceMock ->getService ();
54+ fwrite (STDERR , "11 \n" );
5055
5156 // Make sure the job is actually run
5257 $ this ->serviceMock ->getParameter ('time ' )
5358 ->method ('getTime ' )
5459 ->willReturn (500000 );
60+ fwrite (STDERR , "12 \n" );
5561 // Set our common argument
5662 $ this ->job ->setArgument ([
5763 'accountId ' => 123 ,
5864 ]);
65+ fwrite (STDERR , "13 \n" );
5966 // Set a fake ID
6067 $ this ->job ->setId (99 );
68+ fwrite (STDERR , "14 \n" );
6169 }
6270
6371 public function testAccountDoesntExist (): void {
72+ fwrite (STDERR , "TADE 1 \n" );
6473 $ this ->serviceMock ->getParameter ('accountService ' )
6574 ->expects (self ::once ())
6675 ->method ('findById ' )
6776 ->with (123 )
6877 ->willThrowException (new DoesNotExistException ('' ));
78+ fwrite (STDERR , "TADE 2 \n" );
6979 $ this ->serviceMock ->getParameter ('logger ' )
7080 ->expects (self ::once ())
7181 ->method ('debug ' )
7282 ->with ('Could not find account <123> removing from jobs ' );
83+ fwrite (STDERR , "TADE 3 \n" );
7384 $ this ->serviceMock ->getParameter ('jobList ' )
7485 ->expects (self ::once ())
7586 ->method ('remove ' )
7687 ->with (SyncJob::class, ['accountId ' => 123 ]);
88+ fwrite (STDERR , "TADE 4 \n" );
7789 $ this ->serviceMock ->getParameter ('mailboxSync ' )
7890 ->expects (self ::never ())
7991 ->method ('sync ' );
92+ fwrite (STDERR , "TADE 5 \n" );
8093 $ this ->serviceMock ->getParameter ('syncService ' )
8194 ->expects (self ::never ())
8295 ->method ('syncAccount ' );
96+ fwrite (STDERR , "TADE 6 \n" );
8397
8498 $ this ->job ->setArgument ([
8599 'accountId ' => 123 ,
86100 ]);
101+ fwrite (STDERR , "TADE 7 \n" );
87102 $ this ->job ->setLastRun (0 );
103+ fwrite (STDERR , "TADE 8 \n" );
88104 $ this ->job ->execute (
89105 $ this ->createMock (JobList::class),
90106 $ this ->createMock (ILogger::class)
91107 );
108+ fwrite (STDERR , "TADE 9 \n" );
92109 }
93110
94111 public function testUserDoesntExist (): void {
0 commit comments