|
2 | 2 |
|
3 | 3 | namespace Swis\JsonApi\Client\Tests\Concerns;
|
4 | 4 |
|
| 5 | +use Illuminate\Support\Str; |
5 | 6 | use PHPUnit\Framework\TestCase;
|
6 | 7 | use Swis\JsonApi\Client\Collection;
|
7 | 8 | use Swis\JsonApi\Client\Concerns\HasRelations;
|
@@ -211,7 +212,7 @@ public function itCanDefineAHasOneRelationWithTheCallingMethodAsFallbackName()
|
211 | 212 | $relation = $mock->hasOne(MasterItem::class);
|
212 | 213 |
|
213 | 214 | $this->assertInstanceOf(HasOneRelation::class, $relation);
|
214 |
| - $this->assertSame($relation, $mock->getRelation(__FUNCTION__)); |
| 215 | + $this->assertSame($relation, $mock->getRelation(Str::snake(__FUNCTION__))); |
215 | 216 | }
|
216 | 217 |
|
217 | 218 | /**
|
@@ -239,7 +240,7 @@ public function itCanDefineAHasManyRelationWithTheCallingMethodAsFallbackName()
|
239 | 240 | $relation = $mock->hasMany(MasterItem::class);
|
240 | 241 |
|
241 | 242 | $this->assertInstanceOf(HasManyRelation::class, $relation);
|
242 |
| - $this->assertSame($relation, $mock->getRelation(__FUNCTION__)); |
| 243 | + $this->assertSame($relation, $mock->getRelation(Str::snake(__FUNCTION__))); |
243 | 244 | }
|
244 | 245 |
|
245 | 246 | /**
|
@@ -267,7 +268,7 @@ public function itCanDefineAMorphToRelationWithTheCallingMethodAsFallbackName()
|
267 | 268 | $relation = $mock->morphTo();
|
268 | 269 |
|
269 | 270 | $this->assertInstanceOf(MorphToRelation::class, $relation);
|
270 |
| - $this->assertSame($relation, $mock->getRelation(__FUNCTION__)); |
| 271 | + $this->assertSame($relation, $mock->getRelation(Str::snake(__FUNCTION__))); |
271 | 272 | }
|
272 | 273 |
|
273 | 274 | /**
|
@@ -295,6 +296,6 @@ public function itCanDefineAMorphToManyRelationWithTheCallingMethodAsFallbackNam
|
295 | 296 | $relation = $mock->morphToMany();
|
296 | 297 |
|
297 | 298 | $this->assertInstanceOf(MorphToManyRelation::class, $relation);
|
298 |
| - $this->assertSame($relation, $mock->getRelation(__FUNCTION__)); |
| 299 | + $this->assertSame($relation, $mock->getRelation(Str::snake(__FUNCTION__))); |
299 | 300 | }
|
300 | 301 | }
|
0 commit comments