Skip to content

Commit

Permalink
add fixture stubs to make fixture repository rule work
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Dec 18, 2024
1 parent 48bf682 commit 5b4a1b4
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 16 deletions.
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<testsuite name="all">
<directory>tests</directory>
<exclude>tests/Rules/ClassNameRespectsParentSuffixRule/Fixture/</exclude>
<exclude>tests/Rules/PHPUnit/PublicStaticDataProviderRule</exclude>
</testsuite>
</phpunit>
5 changes: 5 additions & 0 deletions src/Enum/ClassName.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ final class ClassName
*/
public const EVENT_DISPATCHER_INTERFACE = 'Symfony\Component\EventDispatcher\EventDispatcherInterface';

/**
* @var string
*/
public const EVENT_SUBSCRIBER_INTERFACE = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';

/**
* @var string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Rules/ClassNameRespectsParentSuffixRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class ClassNameRespectsParentSuffixRule implements Rule
*/
private const DEFAULT_PARENT_CLASSES = [
'Symfony\Component\Console\Command\Command',
ClassName::EVENT_DISPATCHER_INTERFACE,
ClassName::EVENT_SUBSCRIBER_INTERFACE,
ClassName::SYMFONY_ABSTRACT_CONTROLLER,
ClassName::SNIFF,
ClassName::PHPUNIT_TEST_CASE,
Expand Down
13 changes: 0 additions & 13 deletions stubs/Dibi/Connection.php

This file was deleted.

15 changes: 15 additions & 0 deletions stubs/Doctrine/Bundle/FixturesBundle/Fixture.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Doctrine\Bundle\FixturesBundle;

use Doctrine\Common\DataFixtures\FixtureInterface;

if (class_exists('Doctrine\Bundle\FixturesBundle\Fixture')) {
return;
}


class Fixture implements FixtureInterface
{

}
12 changes: 12 additions & 0 deletions stubs/Doctrine/Common/DataFixtures/FixtureInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Doctrine\Common\DataFixtures;

if (class_exists('Doctrine\Common\DataFixtures\FixtureInterface')) {
return;
}

interface FixtureInterface
{

}
12 changes: 12 additions & 0 deletions stubs/Doctrine/Persistence/ObjectManager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Doctrine\Persistence;

if (class_exists('Doctrine\Persistence\ObjectManager')) {
return;
}

class ObjectManager
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public function testRun()

public static function provideData(): array
{
return [];
return [1, 2, 3];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public function testRun()

protected function provideData(): array
{
return [];
return [1, 2, 3];
}
}

0 comments on commit 5b4a1b4

Please sign in to comment.