/**
  * Test
  *
  * @return void
  */
 public function testCreateService()
 {
     $cache = Mockery::mock('Zend\\Cache\\Storage\\Adapter\\AbstractAdapter');
     $cache->shouldReceive('getPluginRegistry')->andReturn(array());
     $this->serviceLocator->shouldReceive('get')->once()->with('Cache')->andReturn($cache);
     $instance = $this->object->createService($this->serviceLocator);
     $this->assertInstanceOf('Gc\\Mvc\\Service\\CacheService', $instance);
 }
Beispiel #2
0
 /**
  * Test
  *
  * @return void
  */
 public function testCreateServiceWithFileMemcached()
 {
     $this->config->shouldReceive('getValue')->once()->with('cache_handler')->andReturn('memcached');
     $this->config->shouldReceive('getValue')->once()->with('site_name')->andReturn('GotCms');
     try {
         $instance = $this->object->createService($this->serviceLocator);
         $this->assertInstanceOf('Zend\\Cache\\Storage\\Adapter\\AbstractAdapter', $instance);
     } catch (\Zend\Cache\Exception\ExtensionNotLoadedException $e) {
         //don't care
     }
 }