Example #1
0
 public function testAddEvent()
 {
     $sa = Mockery::mock('Kumite\\Adapters\\StorageAdapter');
     $ca = Mockery::mock('Kumite\\Adapters\\CookieAdapter');
     $testConfig = $this->getTestConfig();
     $this->controller->shouldReceive('addEvent')->with('myTest', 'sale', null)->once();
     $k = new Kumite(array('storageAdapter' => $sa, 'cookieAdapter' => $ca, 'tests' => array('myTest' => $testConfig)));
     $k->addEvent('myTest', 'sale', null);
 }
Example #2
0
 public static function setup($configuration)
 {
     if (!isset($configuration['storageAdapter'])) {
         throw new Exception('Missing storageAdapter configuration');
     }
     if (!isset($configuration['tests'])) {
         throw new Exception('Missing tests configuration');
     }
     $cookieAdapter = new Kumite\Adapters\PhpCookieAdapter();
     if (isset($configuration['cookieAdapter'])) {
         $cookieAdapter = $configuration['cookieAdapter'];
     }
     $storageAdapter = $configuration['storageAdapter'];
     $testConfig = $configuration['tests'];
     self::$instance = new Kumite\Controller($cookieAdapter, $storageAdapter, $testConfig);
 }