public function test_it_throws_exception_if_context_fails_to_resolve() { $this->setExpectedException('StateMachine\\Exceptions\\ContextNotResolvable'); $light = new Light(); $light->context = "InvalidLightContext"; $light->flipSwitch(); $this->assertInstanceOf('StateMachine\\AnotherLightContext', $light->context); }