├── .gitignore ├── .php_cs ├── .travis.yml ├── Module.php ├── README.md ├── composer.json ├── config └── module.config.php ├── src └── ReactZF │ ├── Controller │ └── IndexController.php │ ├── Exception │ └── RuntimeException.php │ ├── Module.php │ ├── Mvc │ ├── Application.php │ ├── ApplicationOptions.php │ ├── Request.php │ └── Response.php │ └── Service │ ├── ApplicationManager.php │ └── ApplicationManagerOptions.php └── test ├── ReactZFTest └── Mvc │ ├── RequestTest.php │ └── ResponseTest.php ├── bootstrap.php └── phpunit.xml.dist /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /vendor 3 | /composer.lock 4 | /composer.phar -------------------------------------------------------------------------------- /.php_cs: -------------------------------------------------------------------------------- 1 | exclude("vendor") 5 | ->in(__DIR__ . '/src'); 6 | 7 | return \Symfony\CS\Config\Config::create() 8 | ->finder($finder); -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.4 5 | - 5.5 6 | 7 | before_script: 8 | - composer self-update 9 | - composer --dev install 10 | - cp test/phpunit.xml.dist test/phpunit.xml 11 | 12 | script: 13 | - cd test 14 | - phpunit -------------------------------------------------------------------------------- /Module.php: -------------------------------------------------------------------------------- 1 | array( 41 | 'servers' => array( 42 | // You can rewrite default server options 43 | 'default' => array( 44 | 'port' => 1337, 45 | 'host' => '127.0.0.1' 46 | ) 47 | 48 | // Or specify your own 49 | 'some-server-name-you-like' => array( 50 | 'port' => 1338, 51 | 52 | // optional, react use 127.0.0.1 as default 53 | 'host' => '192.168.0.117' 54 | ), 55 | .. 56 | ) 57 | ) 58 | ); 59 | ``` -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ftdebugger/react-zf2", 3 | "description": "Module for integration Zend Framework 2 and React PHP", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Evgeny Shpilevsky", 8 | "email": "evgeny@shpilevsky.com", 9 | "role": "Developer" 10 | } 11 | ], 12 | "keywords": [ 13 | "zend", 14 | "react" 15 | ], 16 | "autoload": { 17 | "psr-0": { 18 | "ReactZF": "src" 19 | } 20 | }, 21 | "require": { 22 | "php": ">=5.4", 23 | "zendframework/zendframework": ">=2.1.5", 24 | "react/react": "0.4.*" 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "3.7.*" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /config/module.config.php: -------------------------------------------------------------------------------- 1 | array( 5 | 'servers' => array( 6 | 'default' => array( 7 | 'host' => '127.0.0.1', 8 | 'port' => 1337 9 | ) 10 | 11 | ) 12 | ), 13 | 14 | 'controllers' => array( 15 | 'invokables' => array( 16 | 'react-zf-index' => 'ReactZF\Controller\IndexController' 17 | ) 18 | ), 19 | 20 | 'console' => array( 21 | 'router' => array( 22 | 'routes' => array( 23 | 'react-zf-start' => array( 24 | 'options' => array( 25 | 'route' => 'react start [--all] []', 26 | 'defaults' => array( 27 | 'controller' => 'react-zf-index', 28 | 'action' => 'start' 29 | ) 30 | ) 31 | ) 32 | ) 33 | ) 34 | ), 35 | ); 36 | -------------------------------------------------------------------------------- /src/ReactZF/Controller/IndexController.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/7/13 14:44 6 | */ 7 | 8 | namespace ReactZF\Controller; 9 | 10 | use ReactZF\Service\ApplicationManager; 11 | use Zend\Mvc\Controller\AbstractActionController; 12 | 13 | class IndexController extends AbstractActionController 14 | { 15 | 16 | /** 17 | * @var ApplicationManager 18 | */ 19 | protected $applicationManager; 20 | 21 | /** 22 | * Run react application 23 | */ 24 | public function startAction() 25 | { 26 | $manager = $this->getApplicationManager(); 27 | 28 | if ($this->params()->fromRoute('all')) { 29 | $manager->runAll($this->getRequest()); 30 | } else { 31 | $name = $this->params()->fromRoute('server', 'default'); 32 | $manager->createServer($name)->loop(); 33 | } 34 | } 35 | 36 | /** 37 | * @param \ReactZF\Service\ApplicationManager $applicationManager 38 | */ 39 | public function setApplicationManager($applicationManager) 40 | { 41 | $this->applicationManager = $applicationManager; 42 | } 43 | 44 | /** 45 | * @return \ReactZF\Service\ApplicationManager 46 | */ 47 | public function getApplicationManager() 48 | { 49 | if (!$this->applicationManager) { 50 | $this->applicationManager = $this->getServiceLocator()->get('ReactZFApplicationManager'); 51 | } 52 | 53 | return $this->applicationManager; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/ReactZF/Exception/RuntimeException.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/7/13 14:55 6 | */ 7 | 8 | namespace ReactZF\Exception; 9 | 10 | class RuntimeException extends \RuntimeException 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/ReactZF/Module.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/7/13 14:31 6 | */ 7 | 8 | namespace ReactZF; 9 | 10 | use ReactZF\Service\ApplicationManager; 11 | use ReactZF\Service\ApplicationManagerOptions; 12 | use Zend\Console\Adapter\AdapterInterface; 13 | use Zend\ModuleManager\Feature\AutoloaderProviderInterface; 14 | use Zend\ModuleManager\Feature\ConfigProviderInterface; 15 | use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface; 16 | use Zend\ModuleManager\Feature\ServiceProviderInterface; 17 | use Zend\ServiceManager\ServiceManager; 18 | 19 | class Module implements 20 | ConfigProviderInterface, 21 | AutoloaderProviderInterface, 22 | ConsoleUsageProviderInterface, 23 | ServiceProviderInterface 24 | { 25 | 26 | /** 27 | * @inheritdoc 28 | */ 29 | public function getConfig() 30 | { 31 | return include __DIR__ . "/../../config/module.config.php"; 32 | } 33 | 34 | /** 35 | * @inheritdoc 36 | */ 37 | public function getAutoloaderConfig() 38 | { 39 | return array( 40 | 'Zend\Loader\StandardAutoloader' => array( 41 | 'namespaces' => array( 42 | __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, 43 | ), 44 | ) 45 | ); 46 | 47 | } 48 | 49 | /** 50 | * @inheritdoc 51 | */ 52 | public function getConsoleUsage(AdapterInterface $console) 53 | { 54 | return array( 55 | 'Run react application', 56 | 'react start --all' => 'run all exists servers', 57 | 'react start [server]' => 'if no server name specified, "default" will be used', 58 | ); 59 | } 60 | 61 | /** 62 | * @inheritdoc 63 | */ 64 | public function getServiceConfig() 65 | { 66 | return array( 67 | 'factories' => array( 68 | 'ReactZFApplicationManagerOptions' => function (ServiceManager $sm) { 69 | $configuration = $sm->get('Configuration'); 70 | $options = isset($configuration['ReactZF']) ? $configuration['ReactZF'] : []; 71 | 72 | return new ApplicationManagerOptions($options); 73 | }, 74 | 'ReactZFApplicationManager' => function (ServiceManager $sm) { 75 | /** @var ApplicationManagerOptions $options */ 76 | $options = $sm->get('ReactZFApplicationManagerOptions'); 77 | $configuration = $sm->get('ApplicationConfig'); 78 | 79 | return new ApplicationManager($options, $configuration); 80 | } 81 | ) 82 | ); 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/ReactZF/Mvc/Application.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/4/13 12:44 6 | */ 7 | 8 | namespace ReactZF\Mvc; 9 | 10 | use React\EventLoop\Factory; 11 | use React\Http\Server as HttpServer; 12 | use React\Socket\Server as SocketServer; 13 | use Zend\Mvc\Application as ZendApplication; 14 | use Zend\Mvc\MvcEvent; 15 | use Zend\ServiceManager\ServiceManager; 16 | 17 | class Application extends ZendApplication 18 | { 19 | 20 | /** 21 | * @var ApplicationOptions 22 | */ 23 | protected $serverOptions; 24 | 25 | /** 26 | * Constructor 27 | * 28 | * @param array $configuration 29 | * @param ServiceManager $serviceManager 30 | */ 31 | public function __construct($configuration, ServiceManager $serviceManager) 32 | { 33 | $this->configuration = $configuration; 34 | $this->serviceManager = $serviceManager; 35 | 36 | $this->setEventManager($serviceManager->get('EventManager')); 37 | $this->request = new Request(); 38 | $this->response = new Response(); 39 | } 40 | 41 | /** 42 | * @return void 43 | */ 44 | public function loop() 45 | { 46 | $loop = Factory::create(); 47 | $socket = new SocketServer($loop); 48 | $http = new HttpServer($socket); 49 | 50 | $this->getEventManager()->attach(MvcEvent::EVENT_FINISH, [$this, 'renderRequest'], -1000); 51 | 52 | $http->on('request', [$this, 'processRequest']); 53 | $socket->listen($this->serverOptions->getPort(), $this->serverOptions->getHost()); 54 | $loop->run(); 55 | } 56 | 57 | /** 58 | * @param \React\Http\Request $request 59 | * @param \React\Http\Response $response 60 | */ 61 | public function processRequest($request, $response) 62 | { 63 | $request->on( 64 | 'data', function ($dataBuffer) use($request, $response) { 65 | $this->request = new Request(); 66 | $this->request->setContent($dataBuffer); 67 | $this->request->setReactRequest($request); 68 | 69 | $this->response = new Response(); 70 | $this->response->setReactResponse($response); 71 | 72 | $allow = $this->getServiceManager()->getAllowOverride(); 73 | 74 | $this->getServiceManager()->setAllowOverride(true); 75 | $this->getServiceManager()->setService('Request', $this->request); 76 | $this->getServiceManager()->setService('Response', $this->response); 77 | $this->getServiceManager()->setAllowOverride($allow); 78 | 79 | $event = $this->getMvcEvent(); 80 | $event->setError(null); 81 | $event->setRequest($this->getRequest()); 82 | $event->setResponse($this->getResponse()); 83 | 84 | $this->run(); 85 | } 86 | ); 87 | } 88 | 89 | /** 90 | * @param MvcEvent $event 91 | */ 92 | public function renderRequest(MvcEvent $event) 93 | { 94 | /** @var Response $zendResponse */ 95 | $zendResponse = $event->getResponse(); 96 | $zendResponse->send(); 97 | $event->stopPropagation(); 98 | } 99 | 100 | /** 101 | * Set value of Options 102 | * 103 | * @param \ReactZF\Mvc\ApplicationOptions $options 104 | */ 105 | public function setServerOptions($options) 106 | { 107 | $this->serverOptions = $options; 108 | } 109 | 110 | /** 111 | * Return value of Options 112 | * 113 | * @return \ReactZF\Mvc\ApplicationOptions 114 | */ 115 | public function getServerOptions() 116 | { 117 | return $this->serverOptions; 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /src/ReactZF/Mvc/ApplicationOptions.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/6/13 15:43 6 | */ 7 | 8 | namespace ReactZF\Mvc; 9 | 10 | use Zend\Stdlib\AbstractOptions; 11 | 12 | class ApplicationOptions extends AbstractOptions 13 | { 14 | 15 | /** 16 | * @var int 17 | */ 18 | protected $port = 1337; 19 | 20 | /** 21 | * @var string 22 | */ 23 | protected $host = '127.0.0.1'; 24 | 25 | /** 26 | * Set value of Host 27 | * 28 | * @param string $host 29 | */ 30 | public function setHost($host) 31 | { 32 | $this->host = $host; 33 | } 34 | 35 | /** 36 | * Return value of Host 37 | * 38 | * @return string 39 | */ 40 | public function getHost() 41 | { 42 | return $this->host; 43 | } 44 | 45 | /** 46 | * Set value of Port 47 | * 48 | * @param int $port 49 | */ 50 | public function setPort($port) 51 | { 52 | $this->port = $port; 53 | } 54 | 55 | /** 56 | * Return value of Port 57 | * 58 | * @return int 59 | */ 60 | public function getPort() 61 | { 62 | return $this->port; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/ReactZF/Mvc/Request.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/4/13 21:43 6 | */ 7 | 8 | namespace ReactZF\Mvc; 9 | 10 | use \Zend\Http\PhpEnvironment\Request as ZendRequest; 11 | use \React\Http\Request as ReactRequest; 12 | use Zend\Stdlib\Parameters; 13 | 14 | class Request extends ZendRequest 15 | { 16 | 17 | /** 18 | * @var ReactRequest 19 | */ 20 | protected $reactRequest; 21 | 22 | /** 23 | * Set value of ReactRequest 24 | * 25 | * @param \React\Http\Request $reactRequest 26 | */ 27 | public function setReactRequest($reactRequest) 28 | { 29 | $this->reactRequest = $reactRequest; 30 | $this->setUri($reactRequest->getPath()); 31 | $this->getHeaders()->addHeaders($reactRequest->getHeaders()); 32 | $this->setMethod($reactRequest->getMethod()); 33 | $this->setQuery(new Parameters($reactRequest->getQuery())); 34 | } 35 | 36 | /** 37 | * @param string $value 38 | * 39 | * @return \Zend\Stdlib\Message 40 | */ 41 | public function setContent($value) 42 | { 43 | parse_str($value, $arr); 44 | if (is_array($arr)) { 45 | $this->setPost(new Parameters($arr)); 46 | } 47 | 48 | return parent::setContent($value); 49 | } 50 | 51 | /** 52 | * Return value of ReactRequest 53 | * 54 | * @return \React\Http\Request 55 | */ 56 | public function getReactRequest() 57 | { 58 | return $this->reactRequest; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/ReactZF/Mvc/Response.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/4/13 21:43 6 | */ 7 | 8 | namespace ReactZF\Mvc; 9 | 10 | use \Zend\Http\PhpEnvironment\Response as ZendResponse; 11 | use \React\Http\Response as ReactResponse; 12 | 13 | class Response extends ZendResponse 14 | { 15 | /** 16 | * @var ReactResponse 17 | */ 18 | protected $reactResponse; 19 | 20 | /** 21 | * @return ZendResponse 22 | */ 23 | public function sendHeaders() 24 | { 25 | $this->getReactResponse()->writeHead($this->getStatusCode(), $this->getHeaders()->toArray()); 26 | 27 | return $this; 28 | } 29 | 30 | /** 31 | * @return ZendResponse 32 | */ 33 | public function sendContent() 34 | { 35 | $this->getReactResponse()->end($this->getContent()); 36 | 37 | return $this; 38 | } 39 | 40 | /** 41 | * Set value of ReactResponse 42 | * 43 | * @param \React\Http\Response $reactResponse 44 | */ 45 | public function setReactResponse($reactResponse) 46 | { 47 | $this->reactResponse = $reactResponse; 48 | } 49 | 50 | /** 51 | * Return value of ReactResponse 52 | * 53 | * @return \React\Http\Response 54 | */ 55 | public function getReactResponse() 56 | { 57 | return $this->reactResponse; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/ReactZF/Service/ApplicationManager.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/7/13 14:53 6 | */ 7 | namespace ReactZF\Service; 8 | 9 | use ReactZF\Mvc\Application; 10 | use Zend\Console\Console; 11 | use Zend\Console\Request; 12 | use Zend\Mvc\Service\ServiceManagerConfig; 13 | use Zend\ServiceManager\ServiceManager; 14 | 15 | class ApplicationManager 16 | { 17 | 18 | /** 19 | * @var ApplicationManagerOptions 20 | */ 21 | protected $options; 22 | 23 | /** 24 | * @var array 25 | */ 26 | protected $configuration; 27 | 28 | /** 29 | * @param ApplicationManagerOptions $options 30 | * @param array $configuration 31 | */ 32 | public function __construct(ApplicationManagerOptions $options, array $configuration) 33 | { 34 | $this->options = $options; 35 | $this->configuration = $configuration; 36 | } 37 | 38 | /**s 39 | * 40 | * @param string $name 41 | * 42 | * @return \ReactZF\Mvc\Application 43 | */ 44 | public function createServer($name = 'default') 45 | { 46 | Console::overrideIsConsole(false); 47 | 48 | $configuration = $this->configuration; 49 | 50 | $smConfig = isset($configuration['service_manager']) ? $configuration['service_manager'] : array(); 51 | 52 | $serviceManager = new ServiceManager(new ServiceManagerConfig($smConfig)); 53 | $serviceManager->setService('ApplicationConfig', $configuration); 54 | $serviceManager->get('ModuleManager')->loadModules(); 55 | 56 | $application = new Application($configuration, $serviceManager); 57 | $application->setServerOptions($this->options->getServer($name)); 58 | 59 | $allow = $serviceManager->getAllowOverride(); 60 | 61 | $serviceManager->setAllowOverride(true); 62 | $serviceManager->setService('application', $application); 63 | $serviceManager->setAllowOverride($allow); 64 | 65 | return $application->bootstrap(); 66 | } 67 | 68 | /** 69 | * Execute all servers 70 | * 71 | * @param Request $request 72 | */ 73 | public function runAll(Request $request) 74 | { 75 | foreach ($this->options->getServers() as $name => $server) { 76 | $command = []; 77 | 78 | $command[] = 'php'; 79 | $command[] = '-f'; 80 | $command[] = escapeshellarg($request->getScriptName()); 81 | $command[] = 'react'; 82 | $command[] = 'start'; 83 | $command[] = escapeshellarg($name); 84 | $command[] = '>/dev/null 2>/dev/null &'; 85 | 86 | system(implode(" ", $command)); 87 | } 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/ReactZF/Service/ApplicationManagerOptions.php: -------------------------------------------------------------------------------- 1 | 4 | * @license MIT 5 | * @date 5/7/13 14:54 6 | */ 7 | 8 | namespace ReactZF\Service; 9 | 10 | use ReactZF\Exception\RuntimeException; 11 | use ReactZF\Mvc\ApplicationOptions; 12 | use Zend\Stdlib\AbstractOptions; 13 | 14 | class ApplicationManagerOptions extends AbstractOptions 15 | { 16 | 17 | /** 18 | * @var array 19 | */ 20 | protected $servers = array(); 21 | 22 | /** 23 | * Set value of Servers 24 | * 25 | * @param array $servers 26 | */ 27 | public function setServers(array $servers) 28 | { 29 | $this->servers = $servers; 30 | } 31 | 32 | /** 33 | * Return value of Servers 34 | * 35 | * @return array 36 | */ 37 | public function getServers() 38 | { 39 | return $this->servers; 40 | } 41 | 42 | /** 43 | * @param string $name 44 | * 45 | * @return mixed 46 | * @throws \ReactZF\Exception\RuntimeException 47 | */ 48 | public function getServer($name) 49 | { 50 | if (!isset($this->servers[$name])) { 51 | throw new RuntimeException('Configuration of server "' . $name . '" not found'); 52 | } 53 | 54 | return new ApplicationOptions($this->servers[$name]); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /test/ReactZFTest/Mvc/RequestTest.php: -------------------------------------------------------------------------------- 1 | 4 | */ 5 | 6 | namespace ReactZFTest\Mvc; 7 | 8 | 9 | use ReactZF\Mvc\Request; 10 | use React\Http\Request as ReactRequest; 11 | 12 | class RequestTest extends \PHPUnit_Framework_TestCase 13 | { 14 | 15 | /** 16 | * @var Request 17 | */ 18 | protected $object; 19 | 20 | 21 | protected function setUp() 22 | { 23 | $this->object = new Request(); 24 | } 25 | 26 | public function testSetReactRequest() 27 | { 28 | $request = new ReactRequest('POST', '/test/', ['a' => 1], '1.1', ['User-Agent' => 'phpunit']); 29 | $this->object->setReactRequest($request); 30 | 31 | $this->assertTrue($this->object->isPost()); 32 | $this->assertEquals('/test/', $this->object->getUriString()); 33 | $this->assertCount(1, $this->object->getHeaders()); 34 | $this->assertEquals('phpunit', $this->object->getHeader('user-agent')->getFieldValue()); 35 | $this->assertEquals('1', $this->object->getQuery()->get('a')); 36 | } 37 | 38 | public function testGetReactRequest() 39 | { 40 | $request = new ReactRequest('POST', '/test/', ['a' => 1], '1.1', ['User-Agent' => 'phpunit']); 41 | $this->object->setReactRequest($request); 42 | $this->assertInstanceOf('React\Http\Request', $this->object->getReactRequest()); 43 | } 44 | 45 | public function testSetContent() 46 | { 47 | $this->object->setContent('a=11&b=12'); 48 | $this->assertEquals('a=11&b=12', $this->object->getContent()); 49 | $this->assertEquals('11', $this->object->getPost('a')); 50 | $this->assertEquals('12', $this->object->getPost('b')); 51 | } 52 | 53 | public function testSetContentJson() 54 | { 55 | $this->object->setContent('{"status": 1}'); 56 | $this->assertEquals('{"status": 1}', $this->object->getContent()); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /test/ReactZFTest/Mvc/ResponseTest.php: -------------------------------------------------------------------------------- 1 | 4 | */ 5 | 6 | namespace ReactZFTest\Mvc; 7 | 8 | 9 | use ReactZF\Mvc\Response; 10 | 11 | class ResponseTest extends \PHPUnit_Framework_TestCase 12 | { 13 | 14 | /** 15 | * @var Response 16 | */ 17 | protected $object; 18 | 19 | 20 | protected function setUp() 21 | { 22 | $this->object = new Response(); 23 | } 24 | 25 | public function testSendHeaders() 26 | { 27 | $this->object->setStatusCode(400); 28 | $this->object->getHeaders()->addHeaderLine('Content-Type', 'plain/text'); 29 | 30 | $response = $this->getMockBuilder('React\Http\Response') 31 | ->setMethods(['writeHead']) 32 | ->disableOriginalConstructor() 33 | ->getMock(); 34 | 35 | $response->expects($this->once()) 36 | ->method('writeHead') 37 | ->with($this->equalTo(400), $this->equalTo(['Content-Type' => 'plain/text'])); 38 | 39 | $this->object->setReactResponse($response); 40 | $this->object->sendHeaders(); 41 | } 42 | 43 | public function testSendContent() 44 | { 45 | $this->object->setContent('body'); 46 | 47 | $response = $this->getMockBuilder('React\Http\Response') 48 | ->setMethods(['end']) 49 | ->disableOriginalConstructor() 50 | ->getMock(); 51 | 52 | $response->expects($this->once()) 53 | ->method('end') 54 | ->with($this->equalTo('body')); 55 | 56 | $this->object->setReactResponse($response); 57 | $this->object->sendContent(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /test/bootstrap.php: -------------------------------------------------------------------------------- 1 | 4 | */ 5 | 6 | 7 | namespace ReactZFTest; 8 | 9 | /** @var \Composer\Autoload\ClassLoader $loader */ 10 | $loader = include __DIR__ . "/../vendor/autoload.php"; 11 | $loader->add('ReactZFTest', __DIR__ . "/ReactZFTest"); 12 | -------------------------------------------------------------------------------- /test/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ./ 5 | 6 | 7 | --------------------------------------------------------------------------------