diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 3ed194987..931771b72 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -53,34 +53,6 @@ jobs: - name: Build frontend (production) run: npm run build - unit-test: - runs-on: ubuntu-latest - container: - image: danger89/mbin-pipeline:1.3.0 - steps: - - uses: actions/checkout@v4 - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - run: cp .env.example .env - - name: Composer install - run: composer install --no-scripts --no-progress - - - name: Run unit tests - env: - COMPOSER_CACHE_DIR: ${{ steps.composer-cache.outputs.dir }} - SYMFONY_DEPRECATIONS_HELPER: disabled - run: php bin/phpunit tests/Unit - integration-test: runs-on: ubuntu-latest container: @@ -123,6 +95,12 @@ jobs: - name: Build frontend (production) run: npm run build + - name: Run unit tests + env: + COMPOSER_CACHE_DIR: ${{ steps.composer-cache.outputs.dir }} + SYMFONY_DEPRECATIONS_HELPER: disabled + run: php bin/phpunit tests/Unit + - name: Run integration tests env: COMPOSER_CACHE_DIR: ${{ steps.composer-cache.outputs.dir }} diff --git a/tests/Unit/Service/MentionManagerTest.php b/tests/Unit/Service/MentionManagerTest.php index a3e952030..fdb5f8fab 100644 --- a/tests/Unit/Service/MentionManagerTest.php +++ b/tests/Unit/Service/MentionManagerTest.php @@ -4,9 +4,10 @@ namespace App\Tests\Unit\Service; +use App\Service\MentionManager; use App\Service\SettingsManager; -use App\Tests\WebTestCase; use PHPUnit\Framework\Attributes\DataProvider; +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class MentionManagerTest extends WebTestCase { @@ -26,8 +27,7 @@ public function testExtract(string $input, ?array $output): void // Replace the actual setting service with the mock in the container $this->getContainer()->set(SettingsManager::class, $settingsManagerMock); - - $manager = $this->mentionManager; + $manager = $this->getContainer()->get(MentionManager::class); $this->assertEquals($output, $manager->extract($input)); }