Skip to content

Commit 73609df

Browse files
Merge pull request #12 from ARCANEDEV/patch-1
Updating the package
2 parents 3a5f22a + 59e6b1e commit 73609df

File tree

6 files changed

+58
-57
lines changed

6 files changed

+58
-57
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-2017 | ARCANEDEV <arcanedev.maroc@gmail.com> - Laravel Notes
3+
Copyright (c) 2016-2018 | ARCANEDEV <arcanedev.maroc@gmail.com> - Laravel Notes
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"license": "MIT",
1616
"require": {
1717
"php": ">=7.0",
18-
"arcanedev/support": "~4.2"
18+
"arcanedev/support": "~4.2.0"
1919
},
2020
"require-dev": {
2121
"orchestra/testbench": "~3.5.0",

phpunit.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<directory suffix=".php">./src/</directory>
2222
</whitelist>
2323
</filter>
24+
<php>
25+
<env name="DB_CONNECTION" value="testing"/>
26+
</php>
2427
<logging>
2528
<log type="coverage-clover" target="build/logs/clover.xml"/>
2629
<log type="coverage-text" target="build/logs/coverage.txt"/>

tests/LaravelNotesServiceProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ public function it_can_be_instantiated()
5353
];
5454

5555
foreach ($expectations as $expected) {
56-
$this->assertInstanceOf($expected, $this->provider);
56+
static::assertInstanceOf($expected, $this->provider);
5757
}
5858
}
5959

6060
/** @test */
6161
public function it_can_provides()
6262
{
63-
$this->assertSame([], $this->provider->provides());
63+
static::assertSame([], $this->provider->provides());
6464
}
6565
}

tests/Models/NoteTest.php

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ public function it_can_create_a_note()
2424
/** @var Post $post */
2525
$post = $this->factory->create(Post::class);
2626

27-
$this->assertNull($post->note);
27+
static::assertNull($post->note);
2828

2929
$note = $post->createNote($content = 'Hello world #1');
3030

31-
$this->assertInstanceOf(Note::class, $post->note);
31+
static::assertInstanceOf(Note::class, $post->note);
3232

33-
$this->assertSame($note->id, $post->note->id);
34-
$this->assertSame($content, $post->note->content);
35-
$this->assertSame($note->content, $post->note->content);
33+
static::assertSame($note->id, $post->note->id);
34+
static::assertSame($content, $post->note->content);
35+
static::assertSame($note->content, $post->note->content);
3636

37-
$this->assertNull($post->note->author);
37+
static::assertNull($post->note->author);
3838
}
3939

4040
/** @test */
@@ -43,25 +43,25 @@ public function it_should_create_single_note_for_has_one_note_trait()
4343
/** @var Post $post */
4444
$post = $this->factory->create(Post::class);
4545

46-
$this->assertNull($post->note);
46+
static::assertNull($post->note);
4747

4848
$note = $post->createNote($content = 'Hello world #1');
4949

50-
$this->assertInstanceOf(Note::class, $post->note);
50+
static::assertInstanceOf(Note::class, $post->note);
5151

52-
$this->assertSame($note->id, $post->note->id);
53-
$this->assertSame($content, $note->content);
54-
$this->assertSame($note->content, $post->note->content);
52+
static::assertSame($note->id, $post->note->id);
53+
static::assertSame($content, $note->content);
54+
static::assertSame($note->content, $post->note->content);
5555

5656
$note = $post->createNote($content = 'Hello world #2');
5757

58-
$this->assertInstanceOf(Note::class, $post->note);
58+
static::assertInstanceOf(Note::class, $post->note);
5959

60-
$this->assertSame($note->id, $post->note->id);
61-
$this->assertSame($content, $note->content);
62-
$this->assertSame($note->content, $post->note->content);
60+
static::assertSame($note->id, $post->note->id);
61+
static::assertSame($content, $note->content);
62+
static::assertSame($note->content, $post->note->content);
6363

64-
$this->assertCount(1, Note::all());
64+
static::assertCount(1, Note::all());
6565
}
6666

6767
/** @test */
@@ -76,14 +76,14 @@ public function it_can_create_with_author()
7676

7777
$note = $post->createNote($content = 'Hello world #1', $user);
7878

79-
$this->assertSame($content, $note->content);
80-
$this->assertSame($content, $post->note->content);
79+
static::assertSame($content, $note->content);
80+
static::assertSame($content, $post->note->content);
8181

82-
$this->assertInstanceOf(User::class, $note->author);
83-
$this->assertInstanceOf(User::class, $post->note->author);
82+
static::assertInstanceOf(User::class, $note->author);
83+
static::assertInstanceOf(User::class, $post->note->author);
8484

85-
$this->assertEquals($user->id, $note->author->id);
86-
$this->assertEquals($user->id, $post->note->author->id);
85+
static::assertEquals($user->id, $note->author->id);
86+
static::assertEquals($user->id, $post->note->author->id);
8787
}
8888

8989
/** @test */
@@ -92,25 +92,25 @@ public function it_can_update_note()
9292
/** @var Post $post */
9393
$post = $this->factory->create(Post::class);
9494

95-
$this->assertNull($post->note);
95+
static::assertNull($post->note);
9696

9797
$note = $post->createNote($content = 'Hello world #1');
9898

99-
$this->assertInstanceOf(Note::class, $post->note);
99+
static::assertInstanceOf(Note::class, $post->note);
100100

101-
$this->assertSame($note->id, $post->note->id);
102-
$this->assertSame($content, $note->content);
103-
$this->assertSame($note->content, $post->note->content);
101+
static::assertSame($note->id, $post->note->id);
102+
static::assertSame($content, $note->content);
103+
static::assertSame($note->content, $post->note->content);
104104

105105
$post->updateNote($content = 'Hello world #2');
106106

107-
$this->assertInstanceOf(Note::class, $post->note);
107+
static::assertInstanceOf(Note::class, $post->note);
108108

109-
$this->assertSame($note->id, $post->note->id);
110-
$this->assertSame($content, $post->note->content);
111-
$this->assertNotSame($note->content, $post->note->content);
109+
static::assertSame($note->id, $post->note->id);
110+
static::assertSame($content, $post->note->content);
111+
static::assertNotSame($note->content, $post->note->content);
112112

113-
$this->assertCount(1, Note::all());
113+
static::assertCount(1, Note::all());
114114
}
115115

116116
/** @test */
@@ -119,13 +119,13 @@ public function it_can_reverse_relation()
119119
/** @var Post $post */
120120
$post = $this->factory->create(Post::class);
121121

122-
$this->assertNull($post->note);
122+
static::assertNull($post->note);
123123

124124
$note = $post->createNote($content = 'Hello world #1');
125125

126-
$this->assertSame($post->id, $note->noteable->id);
127-
$this->assertSame($post->title, $note->noteable->title);
128-
$this->assertSame($post->content, $note->noteable->content);
126+
static::assertSame($post->id, $note->noteable->id);
127+
static::assertSame($post->title, $note->noteable->title);
128+
static::assertSame($post->content, $note->noteable->content);
129129
}
130130

131131
/* -----------------------------------------------------------------
@@ -139,12 +139,12 @@ public function it_can_add_note()
139139
/** @var User $user */
140140
$user = $this->factory->create(User::class);
141141

142-
$this->assertCount(0, $user->notes);
142+
static::assertCount(0, $user->notes);
143143

144144
$note = $user->createNote($content = 'Hello world #1');
145145

146-
$this->assertCount(1, $user->notes);
147-
$this->assertNull($note->author);
146+
static::assertCount(1, $user->notes);
147+
static::assertNull($note->author);
148148
}
149149

150150
/** @test */
@@ -153,12 +153,12 @@ public function it_can_add_note_without_get_current_author_id_method()
153153
/** @var \Arcanedev\LaravelNotes\Tests\Stubs\Models\UserWithAuthorId $user */
154154
$user = $this->factory->create(UserWithAuthorId::class);
155155

156-
$this->assertCount(0, $user->notes);
156+
static::assertCount(0, $user->notes);
157157

158158
$note = $user->createNote($content = 'Hello world #1');
159159

160-
$this->assertCount(1, $user->notes);
161-
$this->assertSame($user->id, $note->author->id);
160+
static::assertCount(1, $user->notes);
161+
static::assertSame($user->id, $note->author->id);
162162
}
163163

164164
/** @test */
@@ -170,7 +170,7 @@ public function it_can_find_note_by_its_id()
170170
$created = $user->createNote($content = 'Hello world #1');
171171
$note = $user->findNote($created->id);
172172

173-
$this->assertSame($note->id, $created->id);
173+
static::assertSame($note->id, $created->id);
174174
}
175175

176176
/** @test */
@@ -179,14 +179,14 @@ public function it_can_retrieve_authored_notes()
179179
/** @var \Arcanedev\LaravelNotes\Tests\Stubs\Models\User $user */
180180
$user = $this->factory->create(User::class);
181181

182-
$this->assertCount(0, $user->notes);
183-
$this->assertCount(0, $user->authoredNotes);
182+
static::assertCount(0, $user->notes);
183+
static::assertCount(0, $user->authoredNotes);
184184

185185
$user->createNote('Hello World #1', $user);
186186
$user->createNote('Hello World #2', $user);
187187

188-
$this->assertCount(2, $user->notes);
189-
$this->assertCount(2, $user->authoredNotes()->get());
188+
static::assertCount(2, $user->notes);
189+
static::assertCount(2, $user->authoredNotes()->get());
190190
}
191191

192192
/** @test */
@@ -202,10 +202,10 @@ public function it_must_retrieve_authored_notes_foreach_owner()
202202
$userOne->createNote('Hello World #1');
203203
$userOne->createNote('Hello World #2', $userTwo);
204204

205-
$this->assertCount(2, $userOne->notes);
206-
$this->assertCount(1, $userOne->authoredNotes);
205+
static::assertCount(2, $userOne->notes);
206+
static::assertCount(1, $userOne->authoredNotes);
207207

208-
$this->assertCount(0, $userTwo->notes);
209-
$this->assertCount(1, $userTwo->authoredNotes);
208+
static::assertCount(0, $userTwo->notes);
209+
static::assertCount(1, $userTwo->authoredNotes);
210210
}
211211
}

tests/TestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,9 @@ protected function getPackageAliases($app)
6969
protected function getEnvironmentSetUp($app)
7070
{
7171
// Laravel App Configs
72-
$app['config']->set('database.default', 'testing');
7372
$app['config']->set('auth.model', Stubs\Models\User::class);
7473

7574
// Laravel Messenger Configs
76-
$app['config']->set('notes.database.connection', 'testing');
7775
$app['config']->set('notes.authors.model', Stubs\Models\User::class);
7876
}
7977

0 commit comments

Comments
 (0)