mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-01-11 17:18:42 +00:00
fix tests
This commit is contained in:
parent
a1120f8bde
commit
cdd04e94ed
|
|
@ -234,7 +234,10 @@ final class ApiController extends Controller
|
|||
public function apiEditorUpdate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
|
||||
{
|
||||
/** @var \Modules\Editor\Models\EditorDoc $old */
|
||||
$old = EditorDocMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$old = EditorDocMapper::get()
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->execute();
|
||||
|
||||
$new = $this->updateEditorFromRequest($request, clone $old);
|
||||
$this->updateModel($request->header->account, $old, $new, EditorDocMapper::class, 'doc', $request->getOrigin());
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ echo $this->data['nav']->render(); ?>
|
|||
</div>
|
||||
<?php if ($editable) : ?>
|
||||
<div class="portlet-foot">
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build('{/base}/editor/edit?id=' . $doc->id); ?>"><?= $this->getHtml('Edit', '0', '0'); ?></a>
|
||||
<a id="iEditorEdit" tabindex="0" class="button" href="<?= UriFactory::build('{/base}/editor/edit?id=' . $doc->id); ?>"><?= $this->getHtml('Edit', '0', '0'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -209,6 +209,8 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
$this->module->apiEditorUpdate($request, $response);
|
||||
|
||||
var_dump(EditorDocMapper::get()->where('id', 1)->execute());
|
||||
|
||||
self::assertEquals('Changed Title', $response->getDataArray('')['response']->title);
|
||||
self::assertEquals('Changed Title', EditorDocMapper::get()->where('id', 1)->execute()->title);
|
||||
self::assertEquals(1, $response->getDataArray('')['response']->id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user