25 class JobTest extends \PHPUnit\Framework\TestCase
51 $jobQueue =
new JobQueue(44,
'readmeoss',
'2024-07-03 20:41:49',
'2024-07-03 20:41:50',
52 'Completed', 0,
null, [], 0,
true,
false,
true,
53 [
'text' =>
'ReadMeOss',
'link' =>
'http://localhost/repo/api/v1/report/16']);
54 if ($version == ApiVersion::V2){
58 'queueDate' =>
'01-01-2020',
60 'userName' =>
"fossy",
61 'groupName' =>
"fossy",
63 'status' =>
'Processing',
64 'jobQueue' => $jobQueue->getArray()
67 $userDao = M::mock(UserDao::class);
68 $container = M::mock(
'ContainerBuilder');
69 $container->shouldReceive(
'get')->withArgs(array(
70 "dao.user"))->andReturn($userDao);
71 $userDao->shouldReceive(
"getUserName")->with(2)->andReturn(
"fossy");
72 $userDao->shouldReceive(
"getGroupNameById")->with(2)->andReturn(
"fossy");
77 'queueDate' =>
'01-01-2020',
82 'status' =>
'Processing'
86 $actualJob =
new Job(22,
'ojo',
'01-01-2020', 4, 2, 2, 3,
'Processing', $jobQueue->getArray());
88 $this->assertEquals($expectedStatus, $actualJob->getArray($version));
Model class to hold JobQueue info.