Skip to content

Commit

Permalink
#47: Add PHPUnit as a dev dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfranco committed Sep 26, 2024
1 parent 7d015db commit 3a90230
Show file tree
Hide file tree
Showing 9 changed files with 2,222 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ vendor/
/var/
/vendor/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
6 changes: 3 additions & 3 deletions application/test/banner/configuration.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<key>urn:inet:middlebury.edu:config:banner_course/pdo_count_queries</key>
<false/>
<key>urn:inet:middlebury.edu:config:banner_course/pdo_dsn</key>
<string>mysql:dbname=afranco_catalog_test;host=localhost</string>
<string>mysql:dbname=symfony_test;host=database</string>
<key>urn:inet:middlebury.edu:config:banner_course/pdo_password</key>
<string>testpassword</string>
<string>symfony</string>
<key>urn:inet:middlebury.edu:config:banner_course/pdo_username</key>
<string>testuser</string>
<string>symfony</string>

<key>urn:inet:middlebury.edu:config:apc_course/impl_class_name</key>
<string>banner_course_CourseManager</string>
Expand Down
23 changes: 23 additions & 0 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php

if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
if (PHP_VERSION_ID >= 80000) {
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
} else {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
}
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,11 @@
"allow-contrib": true,
"require": "6.4.*"
}
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "6.4.*",
"symfony/css-selector": "6.4.*",
"symfony/phpunit-bridge": "^7.1"
}
}
Loading

0 comments on commit 3a90230

Please sign in to comment.