1 | <?php |
||
7 | |||
8 | class JobTest extends \PHPUnit_Framework_TestCase |
||
9 | { |
||
10 | /** |
||
11 | * @var Job |
||
12 | */ |
||
13 | private $job; |
||
14 | |||
15 | public function setUp() |
||
16 | { |
||
17 | $this->job = new Job; |
||
18 | $this->job->setKey('job_key'); |
||
19 | $this->job->setIndex(new Index('index_key', 'Index Name', 'http://index.url', 'affId')); |
||
20 | $this->job->setTitle('Analista de Sistema para Software de RH'); |
||
21 | $this->job->setCompany('Mega Enterprise, Co'); |
||
22 | $this->job->setSalaryCurrencyCode('BRL'); |
||
23 | $this->job->setSalaryMin(1000); |
||
24 | $this->job->setSalaryMax(2000); |
||
25 | $this->job->setCity('Sao Paulo'); |
||
26 | $this->job->setState('SP'); |
||
27 | $this->job->setCountry('Brasil'); |
||
28 | $this->job->setSource('www.ceviu.com.br'); |
||
29 | $this->job->setDate(new \DateTime('Sat, 13 Feb 2016 08:59:39 GMT')); |
||
30 | $this->job->setSnippet('Principais atribuições do cargo...'); |
||
31 | $this->job->setDescription('Descrição detalhada do cargo...'); |
||
32 | $this->job->setViewUrl('http://job.url/pt-br/job-12345'); |
||
33 | $this->job->setApplyUrl('http://job.url/pt-br/apply-12345'); |
||
34 | $this->job->setFeatured(false); |
||
35 | } |
||
36 | |||
37 | public function testGetKey() |
||
38 | { |
||
39 | $this->assertEquals('job_key', $this->job->getKey()); |
||
40 | } |
||
41 | |||
42 | public function testGetIndex() |
||
43 | { |
||
44 | $this->assertInstanceOf(Index::class, $this->job->getIndex()); |
||
45 | $this->assertEquals('index_key', $this->job->getIndex()->getKey()); |
||
46 | $this->assertEquals('Index Name', $this->job->getIndex()->getName()); |
||
47 | $this->assertEquals('http://index.url', $this->job->getIndex()->getUrl()); |
||
48 | $this->assertEquals('affId', $this->job->getIndex()->getAffiliateId()); |
||
49 | } |
||
50 | |||
51 | public function testGetTitle() |
||
52 | { |
||
53 | $this->assertEquals('Analista de Sistema para Software de RH', $this->job->getTitle()); |
||
54 | } |
||
55 | |||
56 | public function testGetCompany() |
||
57 | { |
||
58 | $this->assertEquals('Mega Enterprise, Co', $this->job->getCompany()); |
||
59 | } |
||
60 | |||
61 | public function testGetSalaryCurrencyCode() |
||
62 | { |
||
63 | $this->assertEquals('BRL', $this->job->getSalaryCurrencyCode()); |
||
64 | } |
||
65 | |||
66 | public function testGetSalaryMin() |
||
67 | { |
||
68 | $this->assertEquals(1000, $this->job->getSalaryMin()); |
||
69 | } |
||
70 | |||
71 | public function testGetSalaryMax() |
||
72 | { |
||
73 | $this->assertEquals(2000, $this->job->getSalaryMax()); |
||
74 | } |
||
75 | |||
76 | public function testGetCity() |
||
77 | { |
||
78 | $this->assertEquals('Sao Paulo', $this->job->getCity()); |
||
79 | } |
||
80 | |||
81 | public function testGetState() |
||
82 | { |
||
83 | $this->assertEquals('SP', $this->job->getState()); |
||
84 | } |
||
85 | |||
86 | public function testGetCountry() |
||
87 | { |
||
88 | $this->assertEquals('Brasil', $this->job->getCountry()); |
||
89 | } |
||
90 | |||
91 | public function testGetSource() |
||
92 | { |
||
93 | $this->assertEquals('www.ceviu.com.br', $this->job->getSource()); |
||
94 | } |
||
95 | |||
96 | public function testGetDate() |
||
97 | { |
||
126 |