1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-25 14:59:49 +01:00
This commit is contained in:
Cameron 2019-04-01 11:37:57 -07:00
commit f4d67bc6b6
12 changed files with 112 additions and 24 deletions

54
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,54 @@
before_script:
- bash ./lib/ci/setup.sh
cache:
paths:
- ./vendor/
variables:
MYSQL_DATABASE: app
MYSQL_ROOT_PASSWORD: 'Database Password for Continuous Integration'
test:php5.6-mysql5.5:
services:
- mysql:5.5
image: php:5.6
script: "php ./vendor/bin/codecept run unit --steps --debug"
test:php7.1-mysql5.6:
services:
- mysql:5.6
image: php:7.1
script: "php ./vendor/bin/codecept run unit --steps --debug --coverage --coverage-xml --coverage-html"
test:php7.2-mysql5.7:
services:
- mysql:5.6
image: php:7.2
script: "php ./vendor/bin/codecept run unit --steps --debug --coverage --coverage-xml --coverage-html"
test:php7.3-mysql8.0:
services:
- name: mysql:8.0
command: ["mysqld", "--default-authentication-plugin=mysql_native_password"]
image: php:7.3
script: "php ./vendor/bin/codecept run unit --steps --debug --coverage --coverage-xml --coverage-html"
artifacts:
when: always
paths:
- ./tests/_output/
pages:
stage: deploy
dependencies:
- test:php7.3-mysql8.0
image: ruby:latest
before_script: []
script:
- mv ./tests/_output/ ./public/
when: always
artifacts:
paths:
- ./public/
only:
- master

2
e107

@ -1 +1 @@
Subproject commit a8d1541b9d059437d7a98cf1c3b652b879ebb7ca
Subproject commit c060d5ace25abd5dd1cc701937c6aedb0078a058

10
lib/ci/config.ci.yml Normal file
View File

@ -0,0 +1,10 @@
---
deployer: 'local'
url: 'http://set-this-to-your-acceptance-test-url.local/'
db:
host: 'mysql'
dbname: 'app'
user: 'root'
password: 'Database Password for Continuous Integration'
populate: true
dump_path: 'tests/_data/e107_v2.1.9.sample.sql'

21
lib/ci/setup.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
apt-get update
apt-get install -y git zip libzip-dev
pecl install zip
docker-php-ext-enable zip
pecl install xdebug
docker-php-ext-enable xdebug
docker-php-ext-install pdo_mysql
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
php composer.phar install
php composer.phar update
git submodule update --init --recursive --remote
cp ./lib/ci/config.ci.yml ./config.yml

@ -1 +1 @@
Subproject commit c7868a07e4d9fef5878d988501c05ee808b11e51
Subproject commit f1c73d69027b8d6b2bf3aa1c3d66ab51e693ce11

View File

@ -6,6 +6,9 @@ include_once(codecept_root_dir() . "lib/preparers/PreparerFactory.php");
// all public methods declared in helper class will be available in $I
use Codeception\Lib\ModuleContainer;
use PreparerFactory;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
abstract class E107Base extends Base
{
@ -16,7 +19,7 @@ abstract class E107Base extends Base
public function __construct(ModuleContainer $moduleContainer, $config = null)
{
parent::__construct($moduleContainer, $config);
$this->preparer = \PreparerFactory::create();
$this->preparer = PreparerFactory::create();
}
public function _beforeSuite($settings = array())
@ -37,10 +40,10 @@ abstract class E107Base extends Base
protected function writeLocalE107Config()
{
$twig_loader = new \Twig_Loader_Array([
$twig_loader = new ArrayLoader([
'e107_config.php' => file_get_contents(codecept_data_dir()."/e107_config.php.sample")
]);
$twig = new \Twig_Environment($twig_loader);
$twig = new Environment($twig_loader);
$db = $this->getModule('\Helper\DelayedDb');

View File

@ -309,11 +309,11 @@
$actual = $this->dbv->getFixQuery('insert', 'table', 'table_auth', $sqlFileData);
$expected = "ALTER TABLE `e107_table` ADD `table_auth` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'";
$expected = "ALTER TABLE `e107_table` ADD `table_auth` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER table_ip";
$this->assertEquals($expected,$actual);
$actual = $this->dbv->getFixQuery('insert', 'table', 'table_json', $sqlFileData);
$expected = "ALTER TABLE `e107_table` ADD `table_json` JSON NOT NULL";
$expected = "ALTER TABLE `e107_table` ADD `table_json` JSON NOT NULL AFTER table_category";
$this->assertEquals($expected,$actual);
$actual = $this->dbv->getFixQuery('index', 'table', 'table_email', $sqlFileData);

View File

@ -151,7 +151,7 @@
$actual = e107::getDebug()->getTimeMarkers();
$this->assertIsArray($actual);
$this->assertTrue(is_array($actual));
$this->assertEquals('Testing', $actual[1]['What']);
$this->assertArrayHasKey('Index', $actual[1]);
$this->assertArrayHasKey('Time', $actual[1]);

View File

@ -154,7 +154,7 @@
$actual = e107::getDebug()->getTimeMarkers();
$this->assertIsArray($actual);
$this->assertTrue(is_array($actual));
$this->assertEquals('Testing', $actual[1]['What']);
$this->assertArrayHasKey('Index', $actual[1]);
$this->assertArrayHasKey('Time', $actual[1]);

File diff suppressed because one or more lines are too long

View File

@ -263,6 +263,6 @@
public function testGetPath()
{
$result = $this->md->getPath('image/jpeg');
var_dump($result);
// FIXME: This test doesn't do anything?
}
}

View File

@ -336,8 +336,8 @@ TMP;
$parm = varset($var['parm']);
$result = $this->tp->toDB($var['input'], false, false, $mode, $parm);
// $this->assertEquals($var['expected'], $result);
var_dump($result);
// $this->assertEquals($var['expected'], $result);
// FIXME: This test doesn't do anything?
}
@ -833,7 +833,7 @@ TMP;
foreach($tests as $var)
{
$result = $this->tp->cleanHtml($var['html']);
var_dump($result);
// FIXME: This test doesn't do anything?
}