Go\Core\GoAspectContainerTest::testResourceManagement PHP Method

testResourceManagement() public method

Tests that container resources can be added and isFresh works correctly
    public function testResourceManagement()
    {
        // Without resources this should be always true
        $isFresh = $this->container->isFresh(time());
        $this->assertTrue($isFresh);
        $this->container->addResource(__FILE__);
        $realMtime = filemtime(__FILE__);
        $isFresh = $this->container->isFresh($realMtime - 3600);
        $this->assertFalse($isFresh);
        $isFresh = $this->container->isFresh($realMtime + 3600);
        $this->assertTrue($isFresh);
    }