function testShouldThrowIfParamCountInvalidWithOptionalParamSet() { $runner = new Runner(array(array('Middleware\\MiddlewareWithOptionalParam', array('A', 'optional')))); $env = new DummyEnv(); $this->assertNull($runner->call($env)); $this->assertEquals(array('A-optional ->'), $env->before); $this->assertEquals(array('A-optional <-'), $env->after); }