Skip to content

Commit

Permalink
general, misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joonsp committed Feb 6, 2013
1 parent 152c9c7 commit 433196a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: php
php:
- 5.3
- 5.4
- 5.5

script: cd tests && phpunit

Expand Down
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
{
"name": "xi-project",
"email": "[email protected]"
},
{
"name": "Mikko Hirvonen",
"email": "[email protected]",
"role": "Developer"
},
{
"name": "Joonas Pajuen",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
Expand All @@ -19,6 +29,6 @@
"Xi\\Algorithm": "library/"
}
},
"target-dir": "Xi/Algorithmi",
"target-dir": "Xi/Algorithm",
"minimum-stability": "dev"
}
6 changes: 3 additions & 3 deletions tests/Xi/Tests/Algorithm/LuhnTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

namespace Xi\Tests\Algorithm;
namespace Xi\Algorithm\Tests;

use Xi\Algorithm\Luhn;

/**
* @group tool
* @group luhn
*/
class LuhnTest extends \PHPUnit_Framework_TestCase
Expand All @@ -19,7 +18,8 @@ class LuhnTest extends \PHPUnit_Framework_TestCase
*/
public function generatesLuhnChecksum($number, $expected)
{
$luhnedNumber = (new Luhn($number))->generate();
$luhn = new Luhn($number);
$luhnedNumber = $luhn->generate();

$this->assertInternalType('integer', $luhnedNumber);
$this->assertEquals($expected, $luhnedNumber);
Expand Down
19 changes: 1 addition & 18 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,4 @@
wget http://getcomposer.org/composer.phar
php composer.phar install --dev
");
}

gc_enable();

spl_autoload_register(function($class) {
$filename = str_replace("_", DIRECTORY_SEPARATOR, $class) . '.php';

foreach (explode(PATH_SEPARATOR, get_include_path()) as $includePath) {
if (file_exists($includePath . DIRECTORY_SEPARATOR . $filename)) {
include_once $filename;
break;
}
}

return class_exists($class, false);
});

define('ROOT_TESTS', realpath(__DIR__));
}

0 comments on commit 433196a

Please sign in to comment.