Skip to content

Commit

Permalink
Remove usage of deprecated methods
Browse files Browse the repository at this point in the history
Signed-off-by: Luís Cobucci <[email protected]>
  • Loading branch information
lcobucci committed Aug 1, 2023
1 parent 525b794 commit 5edba38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
beStrictAboutCoverageMetadata="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
>
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>

<testsuites>
<testsuite name="DI Builder Test Suite">
<directory>test</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
7 changes: 3 additions & 4 deletions test/ContainerBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
#[PHPUnit\UsesClass(Xml::class)]
final class ContainerBuilderTest extends TestCase
{
/** @var Generator&MockObject */
private Generator $generator;
private Generator&MockObject $generator;
private ContainerConfiguration $config;
private ParameterBag $parameterBag;

#[PHPUnit\Before]
public function configureDependencies(): void
{
$this->generator = $this->getMockForAbstractClass(Generator::class, [], '', false, true, true, ['generate']);
$this->generator = $this->createMock(Generator::class);
$this->config = new ContainerConfiguration('Me\\MyApp');
$this->parameterBag = new ParameterBag();
}
Expand Down Expand Up @@ -105,7 +104,7 @@ public function constructShouldReceiveTheDependenciesAsArguments(): void
public function setGeneratorShouldChangeTheAttributeAndReturnSelf(): void
{
$builder = new ContainerBuilder($this->config, $this->generator, $this->parameterBag);
$generator = $this->getMockForAbstractClass(Generator::class, [], '', false);
$generator = $this->createMock(Generator::class);
$expected = new ContainerBuilder($this->config, $generator, $this->parameterBag);

// @phpstan-ignore-next-line method is deprecated and will be removed in the next major version
Expand Down
5 changes: 1 addition & 4 deletions test/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ public function initializeContainerShouldAddTheConfigurationFileAsAResource(): v
#[PHPUnit\Test]
public function initializeContainerCanOptionallyUseACustomClass(): void
{
$generator = $this->getMockForAbstractClass(
Generator::class,
[__FILE__, CustomContainerBuilderForTests::class],
);
$generator = new Yaml(__FILE__, CustomContainerBuilderForTests::class);

self::assertInstanceOf(
CustomContainerBuilderForTests::class,
Expand Down

0 comments on commit 5edba38

Please sign in to comment.