1
|
|
|
<?php |
2
|
|
|
namespace OnurbTest\Bundle\YumlBundle\DataCollector; |
3
|
|
|
|
4
|
|
|
use Onurb\Bundle\YumlBundle\DataCollector\DoctrineYumlDataCollector; |
5
|
|
|
use PHPUnit\Framework\TestCase; |
6
|
|
|
use Symfony\Component\HttpFoundation\Request; |
7
|
|
|
use Symfony\Component\HttpFoundation\Response; |
8
|
|
|
|
9
|
|
|
class DoctrineYumlDataCollectorTest extends TestCase |
10
|
|
|
{ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @covers \Onurb\Bundle\YumlBundle\DataCollector\DoctrineYumlDataCollector |
14
|
|
|
*/ |
15
|
|
|
public function testIsInstanceOf() |
16
|
|
|
{ |
17
|
|
|
$dataCollector = new DoctrineYumlDataCollector(); |
18
|
|
|
$this->assertInstanceOf("Symfony\\Component\\HttpKernel\\DataCollector\\DataCollector", $dataCollector); |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @covers \Onurb\Bundle\YumlBundle\DataCollector\DoctrineYumlDataCollector |
23
|
|
|
*/ |
24
|
|
|
public function testGetName() |
25
|
|
|
{ |
26
|
|
|
$dataCollector = new DoctrineYumlDataCollector(); |
27
|
|
|
$this->assertSame('doctrine_yuml', $dataCollector->getName()); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @covers \Onurb\Bundle\YumlBundle\DataCollector\DoctrineYumlDataCollector |
32
|
|
|
*/ |
33
|
|
|
public function testCollect() |
34
|
|
|
{ |
35
|
|
|
$dataCollector = new DoctrineYumlDataCollector(); |
36
|
|
|
$dataCollector->collect(new Request(), new Response()); |
37
|
|
|
|
38
|
|
|
$this->assertSame('a:1:{s:13:"doctrine_yuml";a:0:{}}', $dataCollector->serialize()); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @covers \Onurb\Bundle\YumlBundle\DataCollector\DoctrineYumlDataCollector |
43
|
|
|
*/ |
44
|
|
|
public function testReset() |
45
|
|
|
{ |
46
|
|
|
$dataCollector = new DoctrineYumlDataCollector(); |
47
|
|
|
$dataCollector->collect(new Request(), new Response()); |
48
|
|
|
|
49
|
|
|
$this->assertSame('a:1:{s:13:"doctrine_yuml";a:0:{}}', $dataCollector->serialize()); |
50
|
|
|
|
51
|
|
|
$dataCollector->reset(); |
52
|
|
|
|
53
|
|
|
$this->assertSame('a:0:{}', $dataCollector->serialize()); |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
|