Skip to content

Commit aea2e00

Browse files
committed
ITT: Trait asserts tests added.
1 parent 1978f52 commit aea2e00

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/Asserts/TraitAssertsTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
use Illuminate\Notifications\Notifiable;
4+
use Illuminated\Testing\Asserts\TraitAsserts;
5+
6+
class TraitAssertsTest extends TestCase
7+
{
8+
use TraitAsserts;
9+
10+
/** @test */
11+
public function it_has_trait_used_assertion()
12+
{
13+
$this->assertTraitUsed(Post::class, Notifiable::class);
14+
}
15+
16+
/** @test */
17+
public function it_has_trait_not_used_assertion()
18+
{
19+
$this->assertTraitNotUsed(Post::class, 'Acme\Trait\Fake');
20+
}
21+
}

tests/fixture/app/Post.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22

33
use Illuminate\Database\Eloquent\Model;
4+
use Illuminate\Notifications\Notifiable;
45

56
class Post extends Model
67
{
8+
use Notifiable;
9+
710
protected $fillable = ['title'];
811
}

0 commit comments

Comments
 (0)