Phalcon\Test\Unit\DiTest::testSetAnonymousFunction PHP Method

testSetAnonymousFunction() public method

Tests registering a service via anonymous function
Since: 2016-01-29
Author: Serghei Iakovlev ([email protected])
    public function testSetAnonymousFunction()
    {
        $this->specify("Registering a service via anonymous function does now work correctly", function () {
            $this->phDi->set('request2', function () {
                return new Request();
            });
            expect(get_class($this->phDi->get('request2')))->equals('Phalcon\\Http\\Request');
        });
    }