Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Mar 6, 2015
1 parent 52df346 commit 0e567bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ abstract protected function saveMessages($messages, $category);
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function saveMessages($messages, $category)
/**
* @inheritdoc
*/
protected function loadMessages($category, $shouldExist = true)
protected function loadMessages($category)
{
if (defined('HHVM_VERSION')) {
// https://github.com/facebook/hhvm/issues/1447
Expand All @@ -79,10 +79,7 @@ protected function loadMessages($category, $shouldExist = true)

$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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,10 @@ protected function saveMessages($messages, $category)
/**
* @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 [];
}

Expand Down

0 comments on commit 0e567bd

Please sign in to comment.