Ejemplo n.º 1
0
 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']);
 }