. */ declare(strict_types=1); namespace Tests\Feature\Controllers\Admin; use Carbon\Carbon; use FireflyConfig; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Configuration; use FireflyIII\Services\Github\Object\Release; use FireflyIII\Services\Github\Request\UpdateRequest; use Log; use Mockery; use Tests\TestCase; /** * Class UpdateControllerTest * * @SuppressWarnings(PHPMD.TooManyPublicMethods) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class UpdateControllerTest extends TestCase { /** * */ public function setUp() { parent::setUp(); Log::debug(sprintf('Now in %s.', get_class($this))); } /** * @covers \FireflyIII\Http\Controllers\Admin\UpdateController::index * @covers \FireflyIII\Http\Controllers\Admin\UpdateController::__construct */ public function testIndex() { $this->be($this->user()); $config = new Configuration; $config->data = -1; $falseConfig = new Configuration; $falseConfig->data = false; FireflyConfig::shouldReceive('get')->withArgs(['permission_update_check', -1])->once()->andReturn($config); FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig); $response = $this->get(route('admin.update-check')); $response->assertStatus(200); // has bread crumb $response->assertSee('