mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
Add void return to method in tests. (#20602)
This commit is contained in:
@ -146,7 +146,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
|
||||
// Tests:
|
||||
|
||||
public function testActionConfig()
|
||||
public function testActionConfig(): void
|
||||
{
|
||||
$configFileName = $this->configFileName;
|
||||
$out = $this->runMessageControllerAction('config', [$configFileName]);
|
||||
@ -156,20 +156,20 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testActionConfigSubDir()
|
||||
public function testActionConfigSubDir(): void
|
||||
{
|
||||
$configFileName = Yii::getAlias('@yiiunit/runtime/not_existing_subdir') . DIRECTORY_SEPARATOR . 'message_controller_test_config-' . md5(uniqid()) . '.php';
|
||||
$out = $this->runMessageControllerAction('config', [$configFileName]);
|
||||
$this->assertFileExists($configFileName, "Unable to create config file in subdirectory. Command output:\n\n" . $out);
|
||||
}
|
||||
|
||||
public function testConfigFileNotExist()
|
||||
public function testConfigFileNotExist(): void
|
||||
{
|
||||
$this->expectException('yii\\console\\Exception');
|
||||
$this->runMessageControllerAction('extract', ['not_existing_file.php']);
|
||||
}
|
||||
|
||||
public function testCreateTranslation()
|
||||
public function testCreateTranslation(): void
|
||||
{
|
||||
$category = 'test.category1';
|
||||
$message = 'test message';
|
||||
@ -188,7 +188,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @depends testCreateTranslation
|
||||
*/
|
||||
public function testNothingToSave()
|
||||
public function testNothingToSave(): void
|
||||
{
|
||||
$category = 'test_category2';
|
||||
$message = 'test message';
|
||||
@ -208,7 +208,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @depends testCreateTranslation
|
||||
*/
|
||||
public function testMerge()
|
||||
public function testMerge(): void
|
||||
{
|
||||
$category = 'test_category3';
|
||||
|
||||
@ -237,7 +237,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @depends testMerge
|
||||
*/
|
||||
public function testMarkObsoleteMessages()
|
||||
public function testMarkObsoleteMessages(): void
|
||||
{
|
||||
$category = 'category';
|
||||
|
||||
@ -260,7 +260,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @depends testMerge
|
||||
*/
|
||||
public function removeObsoleteMessages()
|
||||
public function removeObsoleteMessages(): void
|
||||
{
|
||||
$category = 'category';
|
||||
|
||||
@ -282,7 +282,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @depends testMerge
|
||||
*/
|
||||
public function testMergeWithContentZero()
|
||||
public function testMergeWithContentZero(): void
|
||||
{
|
||||
$category = 'test_category5';
|
||||
|
||||
@ -320,7 +320,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @depends testCreateTranslation
|
||||
*/
|
||||
public function testMultipleTranslators()
|
||||
public function testMultipleTranslators(): void
|
||||
{
|
||||
$category = 'test_category6';
|
||||
|
||||
@ -352,7 +352,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @depends testCreateTranslation
|
||||
*/
|
||||
public function testMultipleCategories()
|
||||
public function testMultipleCategories(): void
|
||||
{
|
||||
$category1 = 'category1';
|
||||
$category2 = 'category2';
|
||||
@ -389,7 +389,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
$this->assertArrayNotHasKey($message2, $messages2, "message2 found in category2. Command output:\n\n" . $out);
|
||||
}
|
||||
|
||||
public function testIgnoreCategories()
|
||||
public function testIgnoreCategories(): void
|
||||
{
|
||||
$category1 = 'category1';
|
||||
$category2 = 'category2';
|
||||
@ -435,7 +435,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
*
|
||||
* @see https://github.com/yiisoft/yii2/issues/8286
|
||||
*/
|
||||
public function testCreateTranslationFromNested()
|
||||
public function testCreateTranslationFromNested(): void
|
||||
{
|
||||
$category = 'test.category1';
|
||||
$mainMessage = 'main message';
|
||||
@ -456,7 +456,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
*
|
||||
* @see https://github.com/yiisoft/yii2/issues/11502
|
||||
*/
|
||||
public function testMissingLanguage()
|
||||
public function testMissingLanguage(): void
|
||||
{
|
||||
$category = 'multiLangCategory';
|
||||
$mainMessage = 'multiLangMessage';
|
||||
@ -482,7 +482,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
*
|
||||
* @see https://github.com/yiisoft/yii2/issues/13824
|
||||
*/
|
||||
public function testCreateTranslationFromConcatenatedString()
|
||||
public function testCreateTranslationFromConcatenatedString(): void
|
||||
{
|
||||
$category = 'test.category1';
|
||||
$mainMessage = 'main message second message third message';
|
||||
@ -503,7 +503,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @see https://github.com/yiisoft/yii2/issues/14016
|
||||
*/
|
||||
public function testShouldNotMarkUnused()
|
||||
public function testShouldNotMarkUnused(): void
|
||||
{
|
||||
$category = 'testShouldNotMarkUnused';
|
||||
|
||||
@ -538,7 +538,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @see https://github.com/yiisoft/yii2/issues/13792
|
||||
*/
|
||||
public function testShouldNotRemoveUnused()
|
||||
public function testShouldNotRemoveUnused(): void
|
||||
{
|
||||
$category = 'my';
|
||||
|
||||
@ -576,7 +576,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @see https://github.com/yiisoft/yii2/issues/16828
|
||||
*/
|
||||
public function testPartialTranslator()
|
||||
public function testPartialTranslator(): void
|
||||
{
|
||||
$category = 'category';
|
||||
$negativeKey1 = 'Should not find this';
|
||||
@ -610,7 +610,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
/**
|
||||
* @see https://github.com/yiisoft/yii2/issues/17098
|
||||
*/
|
||||
public function testMessageExtractActionWhenMessageUsingParamsReturnedFromMethodCalls()
|
||||
public function testMessageExtractActionWhenMessageUsingParamsReturnedFromMethodCalls(): void
|
||||
{
|
||||
$sourceFileContent = "
|
||||
echo PHP_EOL, Yii::t('app', '1. Simple message');
|
||||
@ -653,7 +653,7 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
], $messages);
|
||||
}
|
||||
|
||||
public function testMessagesSorting()
|
||||
public function testMessagesSorting(): void
|
||||
{
|
||||
$category = 'test_order_category';
|
||||
$key1 = 'key1';
|
||||
|
||||
Reference in New Issue
Block a user