function it_should_build_the_cache_when_auto_cache_is_enabled_and_the_cache_item_is_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-1'));
$cache->set(Argument::any())->shouldBeCalled();
$parser->parse('ad', 'user')->willReturn(new LdapObjectSchema('ad', 'user'));
$parser->parse('ad', 'user')->shouldBeCalled();
$parser->getSchemaModificationTime('ad')->willReturn(new \DateTime('2015-1-2'));
$this->beConstructedWith($cache, $parser, $dispatcher);
$this->get('ad', LdapObjectType::USER)->shouldReturnAnInstanceOf('\\LdapTools\\Schema\\LdapObjectSchema');
}