* [ADD] Travis CI

This commit is contained in:
nuxsmin
2018-07-23 12:59:55 +02:00
committed by Rubén D
parent a600106876
commit e5424503b0
3 changed files with 24 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev
script: ./vendor/bin/phpunit --bootstrap ./test/bootstrap.php ./test
script: ./vendor/bin/phpunit -c ./phpunit.xml
notifications:
on_success: never

12
phpunit.xml Normal file
View File

@@ -0,0 +1,12 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
bootstrap="./test/bootstrap.php">
</phpunit>
<testsuites>
<testsuite name="sysPass">
<directory suffix=".php">./test</directory>
<exclude>./test/res</exclude>
<exclude>./test/tmp</exclude>
</testsuite>
</testsuites>

View File

@@ -50,22 +50,28 @@ define('SELF_HOSTNAME', gethostbyaddr(SELF_IP_ADDRESS));
require APP_ROOT . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
require APP_ROOT . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'BaseFunctions.php';
print 'APP_ROOT=' . APP_ROOT . PHP_EOL;
// Setup directories
if (!is_dir(TMP_DIR)) {
print 'Creating ' . TMP_DIR . PHP_EOL;
mkdir(TMP_DIR);
} else {
print 'Deleting ' . TMP_DIR . PHP_EOL;
// Delete tmp dir ...
array_map('unlink', glob(TMP_DIR . DIRECTORY_SEPARATOR . '*'));
}
if (is_dir(CONFIG_PATH)
&& decoct(fileperms(CONFIG_PATH) & 0777) !== '750'
) {
print 'Setting permissions for ' . CONFIG_PATH . PHP_EOL;
chmod(CONFIG_PATH, 750);
}
// Delete tmp dir ...
array_map('unlink', glob(TMP_DIR . DIRECTORY_SEPARATOR . '*'));
print 'APP_ROOT=' . APP_ROOT;
/**
* Función para llamadas a gettext
*/