generated from spiral-packages/package-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\Testing\Tests\Attribute; | ||
|
||
use Spiral\Core\Internal\Introspector; | ||
use Spiral\Testing\Attribute\TestScope; | ||
use Spiral\Testing\Tests\TestCase; | ||
|
||
final class TestScopeTest extends TestCase | ||
{ | ||
public function testDefaultScope(): void | ||
{ | ||
$this->assertSame(['root'], Introspector::scopeNames($this->getContainer())); | ||
} | ||
|
||
#[TestScope('foo')] | ||
public function testScopeFromAttribute(): void | ||
{ | ||
$this->assertSame(['foo', 'root'], Introspector::scopeNames($this->getContainer())); | ||
} | ||
|
||
#[TestScope(['foo', 'bar'])] | ||
public function testNestedScopes(): void | ||
{ | ||
$this->assertSame(['bar', 'foo', 'root'], Introspector::scopeNames($this->getContainer())); | ||
} | ||
|
||
#[TestScope('foo', ['test' => \stdClass::class])] | ||
public function testScopeWithBindings(): void | ||
{ | ||
$this->assertSame(['foo', 'root'], Introspector::scopeNames($this->getContainer())); | ||
$this->assertInstanceOf(\stdClass::class, $this->getContainer()->get('test')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters