public function testGetSetMvcEvent() { $cacheEvent = new CacheEvent(); $mvcEvent = new MvcEvent(); $cacheEvent->setMvcEvent($mvcEvent); $this->assertEquals($mvcEvent, $cacheEvent->getMvcEvent()); }
public function testShouldCacheCallsShouldCacheOnStrategy() { $mvcEvent = new MvcEvent(); $cacheEvent = new CacheEvent(); $cacheEvent->setMvcEvent($mvcEvent); $this->strategyMock->shouldReceive('shouldCache')->once()->with($mvcEvent); $this->listener->shouldCache($cacheEvent); }
public function testShouldCacheIsCalledOnConcreteClasses() { $mvcEvent = new MvcEvent(); $event = new CacheEvent(); $event->setMvcEvent($mvcEvent); $this->strategy->shouldCacheCallback($event); $this->assertTrue($this->strategy->shouldCacheCalled); $this->assertSame($this->strategy->mvcEvent, $mvcEvent); }
/** * @param string $eventName * @param MvcEvent|null $mvcEvent * @return CacheEvent */ protected function createCacheEvent($eventName, MvcEvent $mvcEvent = null) { $cacheEvent = new CacheEvent($eventName, $this); $cacheEvent->setMvcEvent($mvcEvent); return $cacheEvent; }