コード例 #1
0
 public function testAddsCallbackCollaborators()
 {
     $this->assertNotEmpty(CachePlugin::getSubscribedEvents());
     $plugin = new CachePlugin(array('can_cache' => function () {
     }));
     $this->assertInstanceOf('Guzzle\\Plugin\\Cache\\CallbackCanCacheStrategy', $this->readAttribute($plugin, 'canCache'));
 }
コード例 #2
0
 public function testAddsCallbackCollaborators()
 {
     $this->assertNotEmpty(CachePlugin::getSubscribedEvents());
     $plugin = new CachePlugin(array('storage' => $this->getMockBuilder('Guzzle\\Plugin\\Cache\\CacheStorageInterface')->getMockForAbstractClass(), 'can_cache' => function () {
     }, 'key_provider' => function () {
     }));
     $this->assertInstanceOf('Guzzle\\Plugin\\Cache\\CallbackCacheKeyProvider', $this->readAttribute($plugin, 'keyProvider'));
     $this->assertInstanceOf('Guzzle\\Plugin\\Cache\\CallbackCanCacheStrategy', $this->readAttribute($plugin, 'canCache'));
 }