ReportTest.php in Drupal 7 to 8/9 Module Upgrader 8
File
tests/src/Unit/ReportTest.php
View source
<?php
namespace Drupal\Tests\drupalmoduleupgrader\Unit;
use Drupal\drupalmoduleupgrader\Issue;
use Drupal\drupalmoduleupgrader\Report;
class ReportTest extends TestBase {
private $report;
public function setUp() {
parent::setUp();
$this->report = new Report();
}
public function test() {
$issue = new Issue($this->target, 'Foo');
$this->report
->addIssue($issue);
$issue = new Issue($this->target, 'Baz');
$this->report
->addIssue($issue);
$issues = $this->report
->getIssues();
$this
->assertTrue(is_array($issues));
$this
->assertCount(2, $issues);
$this
->assertInstanceOf('\\Drupal\\drupalmoduleupgrader\\IssueInterface', $issues[0]);
$this
->assertEquals('Foo', $issues[0]
->getTitle());
$this
->assertInstanceOf('\\Drupal\\drupalmoduleupgrader\\IssueInterface', $issues[1]);
$this
->assertEquals('Baz', $issues[1]
->getTitle());
}
}