Skip to content

Commit 82c5e95

Browse files
committed
Update the unit testing enviroment
1 parent 7b5081a commit 82c5e95

6 files changed

Lines changed: 34 additions & 35 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
composer.lock
12
vendor

composer.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "safire-ac-za/simplesamlphp-module-fticks",
33
"description": "SimpleSAMLphp module to record F-Ticks statistics",
44
"type": "simplesamlphp-module",
5+
"keywords": ["simplesamlphp", "fticks"],
56
"license": "MIT",
67
"authors": [
78
{
@@ -11,17 +12,25 @@
1112
],
1213
"require": {
1314
"php": ">=5.6",
14-
"simplesamlphp/composer-module-installer": "^1.1"
15+
"simplesamlphp/composer-module-installer": "~1.1"
1516
},
1617
"require-dev": {
1718
"simplesamlphp/simplesamlphp": ">=1.17",
1819
"phpunit/phpunit": "~4.8"
1920
},
21+
"autoload": {
22+
"psr-4": {
23+
"SimpleSAML\\Module\\fticks\\": "lib/"
24+
}
25+
},
2026
"autoload-dev": {
21-
"files": ["tests/_autoload_modules.php"]
27+
"psr-4": {
28+
"SimpleSAML\\Test\\Utils\\": "vendor/simplesamlphp/simplesamlphp/tests/Utils"
29+
}
2230
},
2331
"support": {
2432
"issues": "https://github.com/safire-ac-za/simplesamlphp-module-fticks/issues",
2533
"source": "https://github.com/safire-ac-za/simplesamlphp-module-fticks"
2634
}
2735
}
36+

phpunit.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<phpunit bootstrap="./vendor/autoload.php" colors="true">
2+
<phpunit bootstrap="tests/bootstrap.php" colors="true">
33
<testsuites>
44
<testsuite name="The project's test suite">
5-
<directory>./tests</directory>
5+
<directory>tests/</directory>
66
</testsuite>
77
</testsuites>
8+
<filter>
9+
<whitelist processUncoveredFilesFromWhitelist="true">
10+
<directory suffix=".php">./lib</directory>
11+
</whitelist>
12+
</filter>
13+
<logging>
14+
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true" />
15+
<log type="coverage-html" target="build/coverage" title="PHP Coveralls" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70" />
16+
<log type="coverage-clover" target="build/logs/clover.xml" />
17+
</logging>
818
</phpunit>
919

tests/_autoload_modules.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/bootstrap.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
$projectRoot = dirname(__DIR__);
3+
require_once($projectRoot.'/vendor/autoload.php');
4+
5+
// Symlink module into ssp vendor lib so that templates and urls can resolve correctly
6+
$linkPath = $projectRoot.'/vendor/simplesamlphp/simplesamlphp/modules/consent';
7+
if (file_exists($linkPath) === false) {
8+
echo "Linking '$linkPath' to '$projectRoot'\n";
9+
symlink($projectRoot, $linkPath);
10+
}

tests/lib/Auth/Process/FticksTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
namespace SimpleSAML\Test\Module\fticks\Auth\Process;
44

5-
// Alias the PHPUnit 6.0 ancestor if available, else fall back to legacy ancestor
6-
if (class_exists('\PHPUnit\Framework\TestCase', true) and !class_exists('\PHPUnit_Framework_TestCase', true)) {
7-
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase', true);
8-
}
9-
require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/lib/Auth/Process/Fticks.php');
10-
115
/**
126
* Test for the core:CardinalitySingle filter.
137
*/

0 commit comments

Comments
 (0)