From 2659fdbebbcad4e75921e77f4b691148ed803270 Mon Sep 17 00:00:00 2001 From: Saif Eddin Gmati <29315886+azjezz@users.noreply.github.com> Date: Thu, 8 Dec 2022 16:50:25 +0100 Subject: [PATCH] chore: test against more third party frameworks (#178) Signed-off-by: azjezz --- .github/workflows/third-party-tests.yml | 3 ++ Justfile | 18 ++------- tests/third_party_tests.rs | 51 ++++++++++++++++++------- 3 files changed, 43 insertions(+), 29 deletions(-) diff --git a/.github/workflows/third-party-tests.yml b/.github/workflows/third-party-tests.yml index 9b0cefc..e417229 100644 --- a/.github/workflows/third-party-tests.yml +++ b/.github/workflows/third-party-tests.yml @@ -17,6 +17,9 @@ jobs: - 'php_parser' - 'symfony' - 'laravel' + - 'yii' + - 'mezzio' + - 'spiral' steps: - name: checkout diff --git a/Justfile b/Justfile index d5be74d..1060a3a 100644 --- a/Justfile +++ b/Justfile @@ -27,18 +27,6 @@ dump file: test filter='': cargo test --all {{filter}} -- --skip third_party -# run integration tests for `azjezz/psl` library. -test-psl: - cargo test php_standard_library -- --nocapture - -# run integration tests for `nikic/php-parser` library. -test-php-parser: - cargo test nikic_php_parser -- --nocapture - -# run integration tests for `symfony/symfony` framework. -test-symfony: - cargo test symfony_framework -- --nocapture - -# run integration tests for `laravel/framework` framework. -test-laravel: - cargo test laravel_framework -- --nocapture +# run integration tests for third party libraries. +test-third-party: + cargo test third_party -- --nocapture diff --git a/tests/third_party_tests.rs b/tests/third_party_tests.rs index b335a2b..2f52ca0 100644 --- a/tests/third_party_tests.rs +++ b/tests/third_party_tests.rs @@ -45,20 +45,6 @@ fn third_party_3_symfony_framework() { "src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-implem.php", // file contains syntax error used for testing. "src/Symfony/Component/Config/Tests/Fixtures/ParseError.php", - // FIXME: Remove this one once I've found the energy to sort out heredocs / nowdocs. - "src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/LazyServiceDumper.php", - "src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php", - "src/Symfony/Component/Mailer/Tests/Transport/NativeTransportFactoryTest.php", - "src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", - "src/Symfony/Component/VarExporter/ProxyHelper.php", - "src/Symfony/Component/VarExporter/Tests/ProxyHelperTest.php", - // FIXME: Remove these once we can support arbitrary opening and closing tags. - "src/Symfony/Component/ErrorHandler/Resources/views/exception.html.php", - "src/Symfony/Component/ErrorHandler/Resources/views/exception_full.html.php", - "src/Symfony/Component/ErrorHandler/Resources/views/logs.html.php", - "src/Symfony/Component/ErrorHandler/Resources/views/trace.html.php", - "src/Symfony/Component/ErrorHandler/Resources/views/traces.html.php", - "src/Symfony/Component/ErrorHandler/Resources/views/traces_text.html.php", ], ); } @@ -74,6 +60,43 @@ fn third_party_4_nikic_php_parser() { ); } +#[test] +fn third_party_5_yii_framework() { + test_repository( + "yii-framework", + "https://github.com/yiisoft/yii2", + "master", + &["framework", "tests"], + &[], + ); +} + +#[test] +fn third_party_6_spiral_framework() { + test_repository( + "spiral-framework", + "https://github.com/spiral/framework", + "master", + &["src", "tests"], + &[ + // file contains syntax error used for testing. + "/src/Core/tests/Fixtures/CorruptedClass.php", + "/src/Tokenizer/tests/Classes/BrokenClass.php", + ], + ); +} + +#[test] +fn third_party_7_mezzio_framework() { + test_repository( + "mezzio-framework", + "https://github.com/mezzio/mezzio", + "3.15.x", + &["src", "test"], + &[], + ); +} + fn test_repository( name: &str, repository: &str,