Merge branch 'feature/php-regression-4102'
Conflicts: .gitignore
This commit is contained in:
commit
11f4a5b0b5
|
@ -3,9 +3,9 @@
|
||||||
# But not .gitignore and .vagrant-puppet
|
# But not .gitignore and .vagrant-puppet
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!.vagrant-puppet
|
!.vagrant-puppet
|
||||||
# Build artefacts
|
|
||||||
build/
|
build/
|
||||||
# Dev environmental
|
test/js/npm-debug.log
|
||||||
.idea/
|
|
||||||
# Configure output
|
# ./configure output
|
||||||
config.log
|
config.log
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
describe('regression test for bug #4102', function(){
|
||||||
|
it('Object.create', function(){
|
||||||
|
Object.create.should.be.a('function');
|
||||||
|
|
||||||
|
var t = {
|
||||||
|
name: 'test123'
|
||||||
|
};
|
||||||
|
|
||||||
|
t.should.have.property('name').and.equal('test123');
|
||||||
|
});
|
||||||
|
});
|
|
@ -4,11 +4,23 @@ set -o nounset
|
||||||
|
|
||||||
SCRIPTNAME=$(readlink -f $0)
|
SCRIPTNAME=$(readlink -f $0)
|
||||||
DIR=$(dirname $SCRIPTNAME)
|
DIR=$(dirname $SCRIPTNAME)
|
||||||
|
MOCHA=$(which mocha)
|
||||||
|
DEFAULT="--recursive --require should"
|
||||||
|
|
||||||
|
if [[ ! -x $MOCHA ]]; then
|
||||||
|
echo "mocha not found!";
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Make sure that the destination directory for logs and reports exists
|
# Make sure that the destination directory for logs and reports exists
|
||||||
mkdir -p $DIR/../../build/log
|
mkdir -p $DIR/../../build/log
|
||||||
|
|
||||||
mocha --reporter "xunit" --recursive "$@" . > $DIR/../../build/log/mocha_results.xml
|
cd $DIR
|
||||||
mocha --reporter "cobertura" --recursive "$@" . > $DIR/../../build/log/mocha_coverage.xml
|
|
||||||
|
|
||||||
exit 0
|
# Don't know where node modules are
|
||||||
|
export NODE_PATH=.:/usr/local/lib/node_modules:/usr/lib/node_modules
|
||||||
|
|
||||||
|
$MOCHA --reporter "xunit" $DEFAULT "$@" . > $DIR/../../build/log/mocha_results.xml
|
||||||
|
$MOCHA --reporter "mocha-cobertura-reporter" $DEFAULT "$@" . > $DIR/../../build/log/mocha_coverage.xml
|
||||||
|
|
||||||
|
exit 0
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<phpunit backupGlobals="true"
|
<phpunit backupGlobals="true"
|
||||||
backupStaticAttributes="true"
|
backupStaticAttributes="true"
|
||||||
colors="false"
|
colors="false"
|
||||||
|
@ -13,10 +14,26 @@
|
||||||
strict="false"
|
strict="false"
|
||||||
verbose="false">
|
verbose="false">
|
||||||
|
|
||||||
<logging>
|
<logging>
|
||||||
<log type="coverage-clover" target="../../build/log/phpunit_coverage.xml"/>
|
<log type="coverage-clover" target="../../build/log/phpunit_coverage.xml"/>
|
||||||
<log type="junit" target="../../build/log/phpunit_results.xml" logIncompleteSkipped="true"/>
|
<log type="junit" target="../../build/log/phpunit_results.xml" logIncompleteSkipped="true"/>
|
||||||
</logging>
|
</logging>
|
||||||
|
|
||||||
</phpunit>
|
<testsuites>
|
||||||
|
<!--
|
||||||
|
Unit testing
|
||||||
|
-->
|
||||||
|
<testsuite name="unit">
|
||||||
|
<directory>application/</directory>
|
||||||
|
<directory>bin/</directory>
|
||||||
|
<directory>library/</directory>
|
||||||
|
</testsuite>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Regression testing
|
||||||
|
-->
|
||||||
|
<testsuite name="regression">
|
||||||
|
<directory>regression/</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
</phpunit>
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Icinga2-Web regression test
|
||||||
|
* (c) 2013 Icinga Development Team
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Tests\Icinga\Regression;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Bug4102
|
||||||
|
*
|
||||||
|
* Bogus regression test
|
||||||
|
*
|
||||||
|
* @see https://dev.icinga.org/issues/4102
|
||||||
|
* @package Tests\Icinga\Regression
|
||||||
|
*/
|
||||||
|
class Bug4102Test extends \PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Test class name to match definition
|
||||||
|
*/
|
||||||
|
public function testClassName()
|
||||||
|
{
|
||||||
|
$class = get_class($this);
|
||||||
|
$this->assertContains('Bug4102Test', $class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test namespace to match definition
|
||||||
|
*/
|
||||||
|
public function testNamespace()
|
||||||
|
{
|
||||||
|
$namespace = __NAMESPACE__;
|
||||||
|
$this->assertEquals('Tests\Icinga\Regression', $namespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test phpunit inheritance
|
||||||
|
*/
|
||||||
|
public function testInheritance()
|
||||||
|
{
|
||||||
|
$this->assertInstanceOf('\PHPUnit_Framework_TestCase', $this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,6 @@ mkdir -p $DIR/../../build/log
|
||||||
|
|
||||||
cd $DIR
|
cd $DIR
|
||||||
|
|
||||||
$PHPUNIT "$@" .
|
$PHPUNIT "$@"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue