Fixed tests

This commit is contained in:
Alexander Makarov
2015-03-07 00:31:22 +03:00
parent 52df3466f4
commit 0e567bdd9c
3 changed files with 5 additions and 12 deletions

View File

@@ -99,10 +99,9 @@ abstract class BaseMessageControllerTest extends TestCase
* Loads messages
*
* @param string $category
* @param boolean $shouldExist if file should exist
* @return array
*/
abstract protected function loadMessages($category, $shouldExist = true);
abstract protected function loadMessages($category);
/**
* @return array default config

View File

@@ -70,7 +70,7 @@ class PHPMessageControllerTest extends BaseMessageControllerTest
/**
* @inheritdoc
*/
protected function loadMessages($category, $shouldExist = true)
protected function loadMessages($category)
{
if (defined('HHVM_VERSION')) {
// https://github.com/facebook/hhvm/issues/1447
@@ -79,10 +79,7 @@ class PHPMessageControllerTest extends BaseMessageControllerTest
$messageFilePath = $this->getMessageFilePath($category);
if ($shouldExist) {
static::assertTrue(file_exists($messageFilePath), "There's no message file $messageFilePath that should exist!");
} else {
static::assertFalse(file_exists($messageFilePath), "There's message file $messageFilePath that should not exist!");
if (!file_exists($messageFilePath)) {
return [];
}
return require $messageFilePath;

View File

@@ -74,13 +74,10 @@ class POMessageControllerTest extends BaseMessageControllerTest
/**
* @inheritdoc
*/
protected function loadMessages($category, $shouldExist = true)
protected function loadMessages($category)
{
$messageFilePath = $this->getMessageFilePath();
if ($shouldExist) {
static::assertTrue(file_exists($messageFilePath), "There's no message file $messageFilePath that should exist!");
} else {
static::assertFalse(file_exists($messageFilePath), "There's message file $messageFilePath that should not exist!");
if (!file_exists($messageFilePath)) {
return [];
}