/
ProfileTest.php
32 lines (28 loc) · 966 Bytes
/
ProfileTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* Specification for ProfileModel
*
* @author hungtd
*/
class Application_Model_ProfileTest extends PHPUnit_Framework_TestCase
{
protected function setUp()
{
//autoload
new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
}
public function testWhenMissingDobParamsThenGetBirthDayReturnNull()
{
$profile = new Application_Model_Profile(['data' => ['dob'=>'']]);
$this->assertNull($profile->getBirthDay());
$profileOther = new Application_Model_Profile(['data' => []]);
$this->assertNull($profileOther->getBirthDay());
}
public function testWhenMissingDobParamsThenGetAgeReturnNull()
{
$profile = new Application_Model_Profile(['data' => ['dob'=>'']]);
$this->assertNull($profile->getAge());
$profileOther = new Application_Model_Profile(['data' => []]);
$this->assertNull($profileOther->getAge());
}
}