spec\LdapTools\Factory\LdapObjectSchemaFactorySpec::it_should_not_build_the_cache_when_auto_cache_is_enabled_and_the_cache_item_is_not_out_of_date PHP Метод

it_should_not_build_the_cache_when_auto_cache_is_enabled_and_the_cache_item_is_not_out_of_date() публичный Метод

public it_should_not_build_the_cache_when_auto_cache_is_enabled_and_the_cache_item_is_not_out_of_date ( LdapTools\Cache\CacheInterface $cache, LdapTools\Schema\Parser\SchemaParserInterface $parser, $dispatcher )
$cache LdapTools\Cache\CacheInterface
$parser LdapTools\Schema\Parser\SchemaParserInterface
    function it_should_not_build_the_cache_when_auto_cache_is_enabled_and_the_cache_item_is_not_out_of_date(CacheInterface $cache, SchemaParserInterface $parser, $dispatcher)
    {
        $cache->getUseAutoCache()->willReturn(true);
        $cache->contains(LdapObjectSchema::getCacheType(), 'ad.user')->willReturn(true);
        $cache->getCacheCreationTime(LdapObjectSchema::getCacheType(), 'ad.user')->willReturn(new \DateTime('2015-1-3'));
        $cache->set(Argument::any())->shouldNotBeCalled();
        $cache->get(LdapObjectSchema::getCacheType(), 'ad.user')->willReturn(new LdapObjectSchema('ad', 'user'));
        $parser->parse('ad', 'user')->shouldNotBeCalled();
        $parser->getSchemaModificationTime('ad')->willReturn(new \DateTime('2015-1-2'));
        $this->beConstructedWith($cache, $parser, $dispatcher);
        $this->get('ad', LdapObjectType::USER)->shouldReturnAnInstanceOf('\\LdapTools\\Schema\\LdapObjectSchema');
    }