public function testAddsCallbackCollaborators()
 {
     $this->assertNotEmpty(CachePlugin::getSubscribedEvents());
     $plugin = new CachePlugin(array('can_cache' => function () {
     }));
     $this->assertInstanceOf('Guzzle\\Plugin\\Cache\\CallbackCanCacheStrategy', $this->readAttribute($plugin, 'canCache'));
 }
 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'));
 }