mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-01 03:26:36 +08:00 
			
		
		
		
	Raise version min PHP 7.3.
				
					
				
			This commit is contained in:
		| @ -19,7 +19,7 @@ use yiiunit\TestCase; | ||||
|  */ | ||||
| class HtmlTest extends TestCase | ||||
| { | ||||
|     protected function setUp() | ||||
|     protected function setUp(): void | ||||
|     { | ||||
|         parent::setUp(); | ||||
|         $this->mockApplication([ | ||||
| @ -1958,6 +1958,7 @@ EOD; | ||||
|     public function testAttributeNameException($name) | ||||
|     { | ||||
|         $this->expectException('yii\base\InvalidArgumentException'); | ||||
|  | ||||
|         Html::getAttributeName($name); | ||||
|     } | ||||
|  | ||||
| @ -1994,12 +1995,11 @@ EOD; | ||||
|         $this->assertEqualsWithoutLE($expected, $actual); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @expectedException \yii\base\InvalidArgumentException | ||||
|      * @expectedExceptionMessage Attribute name must contain word characters only. | ||||
|      */ | ||||
|     public function testGetAttributeValueInvalidArgumentException() | ||||
|     { | ||||
|         $this->expectException(\yii\base\InvalidArgumentException::class); | ||||
|         $this->expectExceptionMessage('Attribute name must contain word characters only.'); | ||||
|  | ||||
|         $model = new HtmlTestModel(); | ||||
|         Html::getAttributeValue($model, '-'); | ||||
|     } | ||||
| @ -2029,24 +2029,24 @@ EOD; | ||||
|         $this->assertSame($expected, $actual); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @expectedException \yii\base\InvalidArgumentException | ||||
|      * @expectedExceptionMessage Attribute name must contain word characters only. | ||||
|      */ | ||||
|     public function testGetInputNameInvalidArgumentExceptionAttribute() | ||||
|     { | ||||
|         $model = new HtmlTestModel(); | ||||
|  | ||||
|         $this->expectException(\yii\base\InvalidArgumentException::class); | ||||
|         $this->expectExceptionMessage('Attribute name must contain word characters only.'); | ||||
|  | ||||
|         Html::getInputName($model, '-'); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @expectedException \yii\base\InvalidArgumentException | ||||
|      * @expectedExceptionMessageRegExp /(.*)formName\(\) cannot be empty for tabular inputs.$/ | ||||
|      */ | ||||
|     public function testGetInputNameInvalidArgumentExceptionFormName() | ||||
|     { | ||||
|         $model = $this->getMockBuilder('yii\\base\\Model')->getMock(); | ||||
|         $model->method('formName')->willReturn(''); | ||||
|  | ||||
|         $this->expectException(\yii\base\InvalidArgumentException::class); | ||||
|         $this->expectExceptionMessage('cannot be empty for tabular inputs.'); | ||||
|  | ||||
|         Html::getInputName($model, '[foo]bar'); | ||||
|     } | ||||
|  | ||||
| @ -2152,7 +2152,7 @@ HTML; | ||||
|  | ||||
|         $html = Html::activeTextInput($model, 'name', ['placeholder' => true]); | ||||
|  | ||||
|         $this->assertContains('placeholder="Name"', $html); | ||||
|         $this->assertStringContainsString('placeholder="Name"', $html); | ||||
|     } | ||||
|  | ||||
|     public function testActiveTextInput_customPlaceholder() | ||||
| @ -2161,7 +2161,7 @@ HTML; | ||||
|  | ||||
|         $html = Html::activeTextInput($model, 'name', ['placeholder' => 'Custom placeholder']); | ||||
|  | ||||
|         $this->assertContains('placeholder="Custom placeholder"', $html); | ||||
|         $this->assertStringContainsString('placeholder="Custom placeholder"', $html); | ||||
|     } | ||||
|  | ||||
|     public function testActiveTextInput_placeholderFillFromModelTabular() | ||||
| @ -2170,7 +2170,7 @@ HTML; | ||||
|  | ||||
|         $html = Html::activeTextInput($model, '[0]name', ['placeholder' => true]); | ||||
|  | ||||
|         $this->assertContains('placeholder="Name"', $html); | ||||
|         $this->assertStringContainsString('placeholder="Name"', $html); | ||||
|     } | ||||
|  | ||||
|     public function testOverrideSetActivePlaceholder() | ||||
| @ -2179,11 +2179,13 @@ HTML; | ||||
|  | ||||
|         $html = MyHtml::activeTextInput($model, 'name', ['placeholder' => true]); | ||||
|  | ||||
|         $this->assertContains('placeholder="My placeholder: Name"', $html); | ||||
|         $this->assertStringContainsString('placeholder="My placeholder: Name"', $html); | ||||
|     } | ||||
|  | ||||
|     public function testGetInputIdDataProvider() | ||||
|     { | ||||
|         $this->expectNotToPerformAssertions(); | ||||
|  | ||||
|         return [ | ||||
|             [ | ||||
|                 'foo', | ||||
| @ -2223,6 +2225,8 @@ HTML; | ||||
|  | ||||
|     public function testGetInputIdByNameDataProvider() | ||||
|     { | ||||
|         $this->expectNotToPerformAssertions(); | ||||
|  | ||||
|         return [ | ||||
|             [ | ||||
|                 'foo', | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Wilmer Arambula
					Wilmer Arambula