. */ declare(strict_types=1); namespace Tests\Feature\Controllers\Admin; use FireflyConfig; use FireflyIII\Models\Configuration; use Log; use Tests\TestCase; /** * Class ConfigurationControllerTest * * @SuppressWarnings(PHPMD.TooManyPublicMethods) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class ConfigurationControllerTest extends TestCase { /** * */ public function setUp() { parent::setUp(); Log::debug(sprintf('Now in %s.', get_class($this))); } /** * @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::index * @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::__construct */ public function testIndex() { $this->be($this->user()); $falseConfig = new Configuration; $falseConfig->data = false; $trueConfig = new Configuration; $trueConfig->data = true; FireflyConfig::shouldReceive('get')->withArgs(['single_user_mode', true])->once()->andReturn($trueConfig); FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->times(2)->andReturn($falseConfig); $response = $this->get(route('admin.configuration.index')); $response->assertStatus(200); // has bread crumb $response->assertSee('