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