-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from mglaman/prevent-crash-if-no-phpunit
Check getInterfaceNames over implementsInterface
- Loading branch information
Showing
5 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,3 +114,47 @@ jobs: | |
cd ~/drupal | ||
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/token drupal/blazy | ||
./vendor/bin/phpstan analyze web/modules/contrib/blazy --no-progress || if (($? == 255)); then false; else true; fi | ||
build_integration_no_phpunit: | ||
continue-on-error: ${{ matrix.experimental }} | ||
runs-on: "ubuntu-latest" | ||
name: "Build Integration (No PHPUnit) | PHP ${{ matrix.php-version }} | Drupal ${{ matrix.drupal }}" | ||
strategy: | ||
matrix: | ||
experimental: [false] | ||
php-version: | ||
- "7.4" | ||
drupal: | ||
- "^8.9" | ||
- "^9.0" | ||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
tools: composer:v2 | ||
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv | ||
- name: Setup Drupal | ||
uses: bluehorndigital/[email protected] | ||
with: | ||
version: ${{ matrix.drupal }} | ||
path: ~/drupal | ||
- name: "Remove PHPUnit" | ||
run: | | ||
cd ~/drupal | ||
composer --dev remove phpspec/prophecy-phpunit drupal/core-dev | ||
- name: "require phpstan-drupal" | ||
run: | | ||
cd ~/drupal | ||
COMPOSER_MEMORY_LIMIT=-1 composer require mglaman/phpstan-drupal *@dev | ||
cp $GITHUB_WORKSPACE/tests/fixtures/config/drupal-phpstan.neon phpstan.neon | ||
- name: "Test core/install.php" | ||
run: | | ||
cd ~/drupal | ||
./vendor/bin/phpstan analyze web/core/install.php --debug | ||
- name: "Test no crash" | ||
run: | | ||
cd ~/drupal | ||
./vendor/bin/phpstan analyze web/core/modules/dynamic_page_cache --debug || if (($? == 255)); then false; else true; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/fixtures/drupal/modules/module_with_tests/tests/src/Kernel/DrupalStaticCallTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Drupal\Tests\module_with_tests\Kernel; | ||
|
||
use Drupal; | ||
use Drupal\KernelTests\KernelTestBase; | ||
use Drupal\Tests\module_with_tests\Traits\ModuleWithTestsTrait; | ||
|
||
/** | ||
* This is a dummy test class. | ||
* | ||
* @group module_with_tests | ||
*/ | ||
class DrupalStaticCallTest extends KernelTestBase { | ||
|
||
use ModuleWithTestsTrait; | ||
|
||
/** | ||
* A dummy test. | ||
*/ | ||
public function testModule() { | ||
$request = Drupal::hasRequest(); | ||
$this->assertFalse($request); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters