extending php-cs to the tests/ directory

This commit is contained in:
Ryan Weaver
2020-03-04 08:56:19 -05:00
parent 4c446019ec
commit 28c26b5f38
23 changed files with 188 additions and 19 deletions

View File

@@ -5,7 +5,10 @@ if (!file_exists(__DIR__.'/src')) {
}
$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__)
->exclude('vendor')
->exclude('tests/tmp')
->exclude('fixtures')
// the PHP template files are a bit special
->notName('*.tpl.php')
;

View File

@@ -35,7 +35,7 @@ class EventRegistryTest extends TestCase
// less than PHP 7.2, unset object type-hint example
// otherwise, it looks like a class in this namespace
if (PHP_VERSION_ID < 70200) {
if (\PHP_VERSION_ID < 70200) {
unset($listenersMap[3]);
}

View File

@@ -19,11 +19,6 @@ class GeneratorTwigHelperTest extends TestCase
{
/**
* @dataProvider getEntityFieldPrintCodeTests
*
* @param string $entity
* @param string $fieldName
* @param string $fieldType
* @param string $expect
*/
public function testGetEntityFieldPrintCode(string $entity, string $fieldName, string $fieldType, string $expect)
{

View File

@@ -40,7 +40,7 @@ class FunctionalTest extends TestCase
continue;
}
/** Skip make forgotten password as it is temp. disabled (tkt#537) */
/* Skip make forgotten password as it is temp. disabled (tkt#537) */
if (MakeForgottenPassword::class === $class) {
continue;
}

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeAuthenticator;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeCommand;
@@ -29,4 +38,4 @@ class MakeCommandTest extends MakerTestCase
->changeRootNamespace('Custom'),
];
}
}
}

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeController;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeCrud;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeEntity;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeFixtures;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeForgottenPassword;
@@ -10,6 +19,7 @@ class MakeForgottenPasswordTest extends MakerTestCase
{
/**
* Test skipped until make forgotten password is enabled again.
*
* @see https://github.com/symfony/maker-bundle/issues/537
*/
public function getTestDetails()
@@ -27,7 +37,7 @@ class MakeForgottenPasswordTest extends MakerTestCase
->setFixtureFilesPath(__DIR__.'/../fixtures/MakeForgottenPassword')
->configureDatabase()
->updateSchemaAfterCommand()
->addExtraDependencies('symfony/swiftmailer-bundle')
->addExtraDependencies('symfony/swiftmailer-bundle'),
];
}
}

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeForm;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeFunctionalTest;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeMigration;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeRegistrationForm;
@@ -28,7 +37,7 @@ class MakeRegistrationFormTest extends MakerTestCase
// test run, the UniqueEntity would not be seen, because
// the the validation cache was out of date. The cause
// is currently unknown, so this workaround was added
->addPostMakeCommand('php bin/console cache:clear --env=test')
->addPostMakeCommand('php bin/console cache:clear --env=test'),
];
// sanity check on all the interactive questions
@@ -59,7 +68,7 @@ class MakeRegistrationFormTest extends MakerTestCase
->updateSchemaAfterCommand()
// workaround for strange failure - see test case
// registration_form_entity_guard_authenticate for details
->addPostMakeCommand('php bin/console cache:clear --env=test')
->addPostMakeCommand('php bin/console cache:clear --env=test'),
];
}
}

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeSerializerEncoder;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeSubscriber;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeTwigExtension;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeUnitTest;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeUser;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeValidator;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\MakerBundle\Tests\Maker;
use Symfony\Bundle\MakerBundle\Maker\MakeVoter;

View File

@@ -249,7 +249,7 @@ class InteractiveSecurityHelperTest extends TestCase
yield 'guess_fixture_class' => [
'expectedEmailField' => 'email',
true,
FixtureClass::class
FixtureClass::class,
];
yield 'guess_fixture_class_2' => [
@@ -284,7 +284,7 @@ class InteractiveSecurityHelperTest extends TestCase
yield 'guess_fixture_class' => [
'expectedPasswordSetter' => 'setPassword',
true,
FixtureClass5::class
FixtureClass5::class,
];
yield 'guess_fixture_class_2' => [
@@ -319,7 +319,7 @@ class InteractiveSecurityHelperTest extends TestCase
yield 'guess_fixture_class' => [
'expectedPasswordSetter' => 'getEmail',
true,
FixtureClass7::class
FixtureClass7::class,
];
yield 'guess_fixture_class_2' => [
@@ -354,20 +354,28 @@ class FixtureClass4
class FixtureClass5
{
public function setPassword() {}
public function setPassword()
{
}
}
class FixtureClass6
{
public function setEncodedPassword() {}
public function setEncodedPassword()
{
}
}
class FixtureClass7
{
public function getEmail() {}
public function getEmail()
{
}
}
class FixtureClass8
{
public function getMyEmail() {}
public function getMyEmail()
{
}
}