mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-12 03:30:12 +08:00
Fixed tests
This commit is contained in:
@@ -99,10 +99,9 @@ abstract class BaseMessageControllerTest extends TestCase
|
|||||||
* Loads messages
|
* Loads messages
|
||||||
*
|
*
|
||||||
* @param string $category
|
* @param string $category
|
||||||
* @param boolean $shouldExist if file should exist
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
abstract protected function loadMessages($category, $shouldExist = true);
|
abstract protected function loadMessages($category);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array default config
|
* @return array default config
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class PHPMessageControllerTest extends BaseMessageControllerTest
|
|||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
protected function loadMessages($category, $shouldExist = true)
|
protected function loadMessages($category)
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
if (defined('HHVM_VERSION')) {
|
||||||
// https://github.com/facebook/hhvm/issues/1447
|
// https://github.com/facebook/hhvm/issues/1447
|
||||||
@@ -79,10 +79,7 @@ class PHPMessageControllerTest extends BaseMessageControllerTest
|
|||||||
|
|
||||||
$messageFilePath = $this->getMessageFilePath($category);
|
$messageFilePath = $this->getMessageFilePath($category);
|
||||||
|
|
||||||
if ($shouldExist) {
|
if (!file_exists($messageFilePath)) {
|
||||||
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!");
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return require $messageFilePath;
|
return require $messageFilePath;
|
||||||
|
|||||||
@@ -74,13 +74,10 @@ class POMessageControllerTest extends BaseMessageControllerTest
|
|||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
protected function loadMessages($category, $shouldExist = true)
|
protected function loadMessages($category)
|
||||||
{
|
{
|
||||||
$messageFilePath = $this->getMessageFilePath();
|
$messageFilePath = $this->getMessageFilePath();
|
||||||
if ($shouldExist) {
|
if (!file_exists($messageFilePath)) {
|
||||||
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!");
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user