phpmock\environment\SleepEnvironmentBuilderTest::testAddNamespace PHP Method

testAddNamespace() public method

Tests mocking functions accross several namespaces.
public testAddNamespace ( )
    public function testAddNamespace()
    {
        $builder = new SleepEnvironmentBuilder();
        $builder->addNamespace(__NAMESPACE__)->addNamespace("testAddNamespace")->setTimestamp(1234);
        $this->environment->disable();
        $this->environment = $builder->build();
        $this->environment->enable();
        $time = time();
        \testAddNamespace\sleep(123);
        sleep(123);
        $this->assertEquals(2 * 123 + $time, time());
        $this->assertEquals(2 * 123 + $time, \testAddNamespace\time());
    }