Skip to content

Update ThemesIndexControllerTest.php #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@

namespace Passbolt\AccountSettings\Test\TestCase\Controller\Themes;

use App\Test\Factory\UserFactory;
use App\Test\Lib\AppIntegrationTestCase;
use App\Utility\UuidFactory;
use Cake\ORM\Locator\LocatorAwareTrait;
use Passbolt\AccountSettings\Test\Factory\AccountSettingFactory;

/**
* @uses \Passbolt\AccountSettings\Controller\Themes\ThemesIndexController
Expand All @@ -32,20 +35,19 @@ class ThemesIndexControllerTest extends AppIntegrationTestCase
*/
protected $AccountSettings;

public array $fixtures = [
'plugin.Passbolt/AccountSettings.AccountSettings',
];

public function setUp(): void
{
parent::setUp();
$this->AccountSettings = $this->fetchTable('AccountSettings');
$this->AccountSettings = $this->fetchTable('Passbolt/AccountSettings.AccountSettings');
}

public function testThemesIndexSuccess()
{
$user = UserFactory::make()->user()->persist();
AccountSettingFactory::make()->theme('midgar')->withUser($user)->persist();

// Authenticate as ada and list the themes
$this->logInAsUser();
$this->logInAs($user);
$this->get('/account/settings/themes.json?api-version=v2');
$this->assertResponseOk();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add an assertion here, ensuring that the theme midgar is well returned in the response.

}
Expand Down