/** * @test */ function it_updates_the_active_state_of_a_record() { $this->repository->maintenance(); $modelId = $this->repository->findBy(self::UNIQUE_FIELD, '1337')->id; $this->assertNotEmpty($modelId, "Test Model not found"); // set to inactive $this->repository->activateRecord($modelId, false); $this->assertFalse($this->repository->findBy(self::UNIQUE_FIELD, '1337')->active, "Model deactivation didn't persist"); // set to active again $this->repository->activateRecord($modelId); $this->assertTrue($this->repository->findBy(self::UNIQUE_FIELD, '1337')->active, "Model re-activation didn't persist"); }