* * SPDX-License-Identifier: MIT */ namespace Zotlabs\Tests\Unit\Module; use App; use PDOStatement; /** * Tests for the Profiles module */ class ProfilesTest extends TestCase { public function testDisplaysProfileEditFormIfMultiProfilesDisabled(): void { // Set up the channel we'll be making the request for $channel = $this->fixtures['channel'][0]; App::set_channel($channel); // And set up the default profile $this->createDefaultProfile($channel); // Replace calls to 'local_channel' and make sure they return // the id of the current channel. $local_channel_mock = $this->getFunctionMock('Zotlabs\Module', 'local_channel') ->expects($this->any()) ->willReturn($channel['channel_id']); // Replace calls to 'feature_enabled', and make it unconditionally // return true. This is called by the Profiles module to check that // multiple profiles are enabled. $feature_enabled_mock = $this->getFunctionMock('Zotlabs\Module', 'feature_enabled') ->expects($this->any()) ->willReturn(false); // Simulate a GET request to the module $this->get('profiles'); // Check that the rendered page has the expected entry. $this->assertPageContains('