Skip to content

Commit 607e835

Browse files
fix autoloading StringableObjectStub when running vendor/bin/phpunit ./tests/Support/SupportStringableTest.php directly (#58030)
1 parent a90ce53 commit 607e835

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Illuminate\Tests\Support\Fixtures;
4+
5+
class StringableObjectStub
6+
{
7+
private $value;
8+
9+
public function __construct($value)
10+
{
11+
$this->value = $value;
12+
}
13+
14+
public function __toString()
15+
{
16+
return $this->value;
17+
}
18+
}

tests/Support/SupportStrTest.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Exception;
66
use Illuminate\Support\Str;
7+
use Illuminate\Tests\Support\Fixtures\StringableObjectStub;
78
use PHPUnit\Framework\Attributes\DataProvider;
89
use PHPUnit\Framework\TestCase;
910
use Ramsey\Uuid\UuidInterface;
@@ -1933,18 +1934,3 @@ public function count(): int
19331934
$this->assertSame('UserGroups', Str::pluralPascal('UserGroup', $countable));
19341935
}
19351936
}
1936-
1937-
class StringableObjectStub
1938-
{
1939-
private $value;
1940-
1941-
public function __construct($value)
1942-
{
1943-
$this->value = $value;
1944-
}
1945-
1946-
public function __toString()
1947-
{
1948-
return $this->value;
1949-
}
1950-
}

tests/Support/SupportStringableTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Support\HtmlString;
1010
use Illuminate\Support\Stringable;
1111
use Illuminate\Support\Uri;
12+
use Illuminate\Tests\Support\Fixtures\StringableObjectStub;
1213
use League\CommonMark\Environment\EnvironmentBuilderInterface;
1314
use League\CommonMark\Extension\ExtensionInterface;
1415
use PHPUnit\Framework\TestCase;

0 commit comments

Comments
 (0)