Move some tests into their own subfodlers

This commit is contained in:
Jonny Barnes 2017-12-18 17:53:22 +00:00
parent 0dd6adfa0e
commit e1aa814d8c
18 changed files with 29 additions and 31 deletions

View file

@ -1,9 +1,8 @@
<?php <?php
namespace Tests\Feature; namespace Tests\Feature\Admin;
use Tests\TestCase; use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class AdminHomeControllerTest extends TestCase class AdminHomeControllerTest extends TestCase
{ {

View file

@ -1,9 +1,8 @@
<?php <?php
namespace Tests\Feature; namespace Tests\Feature\Admin;
use Tests\TestCase; use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class AdminTest extends TestCase class AdminTest extends TestCase
{ {

View file

@ -1,12 +1,12 @@
<?php <?php
namespace Tests\Feature; namespace Tests\Feature\Admin;
use Tests\TestCase; use Tests\TestCase;
use Illuminate\Http\UploadedFile; use Illuminate\Http\UploadedFile;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
class ArticlesAdminTest extends TestCase class ArticlesTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;

View file

@ -1,11 +1,11 @@
<?php <?php
namespace Tests\Feature; namespace Tests\Feature\Admin;
use Tests\TestCase; use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
class ClientsAdminTest extends TestCase class ClientsTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature; namespace Tests\Feature\Admin;
use App\Contact; use App\Contact;
use Tests\TestCase; use Tests\TestCase;
@ -11,7 +11,7 @@ use Illuminate\Http\UploadedFile;
use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\Handler\MockHandler;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
class ContactsAdminTest extends TestCase class ContactsTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;
@ -83,7 +83,7 @@ class ContactsAdminTest extends TestCase
public function test_edit_contact_with_uploaded_avatar() public function test_edit_contact_with_uploaded_avatar()
{ {
copy(__DIR__ . '/../aaron.png', sys_get_temp_dir() . '/tantek.png'); copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png');
$path = sys_get_temp_dir() . '/tantek.png'; $path = sys_get_temp_dir() . '/tantek.png';
$file = new UploadedFile($path, 'tantek.png', 'image/png', filesize($path), null, true); $file = new UploadedFile($path, 'tantek.png', 'image/png', filesize($path), null, true);
$this->withSession([ $this->withSession([
@ -97,7 +97,7 @@ class ContactsAdminTest extends TestCase
'avatar' => $file, 'avatar' => $file,
]); ]);
$this->assertFileEquals( $this->assertFileEquals(
__DIR__ . '/../aaron.png', __DIR__ . '/../../aaron.png',
public_path() . '/assets/profile-images/tantek.com/image' public_path() . '/assets/profile-images/tantek.com/image'
); );
} }
@ -121,7 +121,7 @@ class ContactsAdminTest extends TestCase
<img class="u-photo" src="http://tantek.com/tantek.png"> <img class="u-photo" src="http://tantek.com/tantek.png">
</div> </div>
HTML; HTML;
$file = fopen(__DIR__ . '/../aaron.png', 'r'); $file = fopen(__DIR__ . '/../../aaron.png', 'r');
$mock = new MockHandler([ $mock = new MockHandler([
new Response(200, ['Content-Type' => 'text/html'], $html), new Response(200, ['Content-Type' => 'text/html'], $html),
new Response(200, ['Content-Type' => 'iamge/png'], $file), new Response(200, ['Content-Type' => 'iamge/png'], $file),
@ -135,7 +135,7 @@ HTML;
])->get('/admin/contacts/1/getavatar'); ])->get('/admin/contacts/1/getavatar');
$this->assertFileEquals( $this->assertFileEquals(
__DIR__ . '/../aaron.png', __DIR__ . '/../../aaron.png',
public_path() . '/assets/profile-images/tantek.com/image' public_path() . '/assets/profile-images/tantek.com/image'
); );
} }

View file

@ -1,13 +1,13 @@
<?php <?php
namespace Tests\Feature; namespace Tests\Feature\Admin;
use Tests\TestCase; use Tests\TestCase;
use App\Jobs\SendWebMentions; use App\Jobs\SendWebMentions;
use Illuminate\Support\Facades\Queue; use Illuminate\Support\Facades\Queue;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
class NotesAdminTest extends TestCase class NotesTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;

View file

@ -1,11 +1,11 @@
<?php <?php
namespace Tests\Feature; namespace Tests\Feature\Admin;
use Tests\TestCase; use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
class PlacesAdminTest extends TestCase class PlacesTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use Tests\TestCase; use Tests\TestCase;
use App\Jobs\AddClientToDatabase; use App\Jobs\AddClientToDatabase;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use Tests\TestCase; use Tests\TestCase;
use GuzzleHttp\Client; use GuzzleHttp\Client;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use App\Bookmark; use App\Bookmark;
use Tests\TestCase; use Tests\TestCase;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use Storage; use Storage;
use Tests\TestCase; use Tests\TestCase;
@ -24,7 +24,7 @@ class ProcessMediaJobTest extends TestCase
{ {
Storage::fake('s3'); Storage::fake('s3');
$manager = app()->make(ImageManager::class); $manager = app()->make(ImageManager::class);
Storage::disk('local')->put('aaron.png', file_get_contents(__DIR__.'/../aaron.png')); Storage::disk('local')->put('aaron.png', file_get_contents(__DIR__.'/../../aaron.png'));
$job = new ProcessMedia('aaron.png'); $job = new ProcessMedia('aaron.png');
$job->handle($manager); $job->handle($manager);
@ -34,7 +34,7 @@ class ProcessMediaJobTest extends TestCase
public function test_large_images_have_smaller_files_created() public function test_large_images_have_smaller_files_created()
{ {
$manager = app()->make(ImageManager::class); $manager = app()->make(ImageManager::class);
Storage::disk('local')->put('test-image.jpg', file_get_contents(__DIR__.'/../test-image.jpg')); Storage::disk('local')->put('test-image.jpg', file_get_contents(__DIR__.'/../../test-image.jpg'));
Storage::fake('s3'); Storage::fake('s3');
$job = new ProcessMedia('test-image.jpg'); $job = new ProcessMedia('test-image.jpg');
$job->handle($manager); $job->handle($manager);

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use App\Note; use App\Note;
use Tests\TestCase; use Tests\TestCase;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use Tests\TestCase; use Tests\TestCase;
use GuzzleHttp\Client; use GuzzleHttp\Client;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use App\Note; use App\Note;
use Tests\TestCase; use Tests\TestCase;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use App\Bookmark; use App\Bookmark;
use Tests\TestCase; use Tests\TestCase;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use App\Bookmark; use App\Bookmark;
use Tests\TestCase; use Tests\TestCase;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use App\Note; use App\Note;
use Tests\TestCase; use Tests\TestCase;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Unit; namespace Tests\Unit\Jobs;
use App\Note; use App\Note;
use Tests\TestCase; use Tests\TestCase;