mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-16 03:28:56 +08:00
Add void return to method in tests. (#20602)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
namespace yiiunit\framework\web;
|
||||
|
||||
use SplStack;
|
||||
use yii\web\XmlResponseFormatter;
|
||||
use yiiunit\framework\web\stubs\ModelStub;
|
||||
|
||||
@@ -93,7 +94,7 @@ class XmlResponseFormatterTest extends FormatterTest
|
||||
{
|
||||
$expectedXmlForStack = '';
|
||||
|
||||
$postsStack = new \SplStack();
|
||||
$postsStack = new SplStack();
|
||||
|
||||
$postsStack->push(new Post(915, 'record1'));
|
||||
$expectedXmlForStack = '<Post><id>915</id><title>record1</title></Post>' .
|
||||
@@ -135,7 +136,7 @@ class XmlResponseFormatterTest extends FormatterTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testCustomRootTag()
|
||||
public function testCustomRootTag(): void
|
||||
{
|
||||
$rootTag = 'custom';
|
||||
$formatter = $this->getFormatterInstance([
|
||||
@@ -147,7 +148,7 @@ class XmlResponseFormatterTest extends FormatterTest
|
||||
$this->assertEquals($this->xmlHead . "<$rootTag>1</$rootTag>\n", $this->response->content);
|
||||
}
|
||||
|
||||
public function testRootTagRemoval()
|
||||
public function testRootTagRemoval(): void
|
||||
{
|
||||
$formatter = $this->getFormatterInstance([
|
||||
'rootTag' => null,
|
||||
@@ -158,7 +159,7 @@ class XmlResponseFormatterTest extends FormatterTest
|
||||
$this->assertEquals($this->xmlHead . "1\n", $this->response->content);
|
||||
}
|
||||
|
||||
public function testNoObjectTags()
|
||||
public function testNoObjectTags(): void
|
||||
{
|
||||
$formatter = $this->getFormatterInstance([
|
||||
'useObjectTags' => false,
|
||||
@@ -169,7 +170,7 @@ class XmlResponseFormatterTest extends FormatterTest
|
||||
$this->assertEquals($this->xmlHead . "<response><id>123</id><title>abc</title></response>\n", $this->response->content);
|
||||
}
|
||||
|
||||
public function testObjectTagToLowercase()
|
||||
public function testObjectTagToLowercase(): void
|
||||
{
|
||||
$formatter = $this->getFormatterInstance(['objectTagToLowercase' => true]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user