/** * Test proxy behavior in a normal calling when the required state is defined in the call. */ public function testCallMethodOfState() { $this->initializeProxy(); $this->proxy->enableState('state2'); $this->proxy->enableState('state3'); $this->state1->allowMethod(); $this->state2->allowMethod(); $this->state3->allowMethod(); $this->proxy->testOfState2('bar', 'foo'); $this->assertFalse($this->state1->methodWasCalled()); $this->assertTrue($this->state2->methodWasCalled()); $this->assertFalse($this->state3->methodWasCalled()); $this->assertEquals(array('bar', 'foo'), $this->state2->getCalledArguments()); $this->assertEquals('test', $this->state2->getMethodNameCalled()); }