1 | <?php |
||
11 | class TraitsTest extends TestCase |
||
12 | { |
||
13 | public function testGetAttributesCallback() |
||
14 | { |
||
15 | $factory = (new LinkFactory($this->app)); |
||
16 | $factory->attributes = $this->app->makeWith(Attributes::class, ['attributes' => [ |
||
17 | 'class' => 'color-red', |
||
18 | ]]); |
||
19 | $link = $factory->build(); |
||
20 | |||
21 | $hasClass = $link->getAttributes(function($attributes) { |
||
22 | $this->assertInstanceOf(Attributes::class, $attributes); |
||
23 | return $attributes->has('class'); |
||
24 | }); |
||
25 | |||
26 | $this->assertTrue($hasClass); |
||
27 | } |
||
28 | } |