Skip to content

Commit 807877b

Browse files
committed
Add buildsystem.
1 parent cc83fba commit 807877b

File tree

5 files changed

+107
-3
lines changed

5 files changed

+107
-3
lines changed

.travis.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: php
2+
php:
3+
- "5.3"
4+
- "5.4"
5+
- "5.5"
6+
env:
7+
global:
8+
matrix:
9+
- CONTAO_VERSION=~2.11
10+
- CONTAO_VERSION=~3.1
11+
- CONTAO_VERSION=~3.2
12+
13+
install:
14+
- composer require contao/core $CONTAO_VERSION --prefer-dist --dev
15+
- composer install --prefer-dist --dev
16+
17+
script: ant -keep-going
18+
19+
branches:
20+
only:
21+
- tng

build.xml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<project name="MetaModels attribute select" default="test">
3+
<target name="phpunit">
4+
<exec dir="${basedir}" executable="vendor/bin/phpunit" failonerror="true" />
5+
</target>
6+
7+
<target name="phpcs">
8+
<exec dir="${basedir}" executable="vendor/bin/phpcs" failonerror="true">
9+
<arg line="--standard=${basedir}/vendor/metamodels/php-coding-standard/MetaModels/ruleset.xml ${basedir}/src"/>
10+
</exec>
11+
</target>
12+
13+
<target name="test" depends="phpunit,phpcs"/>
14+
</project>

composer.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
"metamodels/core":"~2.0.0"
5151
},
5252
"require-dev": {
53-
"metamodels/php-coding-standard":"dev-master",
54-
"cyberspectrum/contao-toolbox": "dev-master"
53+
"metamodels/php-coding-standard": "dev-master",
54+
"cyberspectrum/contao-toolbox": "dev-master",
55+
"phpunit/phpunit": ">=3.7.10,<4-dev"
5556
},
5657
"conflict": {
5758
"contao/core": "3.0.*"
@@ -76,5 +77,7 @@
7677
"branch-alias": {
7778
"dev-tng": "2.0.x-dev"
7879
}
79-
}
80+
},
81+
"minimum-stability": "dev",
82+
"prefer-stable": true
8083
}

phpunit.xml.dist

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
bootstrap="tests/bootstrap.php"
13+
>
14+
<testsuites>
15+
<testsuite name="MetaModels attribute select tests">
16+
<directory>./tests/MetaModels/</directory>
17+
</testsuite>
18+
</testsuites>
19+
20+
<groups>
21+
<exclude>
22+
<group>slow</group>
23+
</exclude>
24+
</groups>
25+
26+
<filter>
27+
<whitelist>
28+
<directory>./src/system/modules/metamodelsattribute_select/MetaModels/</directory>
29+
</whitelist>
30+
</filter>
31+
</phpunit>

tests/bootstrap.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* The MetaModels extension allows the creation of multiple collections of custom items,
4+
* each with its own unique set of selectable attributes, with attribute extendability.
5+
* The Front-End modules allow you to build powerful listing and filtering of the
6+
* data in each collection.
7+
*
8+
* PHP version 5
9+
* @package MetaModels
10+
* @subpackage Tests
11+
* @author Christian Schiffler <[email protected]>
12+
* @copyright The MetaModels team.
13+
* @license LGPL.
14+
* @filesource
15+
*/
16+
17+
error_reporting(E_ALL);
18+
19+
function includeIfExists($file)
20+
{
21+
return file_exists($file) ? include $file : false;
22+
}
23+
24+
if (
25+
// Locally installed dependencies
26+
(!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php'))
27+
// We are within an composer install.
28+
&& (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) {
29+
echo 'You must set up the project dependencies, run the following commands:'.PHP_EOL.
30+
'curl -sS https://getcomposer.org/installer | php'.PHP_EOL.
31+
'php composer.phar install'.PHP_EOL;
32+
exit(1);
33+
}
34+
35+
$loader->add('MetaModels\Test', __DIR__);

0 commit comments

Comments
 (0)