Skip to content

Commit

Permalink
Additional tests for Doctrine_Template_Listener_Cachetaggable::preDql…
Browse files Browse the repository at this point in the history
…Update
  • Loading branch information
fruit committed Jan 24, 2011
1 parent 9e3193d commit 3b59360
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion test/functional/frontend/DoctrineListenerCachetaggableTest.php
Expand Up @@ -200,8 +200,39 @@
'Update DQL does not rewrites object version when cache is disabled'
);

sfConfig::set('sf_cache', $optionSfCache);
$t->is(
$sfTagger->getTag(
sfCacheTaggingToolkit::getBaseClassName($post->getTable()->getClassnameToReturn())
),
$blackSwanVersion,
'Object collection stays unchanged'
);

sfConfig::set('sf_cache', true);

BookTable::getInstance()
->createQuery()
->update()
->set('slug', '?', 'my-slug-1111')
->addWhere('id = ?', $blackSwanId)
->execute();

$post = BookTable::getInstance()->find($blackSwanId);

$t->isnt(
$post->obtainObjectVersion(),
$blackSwanVersion,
'DQL Update updates tags when sf_cache = true'
);

$t->is(
$sfTagger->getTag(
sfCacheTaggingToolkit::getBaseClassName($post->getTable()->getClassnameToReturn())
),
$post->obtainObjectVersion(),
'Object collection also has the same version as last updated object version'
);

#postSave

$optionSfCache = sfConfig::get('sf_cache');
Expand Down

0 comments on commit 3b59360

Please sign in to comment.