From 48ae7292f18de544fe88df6f155a0e8c1090608b Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Thu, 5 Feb 2026 13:21:18 +0000 Subject: [PATCH 1/7] Remove CircleCI configuration, migrate to GitHub Actions, and update code/tests for PHPUnit compatibility. --- .circleci/config.yml | 54 ------------------- .github/workflows/phpunit.yml | 45 ++++++++++++++++ composer.json | 12 +++-- phpunit.xml | 22 +++----- src/Cubex.php | 8 +-- src/Kernel/CubexKernel.php | 8 +-- src/Routing/Router.php | 2 +- src/Testing/CubexTestCase.php | 2 +- src/View/ViewModel.php | 6 +-- .../Console/Commands/BuiltInWebServerTest.php | 4 +- tests/Cubex/Console/ConsoleCommandTest.php | 4 +- tests/Cubex/Console/ConsoleTest.php | 6 +-- tests/Cubex/CubexTest.php | 24 ++++----- tests/Cubex/Http/ResponseTest.php | 31 +++++------ tests/Cubex/Kernel/ApplicationKernelTest.php | 2 +- tests/Cubex/Kernel/ControllerKernelTest.php | 2 +- tests/Cubex/Kernel/CubexKernelTest.php | 6 +-- tests/Cubex/Kernel/EndpointKernelTest.php | 8 +-- tests/Cubex/Kernel/ProjectKernelTest.php | 2 +- tests/Cubex/Kernel/SubdomainKernelTest.php | 4 +- tests/Cubex/View/BrandedTemplateViewTest.php | 16 +++--- tests/Cubex/View/LayoutControllerTest.php | 4 +- tests/Cubex/View/LayoutTest.php | 8 +-- tests/Cubex/View/MustacheViewTest.php | 2 +- tests/Cubex/View/TemplatedViewModelTest.php | 2 +- tests/Cubex/View/ViewModelTest.php | 4 +- 26 files changed, 136 insertions(+), 152 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/phpunit.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 86821fe..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,54 +0,0 @@ -defaults: &defaults - steps: - # common php steps - - run: echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories - - run: if [ -n "$ADD_PACKAGES" ]; then apk -U add $ADD_PACKAGES; fi; - - run: if [ -n "$ADD_MODULES" ]; then docker-php-ext-install $ADD_MODULES; fi; - - run: echo "date.timezone = UTC" >> $(php --ini |grep Scan |awk '{print $NF}')/timezone.ini - - run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer - - # pre-checkout steps - - # checkout - - checkout - - # post-checkout steps - - # run tests - - run: composer install -n --prefer-dist - - run: php vendor/phpunit/phpunit/phpunit -c phpunit.xml --log-junit /tmp/test-results/phpunit/junit.xml - - store_test_results: - path: /tmp/test-results - -version: 2 -jobs: - build-php70: - <<: *defaults - docker: - - image: php:7.0-alpine - build-php71: - <<: *defaults - docker: - - image: php:7.1-alpine - build-php72: - <<: *defaults - docker: - - image: php:7.2-alpine - build-php73: - <<: *defaults - docker: - - image: php:7.3-alpine - build-php74: - <<: *defaults - docker: - - image: php:7.4-alpine - -workflows: - version: 2 - build: - jobs: - - build-php70 - - build-php71 - - build-php72 - - build-php73 - - build-php74 diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..cd21113 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,45 @@ +name: PHPUnit + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] + + name: PHP ${{ matrix.php }} + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: bcmath + coverage: xdebug + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress + + - name: Run PHPUnit + run: vendor/bin/phpunit --coverage-text=coverage.txt + + - name: Check coverage + run: | + cat coverage.txt + COVERAGE=$(grep -A3 'Summary:' coverage.txt | grep 'Lines:' | grep -oP '\d+\.\d+(?=%)') + THRESHOLD=98 + if (( $(echo "$COVERAGE < $THRESHOLD" | bc -l) )); then + echo "Coverage is $COVERAGE%, below ${THRESHOLD}% threshold" + exit 1 + fi + echo "Coverage is $COVERAGE% (threshold: ${THRESHOLD}%)" diff --git a/composer.json b/composer.json index bcad6dc..2c3961b 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,10 @@ } ], "config": { - "allow-plugins": false + "allow-plugins": false, + "audit": { + "block-insecure": false + } }, "require": { "php": ">=7.0", @@ -27,7 +30,7 @@ "monolog/monolog": "~1.10", "packaged/figlet": "~0", "packaged/config": "~1.0", - "packaged/helpers": "~1.0", + "packaged/helpers": "~1.0|~2.0", "packaged/api": "~1.0", "symfony/http-foundation": "~3.2", "symfony/http-kernel": "~3.2", @@ -42,11 +45,12 @@ "mockery/mockery": "~0.9", "guzzlehttp/guzzle": "~6.3", "geoip2/geoip2": "~2.1", - "phpunit/phpunit": "~6.3" + "phpunit/phpunit": "~9" }, "autoload": { "psr-4": { - "Cubex\\": "src/" + "Cubex\\": "src/", + "CubexTest\\": "tests/" } } } diff --git a/phpunit.xml b/phpunit.xml index dedaee6..ce803bd 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,16 +1,13 @@ - +> @@ -19,14 +16,9 @@ ./tests/Cubex - - + + src - - - vendor - testing - tests - - + + diff --git a/src/Cubex.php b/src/Cubex.php index cc6437e..623b1aa 100644 --- a/src/Cubex.php +++ b/src/Cubex.php @@ -178,7 +178,7 @@ public function prepareCubex() foreach($files as $fileName) { - $file = Path::build($this->getProjectRoot(), 'conf', $fileName); + $file = Path::system($this->getProjectRoot(), 'conf', $fileName); try { $config->loadFile($file, true); @@ -330,13 +330,13 @@ public function handle( if($request->getRequestUri() === '/favicon.ico') { $favIconPaths = []; - $favIconPaths[] = Path::build($this->getProjectRoot(), 'favicon.ico'); - $favIconPaths[] = Path::build( + $favIconPaths[] = Path::system($this->getProjectRoot(), 'favicon.ico'); + $favIconPaths[] = Path::system( $this->getProjectRoot(), 'assets', 'favicon.ico' ); - $favIconPaths[] = Path::build(dirname(__DIR__), 'favicon.ico'); + $favIconPaths[] = Path::system(dirname(__DIR__), 'favicon.ico'); $favPath = null; foreach($favIconPaths as $favPath) diff --git a/src/Kernel/CubexKernel.php b/src/Kernel/CubexKernel.php index 2a92a72..8526f77 100644 --- a/src/Kernel/CubexKernel.php +++ b/src/Kernel/CubexKernel.php @@ -253,7 +253,7 @@ public function findRoute(Request $request) try { $route = $router->process( - Path::buildUnix($this->_pathProcessed, $path) + Path::url($this->_pathProcessed, $path) ); $this->_pathProcessed = null; } @@ -296,7 +296,7 @@ public function autoRoute(Request $request, $pathParts) foreach($subRoutes as $subRoute) { //Half sprintf style, but changed to str_replace for multiple instances - $attempt = Path::buildWindows( + $attempt = Path::windows( $namespace, str_replace('%s', $classPath, $subRoute) ); @@ -351,7 +351,7 @@ public function executeRoute( if(stripos($value, '\\') !== false && preg_match($match, $value)) { $class = $value; - $nsClass = Path::buildWindows(Objects::getNamespace($this), $value); + $nsClass = Path::windows(Objects::getNamespace($this), $value); try { @@ -409,7 +409,7 @@ public function executeRoute( if($value instanceof CubexKernel) { - $value->_pathProcessed = Path::buildUnix( + $value->_pathProcessed = Path::url( $this->_pathProcessed, $route->getMatchedPath() ); diff --git a/src/Routing/Router.php b/src/Routing/Router.php index caa04de..bf2e7d7 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -90,7 +90,7 @@ protected function _processRoutes($url, $routes) { return $this->createRoute( $subMatch->getValue(), - Path::buildUnix($matchedPath, $subMatch->getMatchedPath()) + Path::url($matchedPath, $subMatch->getMatchedPath()) ); } return null; diff --git a/src/Testing/CubexTestCase.php b/src/Testing/CubexTestCase.php index 9aee531..2b7f94b 100644 --- a/src/Testing/CubexTestCase.php +++ b/src/Testing/CubexTestCase.php @@ -142,7 +142,7 @@ public function assertResponseContains($expect, TestResponse $response = null) { $response = $this->_lastResponse; } - $this->assertContains($expect, $response->getContent()); + $this->assertStringContainsString($expect, $response->getContent()); } /** diff --git a/src/View/ViewModel.php b/src/View/ViewModel.php index b67395f..cda3ca4 100644 --- a/src/View/ViewModel.php +++ b/src/View/ViewModel.php @@ -132,14 +132,14 @@ protected function _calculateTemplateDefaults() $this->_templateDir = dirname($this->_templateDir); } - $this->_templateDir = Path::build( + $this->_templateDir = Path::system( $this->_templateDir, $this->_templateDirName ); if($this->_templateFile === null) { - $this->_templateFile = Path::buildCustom( + $this->_templateFile = Path::custom( DIRECTORY_SEPARATOR, array_reverse($nesting) ); @@ -155,7 +155,7 @@ protected function _calculateTemplateDefaults() */ public function getTemplatePath($extension = '.phtml') { - return Path::build( + return Path::system( $this->getTemplateDir(), $this->getTemplateFile() ) . $extension; diff --git a/tests/Cubex/Console/Commands/BuiltInWebServerTest.php b/tests/Cubex/Console/Commands/BuiltInWebServerTest.php index 22567a6..32de076 100644 --- a/tests/Cubex/Console/Commands/BuiltInWebServerTest.php +++ b/tests/Cubex/Console/Commands/BuiltInWebServerTest.php @@ -20,11 +20,11 @@ public function testCommand(array $options, $passthru, $negate = false) $bufferOut = $this->getCommandOutput($command, $options); if($negate) { - $this->assertNotContains($passthru, $bufferOut); + $this->assertStringNotContainsString($passthru, $bufferOut); } else { - $this->assertContains($passthru, $bufferOut); + $this->assertStringContainsString($passthru, $bufferOut); } } diff --git a/tests/Cubex/Console/ConsoleCommandTest.php b/tests/Cubex/Console/ConsoleCommandTest.php index 8993bc0..29ce382 100644 --- a/tests/Cubex/Console/ConsoleCommandTest.php +++ b/tests/Cubex/Console/ConsoleCommandTest.php @@ -47,7 +47,7 @@ public function testClassDocBlocks() public function testOutput() { $command = new TestConsoleCommand(); - $this->assertContains( + $this->assertStringContainsString( 'First: Brooke Last: Bryan Middle(s): Anthony James', @@ -65,7 +65,7 @@ public function testOutput() public function testOutputProcess() { $command = new TestProcessConsoleCommand(); - $this->assertContains( + $this->assertStringContainsString( 'First: Brooke Last: Bryan Middle(s): Anthony James', diff --git a/tests/Cubex/Console/ConsoleTest.php b/tests/Cubex/Console/ConsoleTest.php index afc63b8..91e66f1 100644 --- a/tests/Cubex/Console/ConsoleTest.php +++ b/tests/Cubex/Console/ConsoleTest.php @@ -50,9 +50,9 @@ public function testDoRun() $console->doRun($input, $output); $buffered = $output->fetch(); - $this->assertContains('phpserver', $buffered); - $this->assertContains('Namer', $buffered); - $this->assertContains( + $this->assertStringContainsString('phpserver', $buffered); + $this->assertStringContainsString('Namer', $buffered); + $this->assertStringContainsString( 'Command [broken] does not reference a valid class', $buffered ); diff --git a/tests/Cubex/CubexTest.php b/tests/Cubex/CubexTest.php index 10cb147..ce5a030 100644 --- a/tests/Cubex/CubexTest.php +++ b/tests/Cubex/CubexTest.php @@ -73,15 +73,15 @@ public function testExceptions() $exception = new \Exception("Test Exception", 345); $resp = $cubex->exceptionResponse($exception); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $resp); - $this->assertContains('An uncaught exception was thrown', (string)$resp); - $this->assertContains('Test Exception', (string)$resp); - $this->assertContains('345', (string)$resp); + $this->assertStringContainsString('An uncaught exception was thrown', (string)$resp); + $this->assertStringContainsString('Test Exception', (string)$resp); + $this->assertStringContainsString('345', (string)$resp); $exception = CubexException::debugException("msg", 123, 'solution'); $resp = $cubex->exceptionResponse($exception); - $this->assertContains('msg', (string)$resp); - $this->assertContains('123', (string)$resp); - $this->assertContains('solution', (string)$resp); + $this->assertStringContainsString('msg', (string)$resp); + $this->assertStringContainsString('123', (string)$resp); + $this->assertStringContainsString('solution', (string)$resp); } public function testHandle() @@ -113,8 +113,8 @@ public function testInvalidRequest() $cubex = $this->sampleProjectCubex(); $resp = $cubex->handle($request); - $this->assertContains('An uncaught exception was thrown', (string)$resp); - $this->assertContains('You must use a \Cubex\Http\Request', (string)$resp); + $this->assertStringContainsString('An uncaught exception was thrown', (string)$resp); + $this->assertStringContainsString('You must use a \Cubex\Http\Request', (string)$resp); $this->expectException( '\InvalidArgumentException', @@ -128,8 +128,8 @@ public function testInvalidRequest() $resp = $cubex->handle($request); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $resp); - $this->assertContains('Uncaught Exception', (string)$resp); - $this->assertContains('You must use a \Cubex\Http\Request', (string)$resp); + $this->assertStringContainsString('Uncaught Exception', (string)$resp); + $this->assertStringContainsString('You must use a \Cubex\Http\Request', (string)$resp); } public function testTerminate() @@ -241,12 +241,12 @@ public function testExceptionAsString(\Exception $e, $contains) { foreach($contains as $contain) { - $this->assertContains($contain, Cubex::exceptionAsString($e)); + $this->assertStringContainsString($contain, Cubex::exceptionAsString($e)); } } else { - $this->assertContains($contains, Cubex::exceptionAsString($e)); + $this->assertStringContainsString($contains, Cubex::exceptionAsString($e)); } } diff --git a/tests/Cubex/Http/ResponseTest.php b/tests/Cubex/Http/ResponseTest.php index 7c15061..9661401 100644 --- a/tests/Cubex/Http/ResponseTest.php +++ b/tests/Cubex/Http/ResponseTest.php @@ -21,19 +21,19 @@ public function testSend() { $response = new Response(); $responseSend = $response->send(); - $this->assertObjectHasAttribute('headers', $responseSend); - $this->assertObjectHasAttribute('content', $responseSend); - $this->assertObjectHasAttribute('version', $responseSend); - $this->assertObjectHasAttribute('statusCode', $responseSend); - $this->assertObjectHasAttribute('statusText', $responseSend); - $this->assertObjectHasAttribute('charset', $responseSend); + $this->assertTrue(property_exists($responseSend, 'headers')); + $this->assertTrue(property_exists($responseSend, 'content')); + $this->assertTrue(property_exists($responseSend, 'version')); + $this->assertTrue(property_exists($responseSend, 'statusCode')); + $this->assertTrue(property_exists($responseSend, 'statusText')); + $this->assertTrue(property_exists($responseSend, 'charset')); } public function testFromText() { $response = new Response(); $response->fromText("Hello World"); - $this->assertContains('Content-Type: text/plain', (string)$response); + $this->assertStringContainsString('Content-Type: text/plain', (string)$response); } public function testFromJson() @@ -57,7 +57,7 @@ public function testRenderable() $renderable = new RenderableClass(); $response = new Response(); $response->from($renderable); - $this->assertContains('rendered content', (string)$response); + $this->assertStringContainsString('rendered content', (string)$response); } public function testCubexHeaders() @@ -68,18 +68,18 @@ public function testCubexHeaders() } $response = new Response(); $response->setCubexHeaders(); - $this->assertContains('X-Execution-Time', (string)$response); + $this->assertStringContainsString('X-Execution-Time', (string)$response); $response = new Response(); $response->disableCubexHeaders(); $response->setCubexHeaders(); - $this->assertNotContains('X-Execution-Time', (string)$response); + $this->assertStringNotContainsString('X-Execution-Time', (string)$response); $response = new Response(); $response->disableCubexHeaders(); $response->enableCubexHeaders(); $response->setCubexHeaders(); - $this->assertContains('X-Execution-Time', (string)$response); + $this->assertStringContainsString('X-Execution-Time', (string)$response); } public function testCsvResponse() @@ -92,19 +92,16 @@ public function testCsvResponse() ); $response->setFilename('test.csv'); $raw = (string)$response->send(); - $this->assertContains('a1,b1,c1', $raw); + $this->assertStringContainsString('a1,b1,c1', $raw); } - /** - * @expectedException \Exception - * @expectedExceptionMessage You must specify an array or object when using a - * csv response - */ public function testInvalidCsvResponse() { $response = new CsvResponse(); $raw = (string)$response->getContent(); $this->assertEmpty($raw); + $this->expectException(\Exception::class); + $this->expectExceptionMessage('You must specify an array or object when using a csv response'); $response->setContent('this is a test'); } } diff --git a/tests/Cubex/Kernel/ApplicationKernelTest.php b/tests/Cubex/Kernel/ApplicationKernelTest.php index e74871c..7a58b54 100644 --- a/tests/Cubex/Kernel/ApplicationKernelTest.php +++ b/tests/Cubex/Kernel/ApplicationKernelTest.php @@ -9,6 +9,6 @@ class ApplicationKernelTest extends TestCase public function testSubRoutesRetunsArray() { $kernel = new ApplicationKernel(); - $this->assertInternalType('array', $kernel->subRouteTo()); + $this->assertIsArray($kernel->subRouteTo()); } } diff --git a/tests/Cubex/Kernel/ControllerKernelTest.php b/tests/Cubex/Kernel/ControllerKernelTest.php index 8b2991f..8768959 100644 --- a/tests/Cubex/Kernel/ControllerKernelTest.php +++ b/tests/Cubex/Kernel/ControllerKernelTest.php @@ -9,6 +9,6 @@ class ControllerKernelTest extends TestCase public function testSubRoutesRetunsArray() { $kernel = new ControllerKernel(); - $this->assertInternalType('array', $kernel->subRouteTo()); + $this->assertIsArray($kernel->subRouteTo()); } } diff --git a/tests/Cubex/Kernel/CubexKernelTest.php b/tests/Cubex/Kernel/CubexKernelTest.php index a5b70b3..83f6be7 100644 --- a/tests/Cubex/Kernel/CubexKernelTest.php +++ b/tests/Cubex/Kernel/CubexKernelTest.php @@ -197,7 +197,7 @@ public function testHandleWithException() '\Symfony\Component\HttpFoundation\Response', $resp ); - $this->assertContains("Mocked Exception", $resp->getContent()); + $this->assertStringContainsString("Mocked Exception", $resp->getContent()); } public function testHandleInvalidResponse() @@ -862,7 +862,7 @@ public function testCanProcess() HttpKernelInterface::MASTER_REQUEST, false ); - $this->assertContains( + $this->assertStringContainsString( 'Error 403 - Access Forbidden', $result->getContent() ); @@ -934,7 +934,7 @@ public function baseRoutesProvider() public function testRouteData() { $kernel = new RouteDataTest(); - $this->assertInternalType('array', $kernel->getRouteData()); + $this->assertIsArray($kernel->getRouteData()); $this->assertArrayHasKey('one', $kernel->getRouteData()); $this->assertCount(2, $kernel->getRouteData()); $this->assertNull($kernel->getRouteData('three')); diff --git a/tests/Cubex/Kernel/EndpointKernelTest.php b/tests/Cubex/Kernel/EndpointKernelTest.php index c71b37e..6c80ea8 100644 --- a/tests/Cubex/Kernel/EndpointKernelTest.php +++ b/tests/Cubex/Kernel/EndpointKernelTest.php @@ -23,14 +23,14 @@ public function testExceptions() $kernel = new MockEndpointKernel(); $kernel->setCubex($this->getCubex()); $result = $kernel->handle(Request::create('/error', 'GET', [])); - $this->assertContains('json', $result->headers->get('content-type')); + $this->assertStringContainsString('json', $result->headers->get('content-type')); $content = $result->getContent(); $this->assertJson($content); - $this->assertContains( + $this->assertStringContainsString( 'status":{"code":500,"message":"Something Failed"}', $content ); - $this->assertContains( + $this->assertStringContainsString( '"type":"\\\\Packaged\\\\Api\\\\Exceptions\\\\ApiException"', $content ); @@ -41,7 +41,7 @@ public function testResult() $kernel = new MockEndpointKernel(); $kernel->setCubex($this->getCubex()); $result = $kernel->handle(Request::create('/result', 'GET', [])); - $this->assertContains('json', $result->headers->get('content-type')); + $this->assertStringContainsString('json', $result->headers->get('content-type')); $this->assertEquals( '{"status":{"code":200,"message":""},' . '"type":"\CubexTest\Cubex\Kernel\MockEndpointResult"' diff --git a/tests/Cubex/Kernel/ProjectKernelTest.php b/tests/Cubex/Kernel/ProjectKernelTest.php index 4b6ef98..3af6b4a 100644 --- a/tests/Cubex/Kernel/ProjectKernelTest.php +++ b/tests/Cubex/Kernel/ProjectKernelTest.php @@ -9,6 +9,6 @@ class ProjectKernelTest extends TestCase public function testSubRoutesRetunsArray() { $kernel = new ProjectKernel(); - $this->assertInternalType('array', $kernel->subRouteTo()); + $this->assertIsArray($kernel->subRouteTo()); } } diff --git a/tests/Cubex/Kernel/SubdomainKernelTest.php b/tests/Cubex/Kernel/SubdomainKernelTest.php index 4d0ddf0..8ddb893 100644 --- a/tests/Cubex/Kernel/SubdomainKernelTest.php +++ b/tests/Cubex/Kernel/SubdomainKernelTest.php @@ -62,7 +62,7 @@ public function testMethodCalls($subdomain, $expect, $catch = true) if(is_scalar($expect)) { - $this->assertContains($expect, $response->getContent()); + $this->assertStringContainsString($expect, $response->getContent()); } else { @@ -99,7 +99,7 @@ public function testCanProcess() HttpKernelInterface::MASTER_REQUEST, false ); - $this->assertContains('Please Login', (string)$result); + $this->assertStringContainsString('Please Login', (string)$result); } } diff --git a/tests/Cubex/View/BrandedTemplateViewTest.php b/tests/Cubex/View/BrandedTemplateViewTest.php index 994fffe..cdc8594 100644 --- a/tests/Cubex/View/BrandedTemplateViewTest.php +++ b/tests/Cubex/View/BrandedTemplateViewTest.php @@ -43,31 +43,31 @@ public function testFullReplacement() { $request = $this->createRequest('www.replace.com'); $view = $this->prepareViewModel($request); - $this->assertContains('Replaced', $view->render()); + $this->assertStringContainsString('Replaced', $view->render()); } public function testBuildsRequestFromGlobals() { $view = $this->prepareViewModel(); - $this->assertContains('Default branded page', $view->render()); + $this->assertStringContainsString('Default branded page', $view->render()); } public function testPrePost() { $request = $this->createRequest('www.custom.com'); $view = $this->prepareViewModel($request); - $this->assertContains('Pre', $view->render()); - $this->assertContains('Default branded page', $view->render()); - $this->assertContains('Post', $view->render()); + $this->assertStringContainsString('Pre', $view->render()); + $this->assertStringContainsString('Default branded page', $view->render()); + $this->assertStringContainsString('Post', $view->render()); } public function testLanguage() { $request = $this->createRequest('www.custom.test', 'it'); $view = $this->prepareViewModel($request); - $this->assertContains('Pre', $view->render()); - $this->assertContains('Italian Version', $view->render()); - $this->assertContains('Post', $view->render()); + $this->assertStringContainsString('Pre', $view->render()); + $this->assertStringContainsString('Italian Version', $view->render()); + $this->assertStringContainsString('Post', $view->render()); } public function testException() diff --git a/tests/Cubex/View/LayoutControllerTest.php b/tests/Cubex/View/LayoutControllerTest.php index 8075040..c033e69 100644 --- a/tests/Cubex/View/LayoutControllerTest.php +++ b/tests/Cubex/View/LayoutControllerTest.php @@ -27,7 +27,7 @@ public function testBasics() $controller->setLayout($layout); $this->assertEquals($layout, $controller->layout()); $layout->insert('testing', new Renderable($output)); - $this->assertContains($output, (string)$controller); + $this->assertStringContainsString($output, (string)$controller); } public function testDisableLayout() @@ -62,7 +62,7 @@ public function testResponses($route, $expect) false ); - $this->assertContains($expect, $response->getContent()); + $this->assertStringContainsString($expect, $response->getContent()); } /** diff --git a/tests/Cubex/View/LayoutTest.php b/tests/Cubex/View/LayoutTest.php index d6abe78..c5e7a8f 100644 --- a/tests/Cubex/View/LayoutTest.php +++ b/tests/Cubex/View/LayoutTest.php @@ -40,8 +40,8 @@ public function testRender() $layout = new Layout(new CubexProject(), 'Default'); $layout->insert('testing', new RenderableSection()); $rendered = $layout->render(); - $this->assertContains('Testing', $rendered); - $this->assertContains('
section
', $rendered); + $this->assertStringContainsString('Testing', $rendered); + $this->assertStringContainsString('
section
', $rendered); } public function testSetCallingClass() @@ -50,8 +50,8 @@ public function testSetCallingClass() $layout->setCallingClass('namespaced\CubexProject'); $layout->insert('testing', new RenderableSection()); $rendered = $layout->render(); - $this->assertContains('Testing', $rendered); - $this->assertContains('
section
', $rendered); + $this->assertStringContainsString('Testing', $rendered); + $this->assertStringContainsString('
section
', $rendered); } public function testData() diff --git a/tests/Cubex/View/MustacheViewTest.php b/tests/Cubex/View/MustacheViewTest.php index c5b4d33..cbf37cc 100644 --- a/tests/Cubex/View/MustacheViewTest.php +++ b/tests/Cubex/View/MustacheViewTest.php @@ -11,7 +11,7 @@ public function testRender() $view = new TestMustacheModel(); $view->setTemplateDir(__DIR__ . DIRECTORY_SEPARATOR . 'res'); $view->setTemplateFile('mustache'); - $this->assertContains( + $this->assertStringContainsString( 'Hello Test You have just won $10 ($12)!', $view->render() ); diff --git a/tests/Cubex/View/TemplatedViewModelTest.php b/tests/Cubex/View/TemplatedViewModelTest.php index 10b8b38..a67f4ee 100644 --- a/tests/Cubex/View/TemplatedViewModelTest.php +++ b/tests/Cubex/View/TemplatedViewModelTest.php @@ -14,7 +14,7 @@ public function testRender() */ $view->setTemplateDir(__DIR__ . DIRECTORY_SEPARATOR . 'res'); $view->setTemplateFile('test'); - $this->assertContains('Test phtml file', $view->render()); + $this->assertStringContainsString('Test phtml file', $view->render()); $this->expectException('Exception', 'Excepted'); $view->setTemplateFile('exceptional'); diff --git a/tests/Cubex/View/ViewModelTest.php b/tests/Cubex/View/ViewModelTest.php index 12f81ea..0634286 100644 --- a/tests/Cubex/View/ViewModelTest.php +++ b/tests/Cubex/View/ViewModelTest.php @@ -23,7 +23,7 @@ public function testGetSet() $this->assertEquals('randomFile', $view->getTemplateFile()); $this->assertEquals( - Path::build('randomDir', 'randomFile.phtml'), + Path::system('randomDir', 'randomFile.phtml'), $view->getTemplatePath('.phtml') ); } @@ -59,7 +59,7 @@ public function testToString() $exception = 'Render Exception'; $viewModel = new RenderableViewModel($exception); $expect = '

An uncaught exception was thrown

'; - $this->assertContains($expect, (string)$viewModel); + $this->assertStringContainsString($expect, (string)$viewModel); } } From b3021004bb119b547ba45a84a4043a283aba4565 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Thu, 5 Feb 2026 13:23:29 +0000 Subject: [PATCH 2/7] update branches --- .github/workflows/phpunit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index cd21113..6214273 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -2,9 +2,9 @@ name: PHPUnit on: push: - branches: [ master ] + branches: [ master, '2.0' ] pull_request: - branches: [ master ] + branches: [ master, '2.0' ] jobs: test: From f784922adcb4b2a2a0f61c611b086f1f08f59f88 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Thu, 5 Feb 2026 13:26:01 +0000 Subject: [PATCH 3/7] only required for 7.4 --- .github/workflows/phpunit.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 6214273..0e11ae6 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -9,12 +9,8 @@ on: jobs: test: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] - name: PHP ${{ matrix.php }} + name: PHP 7.4 steps: - name: Checkout @@ -23,7 +19,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: '7.4' extensions: bcmath coverage: xdebug From d72288f6a360a33fb4233adfbcdc80cd40e4a700 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Thu, 5 Feb 2026 13:27:06 +0000 Subject: [PATCH 4/7] only required for 7.4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2c3961b..421154f 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } }, "require": { - "php": ">=7.0", + "php": "~7.4", "psr/log": "~1.0", "illuminate/container": "~5.4", "illuminate/support": "~5.4", From 972c3ecc181a5795d4b31f0d538924373778cd27 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Tue, 29 Sep 2026 10:32:09 +0100 Subject: [PATCH 5/7] Tighten helpers constraint and keep tests out of consumer autoload - packaged/helpers ^1.17.1: Path::system/url/windows/custom first ship together in 1.17.1, so earlier 1.x releases would fail at runtime. - CubexTest\ moves to autoload-dev so consumers don't autoload the framework's test namespace. - actions/checkout moves to its latest major, v7. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/phpunit.yml | 2 +- composer.json | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 0e11ae6..9c18b54 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index 421154f..8e3da2f 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "monolog/monolog": "~1.10", "packaged/figlet": "~0", "packaged/config": "~1.0", - "packaged/helpers": "~1.0|~2.0", + "packaged/helpers": "^1.17.1|~2.0", "packaged/api": "~1.0", "symfony/http-foundation": "~3.2", "symfony/http-kernel": "~3.2", @@ -49,7 +49,11 @@ }, "autoload": { "psr-4": { - "Cubex\\": "src/", + "Cubex\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { "CubexTest\\": "tests/" } } From 71e690833a462d6a7f944b8cb7affce26715e405 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Tue, 29 Sep 2026 10:35:13 +0100 Subject: [PATCH 6/7] Assert exception messages again and drop Travis PHPUnit 9's expectException() takes only the class, so the 25 calls passing a message (and two passing a code) had stopped checking either. They now use expectExceptionMessage() and expectExceptionCode(). .travis.yml still targeted PHP 7.0/7.1, which can't install a ~7.4 package; GitHub Actions replaces it. Co-Authored-By: Claude Opus 5.5 --- .travis.yml | 16 --------------- .../Auth/Providers/IPAuthProviderTest.php | 9 ++++----- tests/Cubex/Console/ConsoleCommandTest.php | 6 ++---- tests/Cubex/CubexTest.php | 20 +++++++------------ .../Cubex/Http/Visitor/MaxmindVisitorTest.php | 18 ++++++----------- tests/Cubex/Kernel/CubexKernelTest.php | 14 ++++++------- tests/Cubex/Kernel/SubdomainKernelTest.php | 3 ++- tests/Cubex/Routing/RouterTest.php | 12 ++++------- .../ServiceManager/ServiceManagerTest.php | 9 ++++----- .../Services/AuthServiceTest.php | 6 ++++-- tests/Cubex/View/BrandedTemplateViewTest.php | 3 ++- tests/Cubex/View/LayoutTest.php | 6 ++---- tests/Cubex/View/MustacheViewTest.php | 6 ++---- tests/Cubex/View/TemplatedViewModelTest.php | 9 ++++----- tests/Cubex/View/ViewModelHelperTraitTest.php | 3 ++- 15 files changed, 52 insertions(+), 88 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 88cdf11..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -php: - - 7 - - 7.1 - -before_script: - - composer self-update - - composer install --no-progress --no-interaction --prefer-source - -script: - - mkdir -p build/logs - - phpunit --coverage-clover build/logs/clover.xml - -matrix: - fast_finish: true diff --git a/tests/Cubex/Auth/Providers/IPAuthProviderTest.php b/tests/Cubex/Auth/Providers/IPAuthProviderTest.php index 11c56d8..cc332e1 100644 --- a/tests/Cubex/Auth/Providers/IPAuthProviderTest.php +++ b/tests/Cubex/Auth/Providers/IPAuthProviderTest.php @@ -19,10 +19,8 @@ public function testLogout() public function testForgottenPassword() { $auth = new IPAuthProvider(); - $this->expectException( - '\Exception', - 'Forgotten Password is not available' - ); + $this->expectException('\Exception'); + $this->expectExceptionMessage('Forgotten Password is not available'); $auth->forgottenPassword('user'); } @@ -45,7 +43,8 @@ public function testRetrieve( { if($exception !== null) { - $this->expectException('\Exception', $exception); + $this->expectException('\Exception'); + $this->expectExceptionMessage($exception); } $cnf = []; diff --git a/tests/Cubex/Console/ConsoleCommandTest.php b/tests/Cubex/Console/ConsoleCommandTest.php index 29ce382..480da0e 100644 --- a/tests/Cubex/Console/ConsoleCommandTest.php +++ b/tests/Cubex/Console/ConsoleCommandTest.php @@ -90,10 +90,8 @@ public function testUnfinishedCommand() public function testSetCubex() { $command = new TestProcessConsoleCommand(); - $this->expectException( - 'Exception', - 'Cubex is controlled by the application' - ); + $this->expectException('Exception'); + $this->expectExceptionMessage('Cubex is controlled by the application'); $command->setCubex(new \Cubex\Cubex()); } } diff --git a/tests/Cubex/CubexTest.php b/tests/Cubex/CubexTest.php index ce5a030..b05ef48 100644 --- a/tests/Cubex/CubexTest.php +++ b/tests/Cubex/CubexTest.php @@ -116,10 +116,8 @@ public function testInvalidRequest() $this->assertStringContainsString('An uncaught exception was thrown', (string)$resp); $this->assertStringContainsString('You must use a \Cubex\Http\Request', (string)$resp); - $this->expectException( - '\InvalidArgumentException', - 'You must use a \Cubex\Http\Request' - ); + $this->expectException('\InvalidArgumentException'); + $this->expectExceptionMessage('You must use a \Cubex\Http\Request'); $cubex->handle( $request, Cubex::MASTER_REQUEST, @@ -144,10 +142,8 @@ public function testTerminate() public function testNoKernelProvidedException() { - $this->expectException( - "RuntimeException", - "No Cubex Kernel has been configured" - ); + $this->expectException("RuntimeException"); + $this->expectExceptionMessage("No Cubex Kernel has been configured"); $cubex = new Cubex(__DIR__); $cubex->instance('\Cubex\Kernel\CubexKernel', new \stdClass()); $request = Request::createFromGlobals(); @@ -166,11 +162,9 @@ public function testBrokenKernelProvidedException() $request = Request::createFromGlobals(); $cubex->instance('\Cubex\Kernel\CubexKernel', $kernel); $this->assertNull($kernel->handle($request)); - $this->expectException( - '\Cubex\CubexException', - "A valid response was not generated by the default kernel", - 500 - ); + $this->expectException('\Cubex\CubexException'); + $this->expectExceptionMessage("A valid response was not generated by the default kernel"); + $this->expectExceptionCode(500); $cubex->handle($request, Cubex::MASTER_REQUEST, false); } diff --git a/tests/Cubex/Http/Visitor/MaxmindVisitorTest.php b/tests/Cubex/Http/Visitor/MaxmindVisitorTest.php index 5203e5d..2ab1337 100644 --- a/tests/Cubex/Http/Visitor/MaxmindVisitorTest.php +++ b/tests/Cubex/Http/Visitor/MaxmindVisitorTest.php @@ -57,20 +57,16 @@ public function testVisitor( public function testNoConfig() { - $this->expectException( - "Exception", - "You must configure the MaxMindVisitor class" - ); + $this->expectException("Exception"); + $this->expectExceptionMessage("You must configure the MaxMindVisitor class"); $visitor = new MaxmindVisitor(); $visitor->getCountry(); } public function testNoLicence() { - $this->expectException( - "Exception", - "No maxmind licence key specified" - ); + $this->expectException("Exception"); + $this->expectExceptionMessage("No maxmind licence key specified"); $visitor = new MaxmindVisitor(); $visitor->configure( new ConfigSection( @@ -86,10 +82,8 @@ public function testNoLicence() public function testNoUserId() { - $this->expectException( - "Exception", - "No maxmind user id specified" - ); + $this->expectException("Exception"); + $this->expectExceptionMessage("No maxmind user id specified"); $visitor = new MaxmindVisitor(); $visitor->configure( new ConfigSection( diff --git a/tests/Cubex/Kernel/CubexKernelTest.php b/tests/Cubex/Kernel/CubexKernelTest.php index 83f6be7..0b75bd7 100644 --- a/tests/Cubex/Kernel/CubexKernelTest.php +++ b/tests/Cubex/Kernel/CubexKernelTest.php @@ -122,11 +122,9 @@ public function testHeaders() public function test404Handle() { - $this->expectException( - 'Exception', - "The processed route did not yield a valid response", - 404 - ); + $this->expectException('Exception'); + $this->expectExceptionMessage("The processed route did not yield a valid response"); + $this->expectExceptionCode(404); $request = Request::createFromGlobals(); $kernel = new ResultNotFoundTest(); @@ -213,7 +211,8 @@ public function testHandleInvalidResponse() public function testThrowsExceptionWithNoRouter() { - $this->expectException("RuntimeException", "No IRouter located"); + $this->expectException("RuntimeException"); + $this->expectExceptionMessage("No IRouter located"); $request = Request::createFromGlobals(); $kernel = $this->getKernel(); $kernel->getCubex()->instance('\Cubex\Routing\IRouter', new \stdClass()); @@ -464,7 +463,8 @@ public function testExecuteRoute( if(!$catch) { - $this->expectException('Exception', $exception); + $this->expectException('Exception'); + $this->expectExceptionMessage($exception); } $result = $kernel->executeRoute($route, $request, $type, $catch); diff --git a/tests/Cubex/Kernel/SubdomainKernelTest.php b/tests/Cubex/Kernel/SubdomainKernelTest.php index 8ddb893..5695590 100644 --- a/tests/Cubex/Kernel/SubdomainKernelTest.php +++ b/tests/Cubex/Kernel/SubdomainKernelTest.php @@ -51,7 +51,8 @@ public function testMethodCalls($subdomain, $expect, $catch = true) if(!$catch) { - $this->expectException('Exception', $expect); + $this->expectException('Exception'); + $this->expectExceptionMessage($expect); } $response = $class->handle( diff --git a/tests/Cubex/Routing/RouterTest.php b/tests/Cubex/Routing/RouterTest.php index 04199d6..c6bb7c2 100644 --- a/tests/Cubex/Routing/RouterTest.php +++ b/tests/Cubex/Routing/RouterTest.php @@ -44,10 +44,8 @@ public function patternMatches() public function testProcessNoSubjectException() { - $this->expectException( - "RuntimeException", - "No routable subject has been defined" - ); + $this->expectException("RuntimeException"); + $this->expectExceptionMessage("No routable subject has been defined"); $router = new Router(); $router->process("/hello"); } @@ -59,10 +57,8 @@ public function testProcess($url, $routes, $expect, $expectException = false) { if($expectException) { - $this->expectException( - "Exception", - "Unable to locate a suitable route" - ); + $this->expectException("Exception"); + $this->expectExceptionMessage("Unable to locate a suitable route"); } $router = new Router(); $router->setCubex($this->newCubexInstace()); diff --git a/tests/Cubex/ServiceManager/ServiceManagerTest.php b/tests/Cubex/ServiceManager/ServiceManagerTest.php index 3da0ef4..a660937 100644 --- a/tests/Cubex/ServiceManager/ServiceManagerTest.php +++ b/tests/Cubex/ServiceManager/ServiceManagerTest.php @@ -31,10 +31,8 @@ public function testCanAddService() $tester ); - $this->expectException( - '\RuntimeException', - "The service 'smtester' has already been registered." - ); + $this->expectException('\RuntimeException'); + $this->expectExceptionMessage("The service 'smtester' has already been registered."); $manager->addService( "smtester", 'CubexTest\Cubex\ServiceManager\TestService', @@ -104,7 +102,8 @@ public function testRegisterExceptions( { $manager->destroyService($service); } - $this->expectException($eType, $eMsg); + $this->expectException($eType); + $this->expectExceptionMessage($eMsg); $cubex->make($service); } diff --git a/tests/Cubex/ServiceManager/Services/AuthServiceTest.php b/tests/Cubex/ServiceManager/Services/AuthServiceTest.php index 3b64acc..95e3099 100644 --- a/tests/Cubex/ServiceManager/Services/AuthServiceTest.php +++ b/tests/Cubex/ServiceManager/Services/AuthServiceTest.php @@ -61,14 +61,16 @@ public function testAuthFacade() public function testInvalidLoginException() { - $this->expectException('\RuntimeException', "Unable to login 'user'"); + $this->expectException('\RuntimeException'); + $this->expectExceptionMessage("Unable to login 'user'"); $auth = $this->getAuthService(); $auth->login('user', 'password'); } public function testForgottenPasswordException() { - $this->expectException('\Exception', "User not found"); + $this->expectException('\Exception'); + $this->expectExceptionMessage("User not found"); $auth = $this->getAuthService(); $auth->forgottenPassword('user'); } diff --git a/tests/Cubex/View/BrandedTemplateViewTest.php b/tests/Cubex/View/BrandedTemplateViewTest.php index cdc8594..06937e2 100644 --- a/tests/Cubex/View/BrandedTemplateViewTest.php +++ b/tests/Cubex/View/BrandedTemplateViewTest.php @@ -72,7 +72,8 @@ public function testLanguage() public function testException() { - $this->expectException('Exception', 'Broken Language'); + $this->expectException('Exception'); + $this->expectExceptionMessage('Broken Language'); $request = $this->createRequest('www.custom.test', 'fr'); $view = $this->prepareViewModel($request); $view->render(); diff --git a/tests/Cubex/View/LayoutTest.php b/tests/Cubex/View/LayoutTest.php index c5e7a8f..5799a4a 100644 --- a/tests/Cubex/View/LayoutTest.php +++ b/tests/Cubex/View/LayoutTest.php @@ -27,10 +27,8 @@ public function testSections() public function testInvalidSectionGet() { - $this->expectException( - 'Exception', - "missing has not yet been bound to this layout" - ); + $this->expectException('Exception'); + $this->expectExceptionMessage("missing has not yet been bound to this layout"); $layout = new Layout(new CubexProject(), 'Default'); $layout->get('missing'); } diff --git a/tests/Cubex/View/MustacheViewTest.php b/tests/Cubex/View/MustacheViewTest.php index cbf37cc..a79dc04 100644 --- a/tests/Cubex/View/MustacheViewTest.php +++ b/tests/Cubex/View/MustacheViewTest.php @@ -23,10 +23,8 @@ public function testInvalidFile() $view->setTemplateDir(__DIR__ . DIRECTORY_SEPARATOR . 'res'); $view->setTemplateFile('invalid'); $tpl = $view->getTemplatePath('.phtml'); - $this->expectException( - 'Exception', - 'The template file \'' . $tpl . '\' does not exist' - ); + $this->expectException('Exception'); + $this->expectExceptionMessage('The template file \'' . $tpl . '\' does not exist'); $view->render(); } } diff --git a/tests/Cubex/View/TemplatedViewModelTest.php b/tests/Cubex/View/TemplatedViewModelTest.php index a67f4ee..d4a7ccb 100644 --- a/tests/Cubex/View/TemplatedViewModelTest.php +++ b/tests/Cubex/View/TemplatedViewModelTest.php @@ -16,7 +16,8 @@ public function testRender() $view->setTemplateFile('test'); $this->assertStringContainsString('Test phtml file', $view->render()); - $this->expectException('Exception', 'Excepted'); + $this->expectException('Exception'); + $this->expectExceptionMessage('Excepted'); $view->setTemplateFile('exceptional'); $view->render(); } @@ -30,10 +31,8 @@ public function testInvalidFile() $view->setTemplateDir(__DIR__ . DIRECTORY_SEPARATOR . 'res'); $view->setTemplateFile('invalid'); $tpl = $view->getTemplatePath('.phtml'); - $this->expectException( - 'Exception', - 'The template file \'' . $tpl . '\' does not exist' - ); + $this->expectException('Exception'); + $this->expectExceptionMessage('The template file \'' . $tpl . '\' does not exist'); $view->render(); } } diff --git a/tests/Cubex/View/ViewModelHelperTraitTest.php b/tests/Cubex/View/ViewModelHelperTraitTest.php index 02a902a..c2feaaa 100644 --- a/tests/Cubex/View/ViewModelHelperTraitTest.php +++ b/tests/Cubex/View/ViewModelHelperTraitTest.php @@ -32,7 +32,8 @@ public function testMagic() public function testMagicException() { - $this->expectException('\Exception', 'Unsupported method random'); + $this->expectException('\Exception'); + $this->expectExceptionMessage('Unsupported method random'); $class = new TestableViewModelHelperTrait(); $class->random(); } From 6e36343a2d344481fa4bffd774ace501d5833591 Mon Sep 17 00:00:00 2001 From: Tom Kay Date: Tue, 29 Sep 2026 10:41:16 +0100 Subject: [PATCH 7/7] Scope the security-advisory override to CI Composer only reads config from the root package, so the override never reached consumers, but it disabled advisory blocking for every install of this repo. It is now just the CI install step's --no-blocking. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/phpunit.yml | 3 ++- composer.json | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 9c18b54..13a1196 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -23,8 +23,9 @@ jobs: extensions: bcmath coverage: xdebug + # The 2.x dev dependencies (PHPUnit, Guzzle 6) carry security advisories that Composer blocks by default - name: Install dependencies - run: composer install --no-interaction --prefer-dist --no-progress + run: composer install --no-interaction --prefer-dist --no-progress --no-blocking - name: Run PHPUnit run: vendor/bin/phpunit --coverage-text=coverage.txt diff --git a/composer.json b/composer.json index 8e3da2f..fc11e77 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,7 @@ } ], "config": { - "allow-plugins": false, - "audit": { - "block-insecure": false - } + "allow-plugins": false }, "require": { "php": "~7.4",