fix tests

This commit is contained in:
Dennis Eichhorn 2020-11-28 19:26:40 +01:00
parent 49eec36689
commit 4b20365483
3 changed files with 12 additions and 12 deletions

View File

@ -40,7 +40,7 @@ class WikiCategoryTest extends \PHPUnit\Framework\TestCase
public function testDefault() : void
{
self::assertEquals(0, $this->category->getId());
self::assertEquals(0, $this->category->getApp()->getId());
self::assertEquals(0, $this->category->app->getId());
self::assertEquals('', $this->category->getName());
self::assertEquals('/', $this->category->getVirtualPath());
self::assertEquals(0, $this->category->parent->getId());
@ -53,8 +53,8 @@ class WikiCategoryTest extends \PHPUnit\Framework\TestCase
*/
public function testAppInputOutput() : void
{
$this->category->setApp(new NullWikiApp(2));
self::assertEquals(2, $this->category->getApp()->getId());
$this->category->app = new NullWikiApp(2);
self::assertEquals(2, $this->category->app->getId());
}
/**

View File

@ -39,7 +39,7 @@ class WikiDocMapperTest extends \PHPUnit\Framework\TestCase
$doc->name = 'Doc Name';
$doc->doc = 'Doc content';
$doc->setStatus(WikiStatus::DRAFT);
$doc->setCategory(new NullWikiCategory(1));
$doc->category = new NullWikiCategory(1);
$doc->setLanguage('en');
$id = WikiDocMapper::create($doc);
@ -51,7 +51,7 @@ class WikiDocMapperTest extends \PHPUnit\Framework\TestCase
self::assertEquals($doc->doc, $docR->doc);
self::assertEquals($doc->getStatus(), $docR->getStatus());
self::assertEquals($doc->getLanguage(), $docR->getLanguage());
self::assertEquals($doc->getCategory()->getId(), $docR->getCategory()->getId());
self::assertEquals($doc->category->getId(), $docR->category->getId());
}
/**
@ -68,7 +68,7 @@ class WikiDocMapperTest extends \PHPUnit\Framework\TestCase
$doc->name = $text->generateText(\mt_rand(1, 3));
$doc->doc = $text->generateText(\mt_rand(100, 500));
$doc->setStatus(WikiStatus::ACTIVE);
$doc->setCategory(new NullWikiCategory(\mt_rand(1, 9)));
$doc->category = new NullWikiCategory(\mt_rand(1, 9));
$doc->setLanguage('en');
$id = WikiDocMapper::create($doc);

View File

@ -42,12 +42,12 @@ class WikiDocTest extends \PHPUnit\Framework\TestCase
public function testDefault() : void
{
self::assertEquals(0, $this->doc->getId());
self::assertEquals(0, $this->doc->getApp()->getId());
self::assertEquals(null, $this->doc->app);
self::assertEquals('', $this->doc->name);
self::assertEquals('', $this->doc->doc);
self::assertEquals('', $this->doc->docRaw);
self::assertEquals(WikiStatus::ACTIVE, $this->doc->getStatus());
self::assertEquals(0, $this->doc->getCategory()->getId());
self::assertEquals(null, $this->doc->category);
self::assertEquals('en', $this->doc->getLanguage());
self::assertEquals([], $this->doc->getTags());
}
@ -59,8 +59,8 @@ class WikiDocTest extends \PHPUnit\Framework\TestCase
*/
public function tesAppInputOutput() : void
{
$this->doc->setApp(new NullWikiApp(2));
self::assertEquals(2, $this->doc->getApp()->getId());
$this->doc->app = new NullWikiApp(2);
self::assertEquals(2, $this->doc->app->getId());
}
/**
@ -114,8 +114,8 @@ class WikiDocTest extends \PHPUnit\Framework\TestCase
*/
public function testCategoryInputOutput() : void
{
$this->doc->setCategory(new NullWikiCategory(3));
self::assertEquals(3, $this->doc->getCategory()->getId());
$this->doc->category = new NullWikiCategory(3);
self::assertEquals(3, $this->doc->category->getId());
}
/**