Skip to content

Commit c0e714b

Browse files
committed
refactor: code
refs: #49
1 parent b9d4aa3 commit c0e714b

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

tests/RepositoryGeneratorTest.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace RonasIT\Support\Tests;
44

5-
use Illuminate\Support\Facades\Event;
65
use RonasIT\Support\Events\SuccessCreateMessage;
76
use RonasIT\Support\Events\WarningEvent;
87
use RonasIT\Support\Exceptions\ClassNotExistsException;
@@ -13,16 +12,11 @@ class RepositoryGeneratorTest extends TestCase
1312
{
1413
use RepositoryMockTrait;
1514

16-
public function setUp(): void
15+
public function testModelNotExist()
1716
{
18-
parent::setUp();
19-
20-
Event::fake();
21-
}
22-
23-
public function testModelDoesntExists()
24-
{
25-
$this->mockGeneratorForMissingModel();
17+
$this->mockClass(RepositoryGenerator::class, [
18+
$this->classExistsMethodCall(['models', 'Post'], false),
19+
]);
2620

2721
$this->assertExceptionThrew(
2822
className: ClassNotExistsException::class,

tests/Support/Repository/RepositoryMockTrait.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,13 @@
33
namespace RonasIT\Support\Tests\Support\Repository;
44

55
use org\bovigo\vfs\vfsStream;
6-
use RonasIT\Support\Generators\RepositoryGenerator;
76
use RonasIT\Support\Tests\Support\GeneratorMockTrait;
87
use RonasIT\Support\Traits\MockTrait;
98

109
trait RepositoryMockTrait
1110
{
1211
use GeneratorMockTrait, MockTrait;
1312

14-
public function mockGeneratorForMissingModel(): void
15-
{
16-
$this->mockClass(RepositoryGenerator::class, [
17-
$this->classExistsMethodCall(['models', 'Post'], false),
18-
]);
19-
}
20-
2113
public function mockFilesystem(): void
2214
{
2315
$structure = [

0 commit comments

Comments
 (0)