diff --git a/composer.json b/composer.json index d76eb82208fb3fe15a126e38759b51709706dce9..e2af12dbd178ae352e37f3836a1b45365e8b5389 100644 --- a/composer.json +++ b/composer.json @@ -58,6 +58,7 @@ "pear-pear.php.net/validate_ispn": "*", "serialssolutions/summon": "*", "symfony/yaml": "*", + "vufind-org/vufindcode": "*", "vufind-org/vufindhttp": "*", "zendframework/zendframework": "2.2.7", "zendframework/zendrest": "2.*", diff --git a/composer.lock b/composer.lock index e32afa327c9c52c5859456e9c296ea11df356c7b..04ef4572f9008e04546f5daceb362b22445c0972 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "9cd1fe9a339a11f246bbda40fadca844", + "hash": "828ea6c9391fbecaa3c42071bdcfe98a", "packages": [ { "name": "aferrandini/phpqrcode", @@ -557,6 +557,42 @@ "homepage": "http://symfony.com", "time": "2014-09-22 09:14:18" }, + { + "name": "vufind-org/vufindcode", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/vufind-org/vufindcode.git", + "reference": "1c6a0ad73cdf24c363f0e0564ac29ef1ba323ec0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vufind-org/vufindcode/zipball/1c6a0ad73cdf24c363f0e0564ac29ef1ba323ec0", + "reference": "1c6a0ad73cdf24c363f0e0564ac29ef1ba323ec0", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "VuFindCode\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "description": "Class for representing ISBNs (a VuFind support library)", + "time": "2014-09-17 15:48:11" + }, { "name": "vufind-org/vufindhttp", "version": "v1.0.0", diff --git a/module/VuFind/src/VuFind/Content/AbstractBase.php b/module/VuFind/src/VuFind/Content/AbstractBase.php index 552497d4dd559518c6e766e8fb912a3d9fcf2a67..055b081abdce8528d79fd501d10fcd66ea6b14d3 100644 --- a/module/VuFind/src/VuFind/Content/AbstractBase.php +++ b/module/VuFind/src/VuFind/Content/AbstractBase.php @@ -69,7 +69,7 @@ abstract class AbstractBase implements \VuFindHttp\HttpServiceAwareInterface, * Attempt to get an ISBN-10; revert to ISBN-13 only when ISBN-10 representation * is impossible. * - * @param \VuFind\Code\ISBN $isbnObj ISBN object to convert + * @param \VuFindCode\ISBN $isbnObj ISBN object to convert * * @return string */ @@ -111,9 +111,9 @@ abstract class AbstractBase implements \VuFindHttp\HttpServiceAwareInterface, * Load results for a particular API key and ISBN. * * @param string $key API key - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @return array */ - abstract public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj); + abstract public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj); } diff --git a/module/VuFind/src/VuFind/Content/AuthorNotes/Syndetics.php b/module/VuFind/src/VuFind/Content/AuthorNotes/Syndetics.php index fadc75f9c6a0065b28f02f1a2f3792aae33b3916..dbe12f8edfea230e10a21b3e06cd776b8d3f81db 100644 --- a/module/VuFind/src/VuFind/Content/AuthorNotes/Syndetics.php +++ b/module/VuFind/src/VuFind/Content/AuthorNotes/Syndetics.php @@ -50,14 +50,14 @@ class Syndetics extends \VuFind\Content\AbstractSyndetics * Configuration: Sources are processed in order - refer to $sourceList. * * @param string $key API key - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @throws \Exception * @return array Returns array with author note data. * @author Joel Timothy Norman <joel.t.norman@wmich.edu> * @author Andrew Nagy <vufind-tech@lists.sourceforge.net> */ - public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj) + public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj) { $sourceList = array( 'ANOTES' => array( diff --git a/module/VuFind/src/VuFind/Content/Excerpts/Syndetics.php b/module/VuFind/src/VuFind/Content/Excerpts/Syndetics.php index 68c677d1d3e3f2ee723ab82e78a7c65f14d25ea0..6c45eef08ebb46ad48d2d9c7a28da998d6cacbb2 100644 --- a/module/VuFind/src/VuFind/Content/Excerpts/Syndetics.php +++ b/module/VuFind/src/VuFind/Content/Excerpts/Syndetics.php @@ -49,15 +49,15 @@ class Syndetics extends \VuFind\Content\AbstractSyndetics * for more information. * Configuration: Sources are processed in order - refer to $sourceList. * - * @param string $key API key - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param string $key API key + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @throws \Exception * @return array Returns array with excerpt data. * @author Joel Timothy Norman <joel.t.norman@wmich.edu> * @author Andrew Nagy <vufind-tech@lists.sourceforge.net> */ - public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj) + public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj) { // List of syndetic excerpts $sourceList = array( diff --git a/module/VuFind/src/VuFind/Content/Loader.php b/module/VuFind/src/VuFind/Content/Loader.php index 5ff4bb0e8fe675ebc642db713daaacdbdf62b1d8..85ecbf66ce979b0fa7d7759f97de8eb7bbdbcf2c 100644 --- a/module/VuFind/src/VuFind/Content/Loader.php +++ b/module/VuFind/src/VuFind/Content/Loader.php @@ -70,13 +70,13 @@ class Loader * * @param string $isbn ISBN * - * @return \VuFind\Code\ISBN|bool + * @return \VuFindCode\ISBN|bool */ protected function getIsbnObject($isbn) { // We can't proceed without an ISBN: return (empty($isbn)) - ? false : new \VuFind\Code\ISBN($isbn); + ? false : new \VuFindCode\ISBN($isbn); } /** diff --git a/module/VuFind/src/VuFind/Content/Reviews/Amazon.php b/module/VuFind/src/VuFind/Content/Reviews/Amazon.php index 215679ddcf75a2f4a34ea183ebdd8e56bd5bd3c0..2d83066aa821f15913b6da8329927e9c11113448 100644 --- a/module/VuFind/src/VuFind/Content/Reviews/Amazon.php +++ b/module/VuFind/src/VuFind/Content/Reviews/Amazon.php @@ -44,14 +44,14 @@ class Amazon extends \VuFind\Content\AbstractAmazon * This method is responsible for connecting to Amazon AWS and abstracting * customer reviews for the specific ISBN * - * @param string $key API key - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param string $key API key + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @throws \Exception * @return array Returns array with review data. * @author Andrew Nagy <vufind-tech@lists.sourceforge.net> */ - public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj) + public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj) { // TODO: rewrite this to use ZendService\Amazon. diff --git a/module/VuFind/src/VuFind/Content/Reviews/AmazonEditorial.php b/module/VuFind/src/VuFind/Content/Reviews/AmazonEditorial.php index f43a423a5d542cd66798db170fdb24dcb63ffe44..88cbb5d95f51615b0ec270505aa618438066930c 100644 --- a/module/VuFind/src/VuFind/Content/Reviews/AmazonEditorial.php +++ b/module/VuFind/src/VuFind/Content/Reviews/AmazonEditorial.php @@ -45,14 +45,14 @@ class AmazonEditorial extends \VuFind\Content\AbstractAmazon * This method is responsible for connecting to Amazon AWS and abstracting * editorial reviews for the specific ISBN * - * @param string $key API key - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param string $key API key + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @throws \Exception * @return array Returns array with review data. * @author Andrew Nagy <vufind-tech@lists.sourceforge.net> */ - public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj) + public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj) { try { $amazon = new Amazon($key, 'US', $this->secret); diff --git a/module/VuFind/src/VuFind/Content/Reviews/Booksite.php b/module/VuFind/src/VuFind/Content/Reviews/Booksite.php index 10d828ac2c14a65dd0a48dc3a263082f935f54b9..2988f97b6aa9779f50fe00fc2156384f96e23709 100644 --- a/module/VuFind/src/VuFind/Content/Reviews/Booksite.php +++ b/module/VuFind/src/VuFind/Content/Reviews/Booksite.php @@ -69,15 +69,15 @@ class BookSite extends \VuFind\Content\AbstractBase * * Connects to Booksite's API and retrieves reviews for the specific ISBN * - * @param string $key API key (unused here) - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param string $key API key (unused here) + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @throws \Exception * @return array Returns array with review data. * @author Joe Atzberger * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj) + public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj) { $reviews = array(); // Initialize return value diff --git a/module/VuFind/src/VuFind/Content/Reviews/Guardian.php b/module/VuFind/src/VuFind/Content/Reviews/Guardian.php index 34f640aae084ad150c2c85a7a1ba9a7fa84c747c..09dc05add430e626a9fd5bf93d30acbf379cf80d 100644 --- a/module/VuFind/src/VuFind/Content/Reviews/Guardian.php +++ b/module/VuFind/src/VuFind/Content/Reviews/Guardian.php @@ -44,15 +44,15 @@ class Guardian extends \VuFind\Content\AbstractBase * This method is responsible for connecting to the Guardian and abstracting * reviews for the specific ISBN. * - * @param string $key API key (unused here) - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param string $key API key (unused here) + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @throws \Exception * @return array Returns array with review data. * @author Eoghan Ó Carragáin <eoghan.ocarragain@gmail.com> * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj) + public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj) { // Base request URL: $url diff --git a/module/VuFind/src/VuFind/Content/Reviews/Syndetics.php b/module/VuFind/src/VuFind/Content/Reviews/Syndetics.php index dfbc3dffaa49ecb80938e6e1449fd196b749d1cf..391ab9d797c7c577aede0aa134ecaaf31c2ebd44 100644 --- a/module/VuFind/src/VuFind/Content/Reviews/Syndetics.php +++ b/module/VuFind/src/VuFind/Content/Reviews/Syndetics.php @@ -52,15 +52,15 @@ class Syndetics extends \VuFind\Content\AbstractSyndetics * If your library does not like a reviewer, remove it. If there are more * syndetics reviewers add another entry. * - * @param string $key API key (unused here) - * @param \VuFind\Code\ISBN $isbnObj ISBN object + * @param string $key API key (unused here) + * @param \VuFindCode\ISBN $isbnObj ISBN object * * @throws \Exception * @return array Returns array with review data. * @author Joel Timothy Norman <joel.t.norman@wmich.edu> * @author Andrew Nagy <vufind-tech@lists.sourceforge.net> */ - public function loadByIsbn($key, \VuFind\Code\ISBN $isbnObj) + public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj) { // List of syndetic reviews $sourceList = array( diff --git a/module/VuFind/src/VuFind/Cover/Generator.php b/module/VuFind/src/VuFind/Cover/Generator.php index 7c38107ac18572981bc0cba5a9fa3dcf9a5106d7..73ec22faed5af91016d058b95232eb5839b19708 100644 --- a/module/VuFind/src/VuFind/Cover/Generator.php +++ b/module/VuFind/src/VuFind/Cover/Generator.php @@ -26,7 +26,7 @@ * @link http://vufind.org/wiki/use_of_external_content Wiki */ namespace VuFind\Cover; -use VuFind\Code\ISBN, Zend\Log\LoggerInterface, ZendService\Amazon\Amazon; +use VuFindCode\ISBN, Zend\Log\LoggerInterface, ZendService\Amazon\Amazon; /** * Dynamic Book Cover Generator diff --git a/module/VuFind/src/VuFind/Cover/Loader.php b/module/VuFind/src/VuFind/Cover/Loader.php index 05c480c3e9a4793afa954ce15917e5fe534d6b4a..f26d2aac9b004f0ec2c238b084dd3f3ebee0fd9d 100644 --- a/module/VuFind/src/VuFind/Cover/Loader.php +++ b/module/VuFind/src/VuFind/Cover/Loader.php @@ -27,8 +27,7 @@ * @link http://vufind.org/wiki/use_of_external_content Wiki */ namespace VuFind\Cover; -use VuFind\Code\ISBN, - VuFind\Content\Covers\PluginManager as ApiManager; +use VuFindCode\ISBN, VuFind\Content\Covers\PluginManager as ApiManager; /** * Book Cover Generator diff --git a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php index 1c5bf2f48f6b04e1df490f85bb4ae2179bc129c8..216ca4590d3f3cafcc97f555b7b53bcd0c0883ba 100644 --- a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php +++ b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php @@ -27,7 +27,7 @@ * @link http://vufind.org/wiki/vufind2:record_drivers Wiki */ namespace VuFind\RecordDriver; -use VuFind\Code\ISBN, VuFind\View\Helper\Root\RecordLink; +use VuFindCode\ISBN, VuFind\View\Helper\Root\RecordLink; /** * Default model for Solr records -- used when a more specific model based on diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/AmazonTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/AmazonTest.php index e0394f2aeb0dbfbf0a8a258db37ebcc3285e3350..016c65816fd9fae4c316bd916b8709d4f557ae2f 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/AmazonTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/AmazonTest.php @@ -27,7 +27,7 @@ * @link http://vufind.org */ namespace VuFindTest\Content\Covers; -use VuFind\Code\ISBN; +use VuFindCode\ISBN; /** * Unit tests for Amazon cover loader. diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/BooksiteTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/BooksiteTest.php index bf659abd09f1846e254a1687d707354de528043a..e3c4a63bef1cf76d5d2439ae239faeabc9bad778 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/BooksiteTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/BooksiteTest.php @@ -27,7 +27,7 @@ * @link http://vufind.org */ namespace VuFindTest\Content\Covers; -use VuFind\Code\ISBN, VuFind\Content\Covers\Booksite; +use VuFindCode\ISBN, VuFind\Content\Covers\Booksite; /** * Unit tests for Booksite cover loader. diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/ContentCafeTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/ContentCafeTest.php index 4a3132837cda3539f745c71015ab488134a554a7..a3f654b3ad67ce376df71b9fa3cfa861a5e3e661 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/ContentCafeTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/ContentCafeTest.php @@ -27,7 +27,7 @@ * @link http://vufind.org */ namespace VuFindTest\Content\Covers; -use VuFind\Code\ISBN, VuFind\Content\Covers\ContentCafe, Zend\Config\Config; +use VuFindCode\ISBN, VuFind\Content\Covers\ContentCafe, Zend\Config\Config; /** * Unit tests for ContentCafe cover loader. diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/LibraryThingTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/LibraryThingTest.php index 51d2c43116c3cd4ddc13f049c278aea0f8d7e07a..dab3a0b4d148269f0e345db71259876674df62f4 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/LibraryThingTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/LibraryThingTest.php @@ -27,7 +27,7 @@ * @link http://vufind.org */ namespace VuFindTest\Content\Covers; -use VuFind\Code\ISBN, VuFind\Content\Covers\LibraryThing; +use VuFindCode\ISBN, VuFind\Content\Covers\LibraryThing; /** * Unit tests for LibraryThing cover loader. diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/OpenLibraryTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/OpenLibraryTest.php index b2eaa5816d5d26d94943189c335442afa799873f..b79d57c781151af46e7e7cea864abefa744e70e3 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/OpenLibraryTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/OpenLibraryTest.php @@ -27,7 +27,7 @@ * @link http://vufind.org */ namespace VuFindTest\Content\Covers; -use VuFind\Code\ISBN, VuFind\Content\Covers\OpenLibrary; +use VuFindCode\ISBN, VuFind\Content\Covers\OpenLibrary; /** * Unit tests for OpenLibrary cover loader. diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/SummonTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/SummonTest.php index 937e7fbd9e90152b51abc7d7f803d14830022a22..68b60f648ea71b33c256ed9a6883b63a74693d94 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/SummonTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/SummonTest.php @@ -27,7 +27,7 @@ * @link http://vufind.org */ namespace VuFindTest\Content\Covers; -use VuFind\Code\ISBN, VuFind\Content\Covers\Summon; +use VuFindCode\ISBN, VuFind\Content\Covers\Summon; /** * Unit tests for Summon cover loader. diff --git a/vendor/autoload.php b/vendor/autoload.php index 5b9cf272a45388ed5e94f2b754ed798617c0b4f2..96a93059871848fa85cc423a6b084e7622aa695d 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa::getLoader(); +return ComposerAutoloaderInit4c8c308ec44674e7e5ced3a451f8d817::getLoader(); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index f32f348f63c2c979c5c476c40e9a2a02dc934341..3cf0e3872c157039454affc31b6f43b25d28157c 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -12,6 +12,7 @@ return array( 'ZendService' => array($vendorDir . '/zendframework/zendservice-recaptcha/library'), 'ZendRest' => array($vendorDir . '/zendframework/zendrest/library'), 'VuFindHttp\\' => array($vendorDir . '/vufind-org/vufindhttp/src'), + 'VuFindCode\\' => array($vendorDir . '/vufind-org/vufindcode/src'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'SerialsSolutions' => array($vendorDir . '/serialssolutions/summon'), 'ProxyManager\\' => array($vendorDir . '/ocramius/proxy-manager/src'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index e943ac1ba11b816b9937b3896a44616331b9040c..eae6b04b7b1625a0198980344aeb0be6f12db15e 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa +class ComposerAutoloaderInit4c8c308ec44674e7e5ced3a451f8d817 { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit4c8c308ec44674e7e5ced3a451f8d817', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit4c8c308ec44674e7e5ced3a451f8d817', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); @@ -48,7 +48,7 @@ class ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa } } -function composerRequire7dec02740c412b5209419ea980a0c5fa($file) +function composerRequire4c8c308ec44674e7e5ced3a451f8d817($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 6a6c74b0881c541a7d4531acd85b93fa61ee6d3c..6479f6891c7164d98a65c208d7806da10b8b1337 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -951,5 +951,43 @@ ], "description": "VuFind 2.x HTTP service library", "homepage": "http://vufind.org/" + }, + { + "name": "vufind-org/vufindcode", + "version": "v1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/vufind-org/vufindcode.git", + "reference": "1c6a0ad73cdf24c363f0e0564ac29ef1ba323ec0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vufind-org/vufindcode/zipball/1c6a0ad73cdf24c363f0e0564ac29ef1ba323ec0", + "reference": "1c6a0ad73cdf24c363f0e0564ac29ef1ba323ec0", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2014-09-17 15:48:11", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "VuFindCode\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "description": "Class for representing ISBNs (a VuFind support library)" } ] diff --git a/vendor/vufind-org/vufindcode/LICENSE b/vendor/vufind-org/vufindcode/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4eb3f1e9596a3213c1eeba7ec401ecac70ff1801 --- /dev/null +++ b/vendor/vufind-org/vufindcode/LICENSE @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/vendor/vufind-org/vufindcode/README.md b/vendor/vufind-org/vufindcode/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ce842843d9fb842a8ff204260ff27572467adf8a --- /dev/null +++ b/vendor/vufind-org/vufindcode/README.md @@ -0,0 +1,14 @@ +VuFindCode +========== + +Introduction +------------ +VuFindCode contains a simple class for dealing with ISBN codes. This is part of +the VuFind project (http://vufind.org) but may be useful for any software dealing +with books. + + +Installation +------------ +The recommended method for incorporating this library into your project is to use +Composer (http://getcomposer.org). \ No newline at end of file diff --git a/vendor/vufind-org/vufindcode/build.xml b/vendor/vufind-org/vufindcode/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..4c86ad6a3805358faeec9a4d0ba390a044c968ee --- /dev/null +++ b/vendor/vufind-org/vufindcode/build.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="vufindcode" basedir="." default="main"> + <property name="tmp" value="/tmp" /> + <property name="package" value="${phing.project.name}" override="true" /> + <property name="builddir" value="${tmp}/build/${phing.project.name}" override="true" /> + <property name="srcdir" value="${project.basedir}" override="true" /> + + <!-- Main Target --> + <target name="main" description="main target"> + <trycatch property="exceptionmsg"> + <try> + <phingcall target="ci-tasks" /> + </try> + <catch> + <phingcall target="shutdown" /> + <fail>Unexpected error during continuous integration tasks -- ${exceptionmsg}</fail> + </catch> + </trycatch> + </target> + + <!-- Continuous Integration Tasks --> + <target name="ci-tasks" description="continuous integration tasks"> + + <!-- Create dirs --> + <mkdir dir="${builddir}/reports"/> + <mkdir dir="${builddir}/reports/coverage"/> + + <!-- Call standard tasks --> + <phingcall target="phpcs"/> + <phingcall target="phpunit"/> + <phingcall target="phpdoc"/> + <phingcall target="phpcpd"/> + <phingcall target="phpmd"/> + <phingcall target="pdepend"/> + <phingcall target="phploc"/> + </target> + + <!-- Report rule violations with PHPMD (mess detector) --> + <target name="phpmd"> + <exec command="phpmd ${srcdir}/src xml ${srcdir}/tests/phpmd.xml --exclude ${srcdir}/tests --reportfile ${builddir}/reports/phpmd.xml" /> + </target> + + <!-- Measure project with phploc --> + <target name="phploc"> + <exec command="phploc --log-csv ${builddir}/reports/phploc.csv ${srcdir}/src" /> + </target> + + <!-- PHP_Depend code analysis --> + <target name="pdepend"> + <exec command="pdepend --jdepend-xml=${builddir}/reports/jdepend.xml --jdepend-chart=${builddir}/reports/dependencies.svg --overview-pyramid=${builddir}/reports/pdepend-pyramid.svg ${srcdir}/src" /> + </target> + + <!-- PHP copy-and-paste detection --> + <target name="phpcpd"> + <exec command="phpcpd --log-pmd ${builddir}/reports/pmd-cpd.xml --exclude tests ${srcdir}/src" /> + </target> + + <!-- PHP CodeSniffer --> + <target name="phpcs"> + <exec command="phpcs --standard=PEAR --ignore=tests/* --extensions=php --report=checkstyle ${srcdir}/src > ${builddir}/reports/checkstyle.xml" escape="false" /> + </target> + + <!-- PHP API Documentation --> + <target name="phpdoc"> + <mkdir dir="${builddir}/apidocs"/> + <phpdoc2 title="VuFindCode API Documentation" + destdir="${builddir}/apidocs"> + <fileset dir="."> + <include name="src/**/*.php" /> + </fileset> + </phpdoc2> + </target> + + <!-- PHPUnit --> + <target name="phpunit" description="Run tests"> + <exec dir="${srcdir}/tests" command="phpunit -dzend.enable_gc=0 --log-junit ${builddir}/reports/phpunit.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/" passthru="true" checkreturn="true" /> + </target> + + <!-- PHPUnit without logging output --> + <target name="phpunitfast" description="Run tests"> + <exec dir="${srcdir}/tests" command="phpunit -dzend.enable_gc=0" passthru="true" checkreturn="true" /> + </target> +</project> diff --git a/vendor/vufind-org/vufindcode/composer.json b/vendor/vufind-org/vufindcode/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..570be3d393bd77e9c60bc3437393e5beb902d770 --- /dev/null +++ b/vendor/vufind-org/vufindcode/composer.json @@ -0,0 +1,19 @@ +{ + "name": "vufind-org/vufindcode", + "description": "Class for representing ISBNs (a VuFind support library)", + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "autoload": { + "psr-0": { + "VuFindCode\\": "src/" + } + }, + "require": { + "php": ">=5.3.0" + }, + "license": "GPL-2.0" +} \ No newline at end of file diff --git a/vendor/vufind-org/vufindcode/phpmd.xml b/vendor/vufind-org/vufindcode/phpmd.xml new file mode 100644 index 0000000000000000000000000000000000000000..c55950cf1813c575971e57039e4bf62e1968c094 --- /dev/null +++ b/vendor/vufind-org/vufindcode/phpmd.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<ruleset name="PHPMD rules for VuFind" xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd"> + <description>PHPMD rules for VuFind</description> + <rule ref="rulesets/codesize.xml" /> + <!-- <rule ref="rulesets/controversial.xml" /> --> + <rule ref="rulesets/design.xml"> + <exclude name="EvalExpression" /> + </rule> + <rule ref="rulesets/naming.xml"> + <exclude name="LongVariable" /> + <exclude name="ShortVariable" /> + <exclude name="ShortMethodName" /> + </rule> + <rule ref="rulesets/unusedcode.xml" /> +</ruleset> diff --git a/module/VuFind/src/VuFind/Code/ISBN.php b/vendor/vufind-org/vufindcode/src/VuFindCode/ISBN.php similarity index 86% rename from module/VuFind/src/VuFind/Code/ISBN.php rename to vendor/vufind-org/vufindcode/src/VuFindCode/ISBN.php index 43ca7b24597fe84b0a35779e2d482743585fc977..a09f6466db6026498d989c73c24123cffdf3de0b 100644 --- a/module/VuFind/src/VuFind/Code/ISBN.php +++ b/vendor/vufind-org/vufindcode/src/VuFindCode/ISBN.php @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link http://www.vufind.org Main Page */ -namespace VuFind\Code; +namespace VuFindCode; /** * ISBN Class @@ -97,20 +97,17 @@ class ISBN */ public function get13() { - // Is it valid? - if ($this->isValid()) { - // Is it already an ISBN-13? If so, return as-is. - if (strlen($this->raw) == 13) { - return $this->raw; - } else if (strlen($this->raw) == 10) { - // Is it an ISBN-10? If so, convert to Bookland EAN: - $start = '978' . substr($this->raw, 0, 9); - return $start . self::getISBN13CheckDigit($start); - } + // Is it invalid? + if (!$this->isValid()) { + return false; } - - // If we made it this far, conversion was not possible: - return false; + // Is it an ISBN-10? If so, convert to Bookland EAN: + if (strlen($this->raw) == 10) { + $start = '978' . substr($this->raw, 0, 9); + return $start . self::getISBN13CheckDigit($start); + } + // If we made it this far, it must already be an ISBN-13; return as-is. + return $this->raw; } /** @@ -121,14 +118,9 @@ class ISBN public function isValid() { // If we haven't already checked validity, do so now and store the result: - if (is_null($this->valid)) { - if (self::isValidISBN10($this->raw) - || self::isValidISBN13($this->raw) - ) { - $this->valid = true; - } else { - $this->valid = false; - } + if (null === $this->valid) { + $this->valid = self::isValidISBN10($this->raw) + || self::isValidISBN13($this->raw); } return $this->valid; } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Code/ISBNTest.php b/vendor/vufind-org/vufindcode/tests/ISBNTest.php similarity index 77% rename from module/VuFind/tests/unit-tests/src/VuFindTest/Code/ISBNTest.php rename to vendor/vufind-org/vufindcode/tests/ISBNTest.php index 22d0c3c56798cfa9197ffd26d3f8215c690db607..7f46db50cd18e0f22b52a1ba1408f057feb59f16 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Code/ISBNTest.php +++ b/vendor/vufind-org/vufindcode/tests/ISBNTest.php @@ -25,8 +25,8 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link http://vufind.org/wiki/vufind2:unit_tests Wiki */ -namespace VuFindTest\Code; -use VuFind\Code\ISBN; +use VuFindCode\ISBN; +require_once __DIR__ . '/../src/VuFindCode/ISBN.php'; /** * ISBN Test Class @@ -38,7 +38,7 @@ use VuFind\Code\ISBN; * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link http://vufind.org/wiki/vufind2:unit_tests Wiki */ -class ISBNTest extends \VuFindTest\Unit\TestCase +class ISBNTest extends \PHPUnit_Framework_TestCase { /** * Test Valid ISBN-10. @@ -48,8 +48,8 @@ class ISBNTest extends \VuFindTest\Unit\TestCase public function testValidISBN10() { $isbn = new ISBN('0123456789'); - $this->assertEquals($isbn->get10(), '0123456789'); - $this->assertEquals($isbn->get13(), '9780123456786'); + $this->assertEquals('0123456789', $isbn->get10()); + $this->assertEquals('9780123456786', $isbn->get13()); $this->assertTrue($isbn->isValid()); } @@ -61,8 +61,8 @@ class ISBNTest extends \VuFindTest\Unit\TestCase public function testValidISBN13() { $isbn = new ISBN('9780123456786'); - $this->assertEquals($isbn->get10(), '0123456789'); - $this->assertEquals($isbn->get13(), '9780123456786'); + $this->assertEquals('0123456789', $isbn->get10()); + $this->assertEquals('9780123456786', $isbn->get13()); $this->assertTrue($isbn->isValid()); } @@ -74,8 +74,8 @@ class ISBNTest extends \VuFindTest\Unit\TestCase public function testValidISBN10WithDashes() { $isbn = new ISBN('0-12-345678-9'); - $this->assertEquals($isbn->get10(), '0123456789'); - $this->assertEquals($isbn->get13(), '9780123456786'); + $this->assertEquals('0123456789', $isbn->get10()); + $this->assertEquals('9780123456786', $isbn->get13()); $this->assertTrue($isbn->isValid()); } @@ -88,8 +88,8 @@ class ISBNTest extends \VuFindTest\Unit\TestCase { // Valid ISBN-13 with dashes: $isbn = new ISBN('978-0-12-345678-6'); - $this->assertEquals($isbn->get10(), '0123456789'); - $this->assertEquals($isbn->get13(), '9780123456786'); + $this->assertEquals('0123456789', $isbn->get10()); + $this->assertEquals('9780123456786', $isbn->get13()); $this->assertTrue($isbn->isValid()); } @@ -102,8 +102,8 @@ class ISBNTest extends \VuFindTest\Unit\TestCase { // Valid ISBN-13 outside of Bookland EAN: $isbn = new ISBN('9790123456785'); - $this->assertEquals($isbn->get10(), false); - $this->assertEquals($isbn->get13(), '9790123456785'); + $this->assertFalse($isbn->get10()); + $this->assertEquals('9790123456785', $isbn->get13()); $this->assertTrue($isbn->isValid()); } @@ -116,8 +116,8 @@ class ISBNTest extends \VuFindTest\Unit\TestCase { // Invalid ISBN-10: $isbn = new ISBN('2314346323'); - $this->assertEquals($isbn->get10(), false); - $this->assertEquals($isbn->get13(), false); + $this->assertFalse($isbn->get10()); + $this->assertFalse($isbn->get13()); $this->assertFalse($isbn->isValid()); } } \ No newline at end of file diff --git a/vendor/vufind-org/vufindcode/tests/phpunit.xml b/vendor/vufind-org/vufindcode/tests/phpunit.xml new file mode 100644 index 0000000000000000000000000000000000000000..be9004d516031eb316857b56d3b1f4539f3c5a16 --- /dev/null +++ b/vendor/vufind-org/vufindcode/tests/phpunit.xml @@ -0,0 +1,13 @@ +<phpunit backupGlobals="false"> + <testsuites> + <testsuite name="AllUnitTests"> + <directory>.</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist addUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">../src/VuFindCode</directory> + </whitelist> + </filter> +</phpunit>