From 1368452c04570d8c04a22ed3114c09610ff59a09 Mon Sep 17 00:00:00 2001 From: Brent Roose Date: Thu, 2 May 2024 14:14:14 +0200 Subject: [PATCH] Add integration tests --- phpunit.xml | 3 ++ tests/Integration/EventIntegrationTest.php | 20 +++++++++++++ tests/IntegrationTest.php | 35 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 tests/Integration/EventIntegrationTest.php create mode 100644 tests/IntegrationTest.php diff --git a/phpunit.xml b/phpunit.xml index 98e3782..deb2914 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -12,6 +12,9 @@ ./tests/Unit + + ./tests/Integration + diff --git a/tests/Integration/EventIntegrationTest.php b/tests/Integration/EventIntegrationTest.php new file mode 100644 index 0000000..c11ed05 --- /dev/null +++ b/tests/Integration/EventIntegrationTest.php @@ -0,0 +1,20 @@ +assertTrue(MyEventHandler::$itHappened); + } +} \ No newline at end of file diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php new file mode 100644 index 0000000..f9674bb --- /dev/null +++ b/tests/IntegrationTest.php @@ -0,0 +1,35 @@ +appConfig = new AppConfig( + root: __DIR__ . '/..', + discoveryCache: true, + discoveryLocations: [ + new DiscoveryLocation( + 'App\\', + __DIR__ . '/../app/', + ), + ], + ); + + $this->kernel = new Kernel($this->appConfig); + $this->container = $this->kernel->init(); + } +} \ No newline at end of file