luyadev/luya-module-cms

View on GitHub
tests/src/frontend/controllers/BlockControllerTest.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace cmstests\src\frontend\controllers;

use cmstests\CmsFrontendTestCase;
use luya\cms\frontend\controllers\BlockController;

class BlockControllerTest extends CmsFrontendTestCase
{
    public function testCallbackMethodNameCreation()
    {
        $ctrl = new BlockController('id', $this->app);

        $this->assertSame('callbackMyAction', $this->invokeMethod($ctrl, 'callbackToMethod', ['my-action']));
        $this->assertSame('callbackMyAction', $this->invokeMethod($ctrl, 'callbackToMethod', ['myAction']));
        $this->assertSame('callbackMyAction', $this->invokeMethod($ctrl, 'callbackToMethod', ['callback-my-action']));
        $this->assertSame('callbackMyAction', $this->invokeMethod($ctrl, 'callbackToMethod', ['callbackMyAction']));
    }
}