You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					33 lines
				
				595 B
			
		
		
			
		
	
	
					33 lines
				
				595 B
			| 
								 
											9 years ago
										 
									 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								namespace yiiunit\extensions\bootstrap;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								use yii\bootstrap\ActiveForm;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Tests for ActiveForm widget
							 | 
						||
| 
								 | 
							
								 * 
							 | 
						||
| 
								 | 
							
								 * @group bootstrap
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								class ActiveFormTest extends TestCase
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    protected function setUp()
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        // dirty way to have Request object not throwing exception when running testFormNoRoleAttribute()
							 | 
						||
| 
								 | 
							
								        $_SERVER['REQUEST_URI'] = "index.php";
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        parent::setUp();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * Fixes #196
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    public function testFormNoRoleAttribute()
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        $form = ActiveForm::widget();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        $this->assertNotContains('role="form"', $form);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |