Test corrections

This commit is contained in:
Taras Machyshyn
2015-05-27 17:19:04 +03:00
parent c4558ec633
commit ec07b23af8
2 changed files with 18 additions and 5 deletions
+8 -4
View File
@@ -85,10 +85,12 @@ class CronManagerTest extends \PHPUnit_Framework_TestCase
$this->objects['fileManager']
->expects($this->once())
->method('getPhpContents')
->will($this->returnValue(time()-60));
->will($this->returnValue(array(
'time' => time() - 60,
)));
$this->objects['config']
->expects($this->once())
->expects($this->exactly(2))
->method('get')
->will($this->returnValue(50));
@@ -100,10 +102,12 @@ class CronManagerTest extends \PHPUnit_Framework_TestCase
$this->objects['fileManager']
->expects($this->once())
->method('getPhpContents')
->will($this->returnValue(time()-49));
->will($this->returnValue(array(
'time' => time() - 49,
)));
$this->objects['config']
->expects($this->once())
->expects($this->exactly(2))
->method('get')
->will($this->returnValue(50));
+10 -1
View File
@@ -53,9 +53,18 @@ class LanguageTest extends \PHPUnit_Framework_TestCase
->method('get')
->will($this->returnValueMap($map));
$this->objects['metadata'] = $this->getMockBuilder('\Espo\Core\Utils\Metadata')->disableOriginalConstructor()->getMock();
$this->objects['metadata']->expects($this->any())
->method('getModuleList')
->will($this->returnValue(
array (
'Crm',
)
));
$this->objects['preferences'] = $this->getMockBuilder('\Espo\Entities\Preferences')->disableOriginalConstructor()->getMock();
$this->object = new \Espo\Core\Utils\Language($this->objects['fileManager'], $this->objects['config'], $this->objects['preferences']);
$this->object = new \Espo\Core\Utils\Language($this->objects['fileManager'], $this->objects['config'], $this->objects['metadata'], $this->objects['preferences']);
$this->reflection = new ReflectionHelper($this->object);
$this->reflection->setProperty('cacheFile', $this->cacheFile);