mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 14:46:19 +08:00 
			
		
		
		
	Merge pull request #15715 from berosoboy/fix-test-output
Prevent output among phpunit tests
This commit is contained in:
		@ -141,6 +141,7 @@ HTML
 | 
				
			|||||||
    public function testShouldTriggerInitEvent()
 | 
					    public function testShouldTriggerInitEvent()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $initTriggered = false;
 | 
					        $initTriggered = false;
 | 
				
			||||||
 | 
					        ob_start();
 | 
				
			||||||
        $form = ActiveForm::begin(
 | 
					        $form = ActiveForm::begin(
 | 
				
			||||||
            [
 | 
					            [
 | 
				
			||||||
                'action' => '/something',
 | 
					                'action' => '/something',
 | 
				
			||||||
@ -151,6 +152,7 @@ HTML
 | 
				
			|||||||
            ]
 | 
					            ]
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        ActiveForm::end();
 | 
					        ActiveForm::end();
 | 
				
			||||||
 | 
					        ob_end_clean();
 | 
				
			||||||
        $this->assertTrue($initTriggered);
 | 
					        $this->assertTrue($initTriggered);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -45,6 +45,7 @@ class PjaxTest extends TestCase
 | 
				
			|||||||
    public function testShouldTriggerInitEvent()
 | 
					    public function testShouldTriggerInitEvent()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $initTriggered = false;
 | 
					        $initTriggered = false;
 | 
				
			||||||
 | 
					        ob_start();
 | 
				
			||||||
        $pjax = new Pjax(
 | 
					        $pjax = new Pjax(
 | 
				
			||||||
            [
 | 
					            [
 | 
				
			||||||
                'on init' => function () use (&$initTriggered) {
 | 
					                'on init' => function () use (&$initTriggered) {
 | 
				
			||||||
@ -52,7 +53,7 @@ class PjaxTest extends TestCase
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            ]
 | 
					            ]
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					        ob_end_clean();
 | 
				
			||||||
        $this->assertTrue($initTriggered);
 | 
					        $this->assertTrue($initTriggered);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user