Commit 7f7f7bc5 authored by David Maus's avatar David Maus
Browse files

Relocate unit tests

parent 99acd4a9
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="tests/bootstrap.php" strict="true">
<phpunit bootstrap="tests/unit-tests/bootstrap.php" strict="true">
<testsuites>
<testsuite name="Unit Tests">
<directory suffix="Test.php">tests</directory>
......
......@@ -21,7 +21,8 @@
* @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
*/
require_once realpath(__DIR__ . '/../vendor/autoload.php');
$autoload = realpath(__DIR__ . '/../../vendor/autoload.php');
require_once($autoload);
define('PHPUNIT_FIXTURES', realpath(__DIR__ . '/fixtures'));
......
......@@ -142,7 +142,7 @@ class FieldTest extends PHPUnit_FrameWork_TestCase
/**
* @depends testGetSubfields
*/
public function testGetSubfieldsWithCode (Field $f)
public function testGetSubfieldsCodes (Field $f)
{
$this->assertEquals(5, count($f->getSubfields('x', 'x', 'x', 'x', 'x')));
$s = $f->getSubfields('d');
......@@ -154,6 +154,18 @@ class FieldTest extends PHPUnit_FrameWork_TestCase
return $f;
}
public function testGetSubfieldsWithCode ()
{
$f = new Field('003@', 0);
$f->setSubfields(array(new Subfield('a', 'first a'),
new Subfield('d', 'first d'),
new Subfield('a', 'second a')));
$this->assertEquals(2, count($f->getSubfieldsWithCode('a')));
$this->assertEquals(1, count($f->getSubfieldsWithCode('d')));
$this->assertEquals(0, count($f->getSubfieldsWithCode('x')));
}
///
public function testClone ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment