forked from clue/reactphp-mdns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactoryTest.php
More file actions
29 lines (21 loc) · 738 Bytes
/
FactoryTest.php
File metadata and controls
29 lines (21 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace Clue\Tests\React\Mdns;
use Clue\React\Mdns\Factory;
class FactoryTest extends TestCase
{
public function testCreateResolver()
{
$loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
$factory = new Factory($loop);
$resolver = $factory->createResolver();
$this->assertInstanceOf('React\Dns\Resolver\Resolver', $resolver);
}
public function testConstructWithoutLoopAssignsLoopAutomatically()
{
$factory = new Factory();
$ref = new \ReflectionProperty($factory, 'loop');
$ref->setAccessible(true);
$loop = $ref->getValue($factory);
$this->assertInstanceOf('React\EventLoop\LoopInterface', $loop);
}
}