Giter VIP home page Giter VIP logo

test-pack's Introduction

Sponsor

The test pack for Symfony 6.1/6.2 is backed by Endava.

Endava is reimagining the relationship between people and technology. By leveraging next-generation technologies, our agile, multi-disciplinary teams provide a combination of Product & Technology Strategies, Intelligent Experiences, and World Class Engineering to help our clients become more engaging, responsive, and efficient.

Help Symfony by sponsoring its development!

test-pack's People

Contributors

alexislefebvre avatar dunglas avatar fabpot avatar heahdude avatar nicolas-grekas avatar weaverryan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

test-pack's Issues

Class PHPUnit\Framework\TestCase not found and could not be autoloaded.

When I use Symfony 4.1 and PhpStan 0.10
In case:
Adding phpunit/phpunit as a dependency is discouraged in favor of Symfony's PHPUnit Bridge.

Instead:
Remove it now: composer remove --dev phpunit/phpunit
Use Symfony's bridge: composer require --dev phpunit
i got next erors:
Class PHPUnit\Framework\TestCase not found and could not be autoloaded.
Class PHPUnit\Framework\TestCase was not found while trying to analyse it - autoloading is probably not configured properly.
This hapens becouse phpunit not install before run a tests.
you also can see next topic in PhpStan repo

s/functionnal/functional/

In this project's description and composer.json file, it is written functionnal, I think that it should be changed to functional since I can't find any proof that the word functionnal with 2 n exist.

Backtrack limit exhausted on Installation

Hey,
i´m trying to install test-pack on my Project.

root@77aaea1110f4:/app# composer require --dev symfony/test-pack

Output:

...
Unpacking Symfony packs

  • Unpacked symfony/test-pack
    In PcreException.php line 29:
    preg_match(): failed executing "#^{ \s*? (?P\S+.?)? (?P\s) }$#sx": Backtrack limit exhausted`

How can i fix the installation of test-pack? I cant find any similar cases about this errormessage on Symfony.

My project is based on 'bitnami/symfony' Docker image with these Dependencies:

    "api-platform/core": {
    },
    "doctrine/annotations": {
    },
    "doctrine/doctrine-bundle": {
    },
    "doctrine/doctrine-migrations-bundle": {
    },
    "lexik/jwt-authentication-bundle": {
    },
    "nelmio/cors-bundle": {
    },
    "nyholm/psr7": {
    },
    "phpunit/phpunit": {
    },
    "sensio/framework-extra-bundle": {
    },
    "symfony/console": {
    },
    "symfony/debug-bundle": {
    },
    "symfony/flex": {
    },
    "symfony/framework-bundle": {
    },
    "symfony/mailer": {
    },
    "symfony/maker-bundle": {
    },
    "symfony/messenger": {
    },
    "symfony/monolog-bundle": {
    },
    "symfony/notifier": {
    },
    "symfony/phpunit-bridge": {
    },
    "symfony/requirements-checker": {
    },
    "symfony/routing": {
    },
    "symfony/security-bundle": {
    },
    "symfony/sendgrid-mailer": {
    },
    "symfony/translation": {
    },
    "symfony/twig-bundle": {
    },
    "symfony/validator": {
    },
    "symfony/web-profiler-bundle": {
    },
    "symfony/webapp-pack": {
}
    "symfonycasts/verify-email-bundle": {
}

Adding phpunit dependency to test-pack breaks phpunit-bridge

My package has a dev dependency on both symfony/phpunit-bridge and symfony/test-pack. I run my tests with vendor/bin/simple-phpunit.

After updating to test-pack 1.0.8, which adds a direct dependency on phpunit/phpunit, my tests no longer run, as invoking simple-phpunit immediately fails with an error:

PHP Fatal error:  Uncaught Error: Cannot instantiate interface PHPUnit\TextUI\Exception in /.../vendor/bin/.phpunit/phpunit-9.3-0/src/TextUI/Command.php:103
Stack trace:
#0 /.../vendor/bin/.phpunit/phpunit-9.3-0/phpunit(22): PHPUnit\TextUI\Command::main()
#1 /.../vendor/symfony/phpunit-bridge/bin/simple-phpunit.php(428): include('/......')
#2 /.../vendor/bin/simple-phpunit(21) : eval()'d code(12): require('/......')
#3 /.../vendor/bin/simple-phpunit(21): eval()
#4 {main}
  thrown in /.../vendor/bin/.phpunit/phpunit-9.3-0/src/TextUI/Command.php on line 103

I am running Symfony 4.4 on PHP 7.4.

Remaining indirect deprecation notices

When I run php ./vendor/bin/phpunit command, test is ok but display Remaining indirect deprecation notices

Testing started at 12:18 PM ...
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Testing C:\projects\karaka\tests\Controller


Time: 00:00.619, Memory: 28.00 MB

OK (1 test, 1 assertion)

Remaining indirect deprecation notices (1)

  1x: The "Symfony\Bridge\Doctrine\Logger\DbalLogger" class implements "Doctrine\DBAL\Logging\SQLLogger" that is deprecated Use {@link \Doctrine\DBAL\Logging\Middleware} or implement {@link \Doctrine\DBAL\Driver\Middleware} instead.
    1x in ProductControllerTest::testProduct from App\Tests\Controller

Process finished with exit code 0

ProductControllerTest.php

<?php

namespace App\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class ProductControllerTest extends WebTestCase
{
    public function testProduct(): void
    {
        $client = static::createClient();
        $crawler = $client->request('POST', '/product');

        $this->assertResponseIsSuccessful();
    }
}

@nicolas-grekas How can I fix this warning?

Version 1.0.8 requires phpunit directly, breaking simple phpunit

I just ran a composer update in a symfony 4.4 project and it upgraded this test pack from 1.0.7 to 1.0.8.
1.0.8 requires phpunit directly, which results in it being installed into the vendor folder.

This then causes issues when running the simple-phpunit script which installs a seperate phpunit version outside the usual vendor folder. It causes errors like these:

Symfony\Component\ErrorHandler\Error\UndefinedMethodError {#15648
  #message: "Attempted to call an undefined method named "doRun" of class "PHPUnit\TextUI\TestRunner"."
  #code: 0
  #file: "./bin/.phpunit/phpunit-7.5-0/src/TextUI/Command.php"
  #line: 206
  trace: {
    ./bin/.phpunit/phpunit-7.5-0/src/TextUI/Command.php:206 {
      PHPUnit\TextUI\Command->run(array $argv, bool $exit = true): int
      › try {
      ›     $result = $runner->doRun($suite, $this->arguments, $exit);
      › } catch (Exception $e) {
    }
    ./bin/.phpunit/phpunit-7.5-0/src/TextUI/Command.php:162 { …}
    ./bin/.phpunit/phpunit-7.5-0/phpunit:22 { …}
    ./vendor/symfony/phpunit-bridge/bin/simple-phpunit.php:435 { …}
    ./bin/phpunit.php:13 { …}
  }
}

I worked around this by declaring

    "conflict": {
        // [...]
        "phpunit/phpunit": "*"
    },

This prevents the newer test-pack from being installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.