Skip to content

Commit c53bf64

Browse files
authored
Apply suggestions from code review
1 parent 050e83e commit c53bf64

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

tests/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testCallCommand()
5050
Carbon::setTestNow('2016-10-20 11:05:00');
5151

5252
$this->mockGenerator();
53-
$this->mockGettingModelInstance(new Post);
53+
$this->mockGettingModelInstance(new Post());
5454
$this->mockDBTransactionStartRollback(2);
5555

5656
$this

tests/NovaResourceGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testSuccessWithoutCommandLineFields()
115115
{
116116
$this->mockNovaServiceProviderExists();
117117

118-
$this->mockGettingModelInstance(new Post);
118+
$this->mockGettingModelInstance(new Post());
119119

120120
app(NovaResourceGenerator::class)
121121
->setModel('Post')

tests/Support/GeneratorMockTrait.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function mockDBTransactionStartRollback(int $count = 1): void
6464
public function mockGettingModelInstance(object $model): void
6565
{
6666
$laravelConnectionMock = Mockery::mock(LaravelConnection::class);
67-
$laravelConnectionMock
6867
->shouldReceive('getConfig')
6968
->andReturn([
7069
'database' => 'my_db',
@@ -79,12 +78,11 @@ public function mockGettingModelInstance(object $model): void
7978
->andReturn($laravelConnectionMock);
8079

8180
$schemaManagerMock = Mockery::mock(AbstractSchemaManager::class);
82-
$schemaManagerMock
8381
->shouldReceive('listTableColumns')
8482
->andReturn([
85-
new Column('id', new IntegerType),
86-
new Column('title', new StringType),
87-
new Column('created_at', new DateTimeType),
83+
new Column('id', new IntegerType()),
84+
new Column('title', new StringType()),
85+
new Column('created_at', new DateTimeType()),
8886
]);
8987

9088
$connectionMock = Mockery::mock(Connection::class)->makePartial();
@@ -93,7 +91,6 @@ public function mockGettingModelInstance(object $model): void
9391
->andReturn($schemaManagerMock);
9492

9593
$driverManagerMock = Mockery::mock('alias:' . DriverManager::class);
96-
$driverManagerMock
9794
->shouldReceive('getConnection')
9895
->with([
9996
'dbname' => 'my_db',

0 commit comments

Comments
 (0)