Skip to content

Commit d8c3e38

Browse files
committed
Fix tests
1 parent f5842b1 commit d8c3e38

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

phpunit.xml.dist

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
55
colors="true"
66
forceCoversAnnotation="true"
77
failOnRisky="true"
@@ -17,10 +17,10 @@
1717
<directory>./tests</directory>
1818
</testsuite>
1919
</testsuites>
20-
<filter>
21-
<whitelist>
22-
<directory>./driver</directory>
23-
<directory>./src</directory>
24-
</whitelist>
25-
</filter>
20+
<coverage>
21+
<include>
22+
<directory>./driver</directory>
23+
<directory>./src</directory>
24+
</include>
25+
</coverage>
2626
</phpunit>

tests/DependencyInjection/MetaModelsAttributeContentArticleExtensionTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use MetaModels\AttributeContentArticleBundle\EventListener\BackendEventListener;
2525
use MetaModels\AttributeContentArticleBundle\EventListener\GetOptionsListener;
2626
use MetaModels\AttributeContentArticleBundle\EventListener\InitializeListener;
27+
use MetaModels\AttributeContentArticleBundle\Table\ArticleContent;
2728
use PHPUnit\Framework\TestCase;
2829
use Symfony\Component\DependencyInjection\ContainerBuilder;
2930

@@ -43,7 +44,8 @@ public function testLoad(): void
4344
BackendEventListener::class,
4445
GetOptionsListener::class,
4546
InitializeListener::class,
46-
AttributeTypeFactory::class
47+
AttributeTypeFactory::class,
48+
ArticleContent::class,
4749
];
4850

4951
self::assertCount(count($expectedDefinitions), $container->getDefinitions());

tests/Widgets/ContentArticleWidgetTest.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Doctrine\DBAL\Connection;
2626
use MetaModels\AttributeContentArticleBundle\Widgets\ContentArticleWidget;
2727
use PHPUnit\Framework\TestCase;
28+
use Symfony\Contracts\Translation\TranslatorInterface;
2829

2930
/**
3031
* @covers \MetaModels\AttributeContentArticleBundle\Widgets\ContentArticleWidget
@@ -42,17 +43,19 @@ public function testNewInstance(): void
4243

4344
$input = $this->getMockBuilder(Adapter::class)
4445
->disableOriginalConstructor()
45-
->setMethods(['get'])
46+
->addMethods(['get'])
4647
->getMock();
4748

4849
$input
4950
->expects(self::once())
5051
->method('get')
5152
->willReturn(1);
5253

54+
$translator = $this->getMockBuilder(TranslatorInterface::class)->getMock();
55+
5356
$widget = $this->getMockBuilder(ContentArticleWidget::class)
54-
->setConstructorArgs([null, $dcCompat, $connection, $input])
55-
->setMethods(['import'])
57+
->setConstructorArgs([null, $dcCompat, $connection, $input, $translator])
58+
->onlyMethods(['import'])
5659
->getMock();
5760

5861
$widget

0 commit comments

Comments
 (0)