From 8154e7cf59ae049c0c67dc610f3e5da2dd3ddc2f Mon Sep 17 00:00:00 2001 From: Rias Date: Fri, 21 Feb 2020 16:04:04 +0100 Subject: [PATCH] Split editor into package --- Commands/DeleteOldUploadsCommandTest.php | 66 ------------------------ 1 file changed, 66 deletions(-) delete mode 100644 Commands/DeleteOldUploadsCommandTest.php diff --git a/Commands/DeleteOldUploadsCommandTest.php b/Commands/DeleteOldUploadsCommandTest.php deleted file mode 100644 index 48b8788..0000000 --- a/Commands/DeleteOldUploadsCommandTest.php +++ /dev/null @@ -1,66 +0,0 @@ -campaign = factory(Campaign::class)->create(); - $this->template = factory(Template::class)->create(); - } - - /** @test */ - public function it_will_delete_all_uploads_that_have_no_campaign_or_template() - { - $upload = factory(Upload::class)->create(); - - $upload->templates()->attach($this->template); - - $this->assertEquals(1, Upload::count()); - $this->artisan(DeleteOldUploadsCommand::class)->assertExitCode(0); - $this->assertEquals(1, Upload::count()); - - $upload->templates()->detach($this->template); - - $this->assertEquals(1, Upload::count()); - $this->artisan(DeleteOldUploadsCommand::class)->assertExitCode(0); - $this->assertEquals(0, Upload::count()); - } - - /** @test * */ - public function it_will_not_delete_if_it_is_attached_to_either_templates_or_campaigns() - { - $upload = factory(Upload::class)->create(); - - $upload->templates()->attach($this->template); - $upload->campaigns()->attach($this->campaign); - - $this->assertEquals(1, Upload::count()); - $this->artisan(DeleteOldUploadsCommand::class)->assertExitCode(0); - $this->assertEquals(1, Upload::count()); - - $upload->templates()->detach($this->template); - - $this->assertEquals(1, Upload::count()); - $this->artisan(DeleteOldUploadsCommand::class)->assertExitCode(0); - $this->assertEquals(1, Upload::count()); - - $upload->campaigns()->detach($this->campaign); - - $this->assertEquals(1, Upload::count()); - $this->artisan(DeleteOldUploadsCommand::class)->assertExitCode(0); - $this->assertEquals(0, Upload::count()); - } -}