예제 #1
0
 /**
  * Test that an event can be fetched
  */
 public function testEventCanBeFetched()
 {
     $this->storage->save(array('type' => 'event', 'sub_type' => 'conversion', 'action' => 'purchase', 'message' => 'Bob Smith just purchased a shoe', 'created' => date('Y-m-d H:i:s'), 'data' => array('foo' => 'bar')));
     $results = $this->storage->fetch(array('type' => 'event', 'sub_type' => 'conversion'));
     $this->assertTrue(1 == count($results));
     $this->assertTrue($results[0]['sub_type'] == 'conversion');
 }
예제 #2
0
 /**
  * Log an event
  *
  * @param LoggableInterface $loggable
  * @return mixed
  */
 public function log(LoggableInterface $loggable)
 {
     if ($loggable instanceof EventCollectionInterface) {
         foreach ($loggable as $eventEntity) {
             $this->storage->save($eventEntity->toArray());
         }
     } else {
         $this->storage->save($loggable->toArray());
     }
 }
예제 #3
0
 /**
  * Test that a null event is fetched
  */
 public function testNullEventIsFetched()
 {
     $this->assertTrue(null === $this->storage->fetch(array()));
 }