izzum\statemachine\EntityBuilderTest::shouldThrowException PHP Метод

shouldThrowException() публичный Метод

    public function shouldThrowException()
    {
        $identifier = new Identifier(-1, 'order');
        $builder = new EntityBuilderException(true);
        try {
            $builder->getEntity($identifier);
            $this->fail('should  throw exception');
        } catch (Exception $e) {
            $this->assertEquals(0, $e->getCode());
        }
        $builder = new EntityBuilderException(false);
        try {
            $builder->getEntity($identifier);
            $this->fail('should  throw exception');
        } catch (Exception $e) {
            $this->assertEquals(Exception::BUILDER_FAILURE, $e->getCode());
        }
    }