public function testBrokenFieldIsReturnedWhenDebugIsDisabledAndFieldIsInvalid() { $old_val = Incorrect_Syntax_Exception::$throw_errors; Incorrect_Syntax_Exception::$throw_errors = false; $field = Field::make('__no_such_field_type__', $this->fieldName); $this->assertInstanceOf('Carbon_Fields\\Field\\Broken_Field', $field); Incorrect_Syntax_Exception::$throw_errors = $old_val; }
/** * @covers Carbon_Fields\Container\Container::make * @covers Carbon_Fields\Container\Container::factory * @covers Carbon_Fields\Container\Container::__construct */ public function testBrokenContainerIsReturnedWhenDebugIsDisabledAndContainerIsInvalid() { $old_val = Incorrect_Syntax_Exception::$throw_errors; Incorrect_Syntax_Exception::$throw_errors = false; $container = Container::make('__no_such_container_type__', $this->containerTitle); $this->assertInstanceOf('Carbon_Fields\\Container\\Broken_Container', $container); Incorrect_Syntax_Exception::$throw_errors = $old_val; }