diff options
| author | Rasmus Fuhse <fuhse@data-quest.de> | 2024-01-17 16:46:09 +0000 |
|---|---|---|
| committer | Rasmus Fuhse <fuhse@data-quest.de> | 2024-01-17 16:46:09 +0000 |
| commit | ce27c274bd49733630a69b4467b72d3519f9974c (patch) | |
| tree | e634260969a1cb3ea06f0bc87209292a385350f0 /tests/jsonapi/WikiCreateTest.php | |
| parent | 6722029b73e7383856fd0777ca58863c7d0faab4 (diff) | |
Resolve "Wiki modernisieren"
Closes #3215
Merge request studip/studip!2180
Diffstat (limited to 'tests/jsonapi/WikiCreateTest.php')
| -rw-r--r-- | tests/jsonapi/WikiCreateTest.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/jsonapi/WikiCreateTest.php b/tests/jsonapi/WikiCreateTest.php index 114d450..842db1f 100644 --- a/tests/jsonapi/WikiCreateTest.php +++ b/tests/jsonapi/WikiCreateTest.php @@ -12,6 +12,7 @@ class WikiCreateTest extends \Codeception\Test\Unit protected function _before() { \DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh); + \WikiPage::deleteBySQL('1'); } protected function _after() @@ -24,22 +25,22 @@ class WikiCreateTest extends \Codeception\Test\Unit $credentials = $this->tester->getCredentialsForTestAutor(); $rangeId = 'a07535cf2f8a72df33c12ddfa4b53dde'; - $keyword = 'IphiklosIphitos'; + $name = 'IphiklosIphitos'; $content = 'This is just fake wiki.'; $json = [ 'data' => [ 'type' => 'wiki', - 'attributes' => compact('keyword', 'content'), + 'attributes' => compact('name', 'content'), ], ]; - $this->tester->assertCount(0, \WikiPage::findLatestPages($rangeId)); + $this->tester->assertCount(0, \WikiPage::findBySQL('`range_id` = ?', [$rangeId])); $response = $this->createWikiPage($credentials, $rangeId, $json); $this->tester->assertSame(201, $response->getStatusCode()); - $this->tester->assertCount(1, \WikiPage::findLatestPages($rangeId)); + $this->tester->assertCount(1, \WikiPage::findBySQL('`range_id` = ?', [$rangeId])); $page = $response->document()->primaryResource(); |
