File tree Expand file tree Collapse file tree 5 files changed +28
-15
lines changed
Expand file tree Collapse file tree 5 files changed +28
-15
lines changed Original file line number Diff line number Diff line change 1111 }
1212 ],
1313 "autoload" : {
14- "psr-4" : {"React\\ Datagram\\ " : " src" }
14+ "psr-4" : {
15+ "React\\ Datagram\\ " : " src"
16+ }
17+ },
18+ "autoload-dev" : {
19+ "psr-4" : {
20+ "React\\ Tests\\ Datagram\\ " : " tests"
21+ }
1522 },
1623 "require" : {
1724 "php" : " >=5.3" ,
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22
3- <phpunit colors =" true" bootstrap =" ./tests/bootstrap.php" >
3+ <phpunit backupGlobals =" false"
4+ backupStaticAttributes =" false"
5+ colors =" true"
6+ convertErrorsToExceptions =" true"
7+ convertNoticesToExceptions =" true"
8+ convertWarningsToExceptions =" true"
9+ processIsolation =" false"
10+ stopOnFailure =" false"
11+ bootstrap =" vendor/autoload.php"
12+ >
413 <testsuites >
514 <testsuite name =" Datagram Test Suite" >
615 <directory >./tests/</directory >
Original file line number Diff line number Diff line change 11<?php
22
3+ namespace React \Tests \Datagram ;
4+
35use React \Datagram \Socket ;
46use React \Datagram \Factory ;
57use Clue \React \Block ;
@@ -13,7 +15,7 @@ class FactoryTest extends TestCase
1315
1416 public function setUp ()
1517 {
16- $ this ->loop = React \EventLoop \Factory::create ();
18+ $ this ->loop = \ React \EventLoop \Factory::create ();
1719 $ this ->resolver = $ this ->createResolverMock ();
1820 $ this ->factory = new Factory ($ this ->loop , $ this ->resolver );
1921 }
Original file line number Diff line number Diff line change 11<?php
22
3+ namespace React \Tests \Datagram ;
4+
35use React \Datagram \Socket ;
46use Clue \React \Block ;
57
@@ -10,8 +12,8 @@ class SocketTest extends TestCase
1012
1113 public function setUp ()
1214 {
13- $ this ->loop = React \EventLoop \Factory::create ();
14- $ this ->factory = new React \Datagram \Factory ($ this ->loop , $ this ->createResolverMock ());
15+ $ this ->loop = \ React \EventLoop \Factory::create ();
16+ $ this ->factory = new \ React \Datagram \Factory ($ this ->loop , $ this ->createResolverMock ());
1517 }
1618
1719 public function testCreateClientCloseWillNotBlock ()
Original file line number Diff line number Diff line change 11<?php
22
3- require __DIR__ . ' /../vendor/autoload.php ' ;
3+ namespace React \ Tests \ Datagram ;
44
5- abstract class TestCase extends PHPUnit_Framework_TestCase
5+ abstract class TestCase extends \ PHPUnit_Framework_TestCase
66{
77 protected function expectCallableOnce ()
88 {
@@ -26,18 +26,11 @@ protected function expectCallableNever()
2626
2727 protected function createCallableMock ()
2828 {
29- return $ this ->getMockBuilder ('CallableStub ' )->getMock ();
29+ return $ this ->getMockBuilder ('stdClass ' )-> setMethods ( array ( ' __invoke ' ) )->getMock ();
3030 }
3131
3232 protected function createResolverMock ()
3333 {
3434 return $ this ->getMockBuilder ('React\Dns\Resolver\ResolverInterface ' )->getMock ();
3535 }
3636}
37-
38- class CallableStub
39- {
40- public function __invoke ()
41- {
42- }
43- }
You can’t perform that action at this time.
0 commit comments