Ejemplo n.º 1
0
 /**
  * @param mixed $eventListeners
  *
  * @dataProvider invalidEventListenersProvider
  * @expectedException \Fortuneglobe\IceHawk\Exceptions\InvalidEventListenerCollection
  */
 public function testInvalidEventListenersFromConfigThrowsException($eventListeners)
 {
     $config = $this->getMockBuilder(ServesIceHawkConfig::class)->getMockForAbstractClass();
     $config->expects($this->once())->method('getUriRewriter')->willReturn(new UriRewriter());
     $config->expects($this->once())->method('getUriResolver')->willReturn(new UriResolver());
     $config->expects($this->once())->method('getRequestInfo')->willReturn(RequestInfo::fromEnv());
     $config->expects($this->once())->method('getDomainNamespace')->willReturn(__NAMESPACE__);
     $config->expects($this->once())->method('getEventListeners')->willReturn($eventListeners);
     $iceHawk = new IceHawk($config, new IceHawkDelegate());
     $iceHawk->init();
 }
Ejemplo n.º 2
0
<?php

/**
 * Readis
 *
 * @license MIT
 * @author  hollodotme
 * @link    https://github.com/hollodotme/readis
 */
namespace hollodotme\Readis;

use Fortuneglobe\IceHawk\IceHawk;
use hollodotme\Readis\Configs\IceHawkConfig;
use hollodotme\Readis\Configs\IceHawkDelegate;
require __DIR__ . '/../vendor/autoload.php';
$iceHawk = new IceHawk(new IceHawkConfig(), new IceHawkDelegate());
$iceHawk->init();
$iceHawk->handleRequest();