Skip to content

Commit 528e422

Browse files
committed
Fix tests with namespacing
1 parent e9efdc4 commit 528e422

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

tests/Fixtures/ModelAttribute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Tests\Fixtures;
44

5+
use Attribute;
6+
57
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION)]
68
class ModelAttribute
79
{

tests/ReflectionClosurePhp81Test.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use Some\ClassName as ClassAlias;
55
use Tests\Fixtures\Model;
66
use Tests\Fixtures\RegularClass;
7+
use Tests\SerializerPhp81Controller;
8+
79
use function Tests\Fixtures\{makeModel};
810

911
enum GlobalEnum {
@@ -623,7 +625,7 @@ function () {
623625

624626
$e = <<<EOF
625627
#[Tests\Fixtures\ModelAttribute()]
626-
#[MyAttribute('My " \' Argument 1', 'Tests\Fixtures\Model')]
628+
#[Tests\MyAttribute('My " \' Argument 1', 'Tests\Fixtures\Model')]
627629
function ()
628630
{
629631
return \$this->privateGetter();

tests/SerializerPhp81Test.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<?php
22

3+
namespace Tests;
4+
5+
use Attribute;
6+
use Error;
37
use Illuminate\Support\Carbon;
8+
use PropertyPromotion;
9+
use ReflectionFunction;
10+
use RuntimeException;
411
use Tests\Fixtures\Model;
512
use Tests\Fixtures\ModelAttribute;
613
use Tests\Fixtures\RegularClass;
@@ -164,7 +171,7 @@ enum SerializerScopedBackedEnum: string {
164171

165172
expect($f)->toThrow(function (Error $e) {
166173
expect($e->getMessage())->toBe(
167-
'Cannot modify readonly property SerializerPhp81Controller::$service',
174+
'Cannot modify readonly property Tests\SerializerPhp81Controller::$service',
168175
);
169176
});
170177
})->with('serializers');
@@ -552,6 +559,9 @@ enum SerializerScopedBackedEnum: string {
552559
'model' => Model::class,
553560
]);
554561

562+
var_dump($attribute->value);
563+
var_dump($attribute->value->newInstance()->string);
564+
555565
expect($attribute->value->newInstance())
556566
->string->toBe('My " \' Argument 1')
557567
->model->toBe(Model::class);

0 commit comments

Comments
 (0)