コード例 #1
0
ファイル: BehaviorTest.php プロジェクト: kyleing/laravel-tool
 public function testBehaviorRun()
 {
     $config = ['behavior' => ['tags' => ['test' => ['before' => ['\\Codelint\\Laravel\\Behavior\\TestBehavior'], 'after' => ['\\Codelint\\Laravel\\Behavior\\ExceptionBehavior'], 'no_exception' => ['@\\Codelint\\Laravel\\Behavior\\ExceptionBehavior', '\\Codelint\\Laravel\\Behavior\\TestBehavior']]]]];
     Behavior::setConfig($config);
     Behavior::tag('test.before', $config);
     $this->assertEquals([], $config['behavior']['tags']['test']['before']);
     try {
         Behavior::tag('test.after', $config);
         $this->assertFalse(true, 'there is except a exception occur, but not');
     } catch (BehaviorException $e) {
     }
     $config['exception.before'] = false;
     Behavior::tag('test.no_exception', $config);
     $this->assertTrue($config['exception.before']);
 }