Implemented xdebug in Gitlab CI and added code coverage systems

Code Coverage should now work properly.
This commit is contained in:
Abel Hoogeveen 2016-06-04 16:17:21 +02:00
parent 0ed6d8dd30
commit 01491b7f65
8 changed files with 49 additions and 19 deletions

View File

@ -9,6 +9,10 @@ set -xe
apt-get update -yqq
apt-get install git zip unzip -yqq
# Install xdebug
pecl install xdebug
docker-php-ext-enable xdebug
# Install mysql driver
# Here you can install any other extension that you need
docker-php-ext-install pdo_mysql

View File

@ -1781,7 +1781,7 @@ abstract class FW_DB_driver {
}
}
Logger::logError($heading ' || ' . $message);
Logger::logError($heading . ' || ' . $message);
Logger::http_error(500);
exit(8); // EXIT_DATABASE
}

View File

@ -85,18 +85,7 @@ if ( ! function_exists('get_mimes'))
if (empty($_mimes))
{
if (file_exists('Application'.DS.'Config'.DS.ENVIRONMENT.DS.'config.mimes.php'))
{
$_mimes = include('Application'.DS.'Config'.DS.ENVIRONMENT.DS.'config.mimes.php');
}
elseif (file_exists('Application'.DS.'Config'.DS.'config.mimes.php'))
{
$_mimes = include('Application'.DS.'Config'.DS.'config.mimes.php');
}
else
{
$_mimes = array();
}
$_mimes = FuzeWorks\Config::get('mimes');
}
return $_mimes;

View File

@ -465,7 +465,7 @@ if ( ! function_exists('is_really_writable'))
function is_really_writable($file)
{
// If we're on a Unix server with safe_mode off we call is_writable
if (DIRECTORY_SEPARATOR === '/' && (is_php('5.4') OR ! ini_get('safe_mode')))
if (DIRECTORY_SEPARATOR === '/' && (FuzeWorks\Core::isPHP('5.4') OR ! ini_get('safe_mode')))
{
return is_writable($file);
}

View File

@ -133,8 +133,11 @@ class Config
{
if (!is_object(self::$factory))
{
// @codeCoverageIgnoreStart
self::$factory = Factory::getInstance();
}
// @codeCoverageIgnoreEnd
$config = self::$factory->config;
return $config->getConfig($configName);
}

View File

@ -55,7 +55,7 @@ class utf8Test extends CoreTestAbstract
/**
* __construct() test
*
* @covers Utf8::__construct
* @covers FuzeWorks\Utf8::__construct
*/
public function test___construct()
{
@ -88,7 +88,7 @@ class utf8Test extends CoreTestAbstract
* clean_string() test
*
* @depends test_is_ascii
* @covers Utf8::clean_string
* @covers FuzeWorks\Utf8::clean_string
*/
public function test_clean_string()
{
@ -115,7 +115,7 @@ class utf8Test extends CoreTestAbstract
/**
* convert_to_utf8() test
*
* @covers Utf8::convert_to_utf8
* @covers FuzeWorks\Utf8::convert_to_utf8
*/
public function test_convert_to_utf8()
{

View File

@ -87,6 +87,26 @@ class commonHelperTest extends CoreTestAbstract
html_escape(array('associative' => 'and', array('multi' => 'dimentional'))),
array('associative' => 'and', array('multi' => 'dimentional'))
);
$this->assertEquals(
html_escape(array()),
array()
);
}
// ------------------------------------------------------------------------
public function test_is_php()
{
$this->assertTrue(is_php('1.2.0'));
$this->assertFalse(is_php('9999.9.9'));
}
// ------------------------------------------------------------------------
public function test_get_mimes()
{
$this->assertFalse(empty(get_mimes()));
}
}

View File

@ -7,11 +7,11 @@
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
colors="true">
colors="false">
<testsuites>
<testsuite name="Core Functionality">
<directory>.</directory>
<directory>./</directory>
</testsuite>
</testsuites>
@ -20,5 +20,19 @@
<log type="junit" target="../build/phpunit/logfile.xml" logIncompleteSkipped="false"/>
<log type="testdox-html" target="../build/phpunit/testdox.html"/>
<log type="testdox-text" target="../build/phpunit/testdox.txt"/>
<log type="coverage-html" target="../build/phpunit/coverage_html" lowUpperBound="35"
highLowerBound="70"/>
<log type="coverage-clover" target="../build/phpunit/coverage.xml"/>
<log type="coverage-php" target="../build/phpunit/coverage.serialized"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
</logging>
<filter>
<whitelist processUncoveredFilesFromWhitelist="false">
<directory suffix=".php">../</directory>
<exclude>
<directory suffix=".php">../vendor/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>