Skip to content

Commit 19a22aa

Browse files
committed
Use PhpUnit directly
1 parent 2e6d30a commit 19a22aa

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ jobs:
3939
dependency-versions: ${{ matrix.dependency }}
4040

4141
- name: Integration Tests
42-
run: php ./vendor/bin/simple-phpunit
42+
run: php ./vendor/bin/phpunit

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"laravel/pint": "^1.24.0",
3030
"phpstan/phpstan": "^2.1.22",
3131
"rector/rector": "^2.1.5",
32-
"symfony/phpunit-bridge": "^6.4.25|^7.3|^8.0",
32+
"phpunit/phpunit": "^11|^12",
3333
"symfony/framework-bundle": "^6.4|^7.3|^8.0"
3434
},
3535
"autoload": {

tests/OpenAIBundleTest.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
use OpenAI\Client;
88
use OpenAI\Contracts\ClientContract;
99
use OpenAI\Symfony\OpenAIBundle;
10+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
1011
use PHPUnit\Framework\TestCase;
1112
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1213
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
1314
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
15+
use Symfony\Component\ErrorHandler\ErrorHandler;
1416
use Symfony\Component\HttpClient\MockHttpClient;
1517
use Symfony\Component\HttpClient\Response\MockResponse;
1618
use Symfony\Component\HttpKernel\Kernel;
@@ -19,6 +21,38 @@
1921

2022
final class OpenAIBundleTest extends TestCase
2123
{
24+
public static function setUpBeforeClass(): void
25+
{
26+
ErrorHandler::register(null, false);
27+
}
28+
29+
#[DoesNotPerformAssertions]
30+
public function test_defaults(): void
31+
{
32+
$kernel = new class('test', true) extends Kernel
33+
{
34+
use MicroKernelTrait;
35+
36+
public function registerBundles(): iterable
37+
{
38+
yield new FrameworkBundle;
39+
yield new OpenAIBundle;
40+
}
41+
42+
protected function configureContainer(ContainerConfigurator $container): void
43+
{
44+
$container->extension('framework', [
45+
'secret' => 'S0ME_SECRET',
46+
'http_method_override' => false,
47+
'handle_all_throwables' => true,
48+
'php_errors' => ['log' => true],
49+
]);
50+
}
51+
};
52+
53+
$kernel->boot();
54+
}
55+
2256
public function test_service(): void
2357
{
2458
$kernel = new class('test', true) extends Kernel

0 commit comments

Comments
 (0)