Issues (1)

tests/AbstractFactoryTest.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author  : Jagepard <[email protected]>
7
 * @license https://mit-license.org/ MIT
8
 */
9
10
namespace Creational\AbstractFactory\Tests;
11
12
use Creational\AbstractFactory\JsonMessage;
13
use Creational\AbstractFactory\XMLMessage;
14
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;
0 ignored issues
show
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
class AbstractFactoryTest extends PHPUnit_Framework_TestCase
17
{
18
    private string $content = "Message";
19
20
    public function testJson()
21
    {
22
        $content = \json_encode(['content' => $this->content]);
23
24
        $this->assertEquals((new JsonMessage())->createMessage($this->content), $content);
25
    }
26
27
    public function testXML()
28
    {
29
        $dom = new \DOMDocument("1.0", "utf-8");
30
        $content = $dom->createElement("content", $this->content);
31
        $dom->appendChild($content);
32
        $xmlFactory = new XMLMessage();
33
34
        $this->assertEquals($xmlFactory->createMessage($this->content), $dom->saveXML());
35
    }
36
}
37