izzum\statemachine\loader\JSONTest::shouldThrowExceptionForNoReadPermissions PHP Method

shouldThrowExceptionForNoReadPermissions() public method

    public function shouldThrowExceptionForNoReadPermissions()
    {
        $machine = new StateMachine(new Context(new Identifier('json-test', 'json-machine')));
        try {
            $loader = JSON::createFromFile(__DIR__ . '/fixture-no-permission.json');
            $this->fail('should not come here');
        } catch (Exception $e) {
            $this->assertEquals(Exception::BAD_LOADERDATA, $e->getCode());
            $this->assertContains('Failed to read', $e->getMessage());
        }
    }