From 58c6f39a70d69e8c1c6d12b0d0f2174f875d3287 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 14 Mar 2013 10:40:03 -0400 Subject: [PATCH] Hooked VuFindSearch tests into VuFind test suite. --- module/VuFind/tests/bootstrap.php | 2 ++ module/VuFind/tests/phpunit.xml | 4 ++++ module/VuFindSearch/tests/unit-tests/bootstrap.php | 2 +- .../unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php | 2 +- .../unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/module/VuFind/tests/bootstrap.php b/module/VuFind/tests/bootstrap.php index 68d51098921..22b95084eab 100644 --- a/module/VuFind/tests/bootstrap.php +++ b/module/VuFind/tests/bootstrap.php @@ -53,5 +53,7 @@ $loader = Zend\Loader\AutoloaderFactory::getRegisteredAutoloader( ); $loader->registerNamespace('VuFindTest', __DIR__ . '/../src/VuFindTest'); +define('PHPUNIT_SEARCH_FIXTURES', realpath(__DIR__ . '/../../VuFindSearch/tests/unit-tests/fixtures')); + // Use output buffering -- some tests involve HTTP headers and will fail if there is output. ob_start(); \ No newline at end of file diff --git a/module/VuFind/tests/phpunit.xml b/module/VuFind/tests/phpunit.xml index 7a7f81295df..b9d59fe1032 100644 --- a/module/VuFind/tests/phpunit.xml +++ b/module/VuFind/tests/phpunit.xml @@ -3,6 +3,9 @@ <testsuite name="VuFindHttp"> <directory>../../VuFindHttp/tests/unit-tests/src</directory> </testsuite> + <testsuite name="VuFindSearch"> + <directory>../../VuFindSearch/tests/unit-tests/src</directory> + </testsuite> <testsuite name="VuFindUnit"> <directory>unit-tests/src</directory> </testsuite> @@ -16,6 +19,7 @@ <directory suffix=".php">../src</directory> <directory suffix=".php">../../VuFindConsole/src</directory> <directory suffix=".php">../../VuFindHttp/src</directory> + <directory suffix=".php">../../VuFindSearch/src</directory> <directory suffix=".php">../../VuFindTheme/src</directory> </whitelist> </filter> diff --git a/module/VuFindSearch/tests/unit-tests/bootstrap.php b/module/VuFindSearch/tests/unit-tests/bootstrap.php index 0295fb3a5b0..b54270f3bf0 100644 --- a/module/VuFindSearch/tests/unit-tests/bootstrap.php +++ b/module/VuFindSearch/tests/unit-tests/bootstrap.php @@ -21,4 +21,4 @@ require_once('Zend/Loader/AutoloaderFactory.php'); ) ); -define('PHPUNIT_FIXTURES', realpath(__DIR__ . '/fixtures')); \ No newline at end of file +define('PHPUNIT_SEARCH_FIXTURES', realpath(__DIR__ . '/fixtures')); \ No newline at end of file diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php index 8588a04191d..e6b1bc50455 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php @@ -79,7 +79,7 @@ class BackendTest extends PHPUnit_Framework_TestCase */ protected function loadResponse ($fixture) { - $file = realpath(sprintf('%s/solr/response/%s', PHPUNIT_FIXTURES, $fixture)); + $file = realpath(sprintf('%s/solr/response/%s', PHPUNIT_SEARCH_FIXTURES, $fixture)); if (!is_string($file) || !file_exists($file) || !is_readable($file)) { throw new InvalidArgumentException(sprintf('Unable to load fixture file: %s', $file)); } diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php index bc7ca4dfba5..d7fe42c09ea 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php @@ -128,7 +128,7 @@ class ConnectorTest extends PHPUnit_Framework_TestCase */ protected function createConnector ($fixture) { - $file = realpath(sprintf('%s/solr/response/%s', PHPUNIT_FIXTURES, $fixture)); + $file = realpath(sprintf('%s/solr/response/%s', PHPUNIT_SEARCH_FIXTURES, $fixture)); if (!is_string($file) || !file_exists($file) || !is_readable($file)) { throw new InvalidArgumentException(sprintf('Unable to load fixture file: %s', $file)); } -- GitLab