Skip to content

Commit

Permalink
Merge pull request #10 from shouze/atoum/Adopt2.0
Browse files Browse the repository at this point in the history
Adopt atoum 2.0 & add php versions to ci matrix.
  • Loading branch information
shouze committed Dec 15, 2015
2 parents 4d00a66 + c2f35fc commit 650dded
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .atoum.bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
require_once __DIR__.'/vendor/autoload.php';
12 changes: 12 additions & 0 deletions .atoum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
use \mageekguy\atoum;

$runner->addTestsFromDirectory(__DIR__.'/tests/units');

$script
->addDefaultReport()
->addField(new atoum\report\fields\runner\result\logo())
;

$script->noCodeCoverageForNamespaces('mageekguy');
$script->bootstrapFile(__DIR__ . DIRECTORY_SEPARATOR . '.atoum.bootstrap.php');
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
language: php

dist: trusty
sudo: false

php:
- 5.3
- 5.4
- 5.6
- 7.0

before_script:
- curl -s http://getcomposer.org/installer | php
- COMPOSER_ROOT_VERSION=dev-master php composer.phar install --dev
- composer install --optimize-autoloader --prefer-dist

script:
- bin/atoum -d tests/units
- bin/atoum -ulr

notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"hoa/math" : "~0.1"
},
"require-dev": {
"atoum/atoum": "dev-master"
"atoum/atoum": "~2.0"
},
"autoload": {
"psr-0": {
Expand Down
6 changes: 3 additions & 3 deletions tests/units/Rezzza/Formulate/Formula.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ public function testNotCalculable()
$formula->setSubFormula('sf', new FormulaModel('3*10', true));
$formula->setSubFormula('sf2', new FormulaModel('10-{{sf3}}', false));

$this->string($formula->render())
$this->phpString($formula->render())
->isEqualTo('2 + 1 + 30 - 10-{{sf3}}');

$formula->setSubFormula('sf3', new FormulaModel('5-3', true));
$formula->getSubFormula('sf2')->setIsCalculable(true);

$this->string($formula->render())
$this->phpString($formula->render())
->isEqualTo('2 + 1 + 30 - 2');

$formula->setIsCalculable(true);

$this->string($formula->render())
$this->phpString($formula->render())
->isEqualTo('31');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testPrepare()

$this->getRendererMock()->prepare($formula);

$this->string($formula)
$this->phpString($formula)
->isEqualTo('{{var}} {{var}} {{var}}');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testSimple()
$renderer = new StrtrFormulaRendererModel();
$formula = new Formula('formula');

$this->string($renderer->render($formula, $formula->parse()))
$this->phpString($renderer->render($formula, $formula->parse()))
->isEqualTo('formula');
}

Expand All @@ -34,7 +34,7 @@ public function testOneLevel()

$renderer = new StrtrFormulaRendererModel();

$this->string($renderer->render($formula, $formula->parse()))
$this->phpString($renderer->render($formula, $formula->parse()))
->isEqualTo('VIC key MCKEY VIC {{anotherone}}');
}

Expand All @@ -51,7 +51,7 @@ public function testMultiLevel()

$renderer = new StrtrFormulaRendererModel();

$this->string($renderer->render($formula, $formula->parse()))
$this->phpString($renderer->render($formula, $formula->parse()))
->isEqualTo('VIC key valuesf2 VIC and valuesf3 valuesf2 {{anotherone}}');
}
}

0 comments on commit 650dded

Please sign in to comment.