-
-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathInterfaceTest.php
34 lines (28 loc) · 1.13 KB
/
InterfaceTest.php
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
30
31
32
33
34
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace ApiPlatform\SchemaGenerator\Tests\Model;
use ApiPlatform\SchemaGenerator\Model\Interface_;
use PHPUnit\Framework\TestCase;
class InterfaceTest extends TestCase
{
public function testInterface(): void
{
$interface = new Interface_('Printable', "App\Entity");
$interface->addAnnotation('@see description');
$this->assertEquals($interface->name(), 'Printable');
$this->assertEquals($interface->namespace(), "App\Entity");
$generated = (string) $interface->toNetteFile($fileHeader = 'Package interfaces');
$this->assertStringContainsString('Package interfaces', $generated);
$this->assertStringContainsString('declare(strict_types=1);', $generated);
$this->assertStringContainsString("namespace App\Entity", $generated);
$this->assertStringContainsString('interface Printable', $generated);
}
}