Skip to content
Snippets Groups Projects
Commit ce27c274 authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

Resolve "Wiki modernisieren"

Closes #3215

Merge request studip/studip!2180
parent 6722029b
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<span class="asterisk" title="<?= _('Dies ist ein Pflichtfeld') ?>" aria-hidden="true">*</span> <span class="asterisk" title="<?= _('Dies ist ein Pflichtfeld') ?>" aria-hidden="true">*</span>
<? endif ?> <? endif ?>
</label> </label>
<select class="select2" v-model="<?= htmlReady($this->name) ?>" <?= ($this->required ? 'required aria-required="true"' : '') ?> id="<?= $id ?>" <?= $attributes ?>> <select class="select2" v-model="<?= htmlReady($this->name) ?>" name="<?= htmlReady($this->name) ?>" <?= ($this->required ? 'required aria-required="true"' : '') ?> id="<?= $id ?>" <?= $attributes ?>>
<? foreach ($options as $key => $option) : ?> <? foreach ($options as $key => $option) : ?>
<option value="<?= htmlReady($key) ?>"<?= ($key == $value ? " selected" : "") ?>> <option value="<?= htmlReady($key) ?>"<?= ($key == $value ? " selected" : "") ?>>
<?= htmlReady($option) ?> <?= htmlReady($option) ?>
......
This diff is collapsed.
...@@ -12,6 +12,7 @@ class WikiCreateTest extends \Codeception\Test\Unit ...@@ -12,6 +12,7 @@ class WikiCreateTest extends \Codeception\Test\Unit
protected function _before() protected function _before()
{ {
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh); \DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
\WikiPage::deleteBySQL('1');
} }
protected function _after() protected function _after()
...@@ -24,22 +25,22 @@ class WikiCreateTest extends \Codeception\Test\Unit ...@@ -24,22 +25,22 @@ class WikiCreateTest extends \Codeception\Test\Unit
$credentials = $this->tester->getCredentialsForTestAutor(); $credentials = $this->tester->getCredentialsForTestAutor();
$rangeId = 'a07535cf2f8a72df33c12ddfa4b53dde'; $rangeId = 'a07535cf2f8a72df33c12ddfa4b53dde';
$keyword = 'IphiklosIphitos'; $name = 'IphiklosIphitos';
$content = 'This is just fake wiki.'; $content = 'This is just fake wiki.';
$json = [ $json = [
'data' => [ 'data' => [
'type' => 'wiki', '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); $response = $this->createWikiPage($credentials, $rangeId, $json);
$this->tester->assertSame(201, $response->getStatusCode()); $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(); $page = $response->document()->primaryResource();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment