diff --git a/composer.json b/composer.json index 901e0fb..04e1806 100644 --- a/composer.json +++ b/composer.json @@ -37,6 +37,8 @@ }, "scripts": { "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump", - "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess" + "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess", + "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup", + "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup" } } diff --git a/core/lib/Drupal/Core/Composer/Composer.php b/core/lib/Drupal/Core/Composer/Composer.php index 12164c3..cfe2d47 100644 --- a/core/lib/Drupal/Core/Composer/Composer.php +++ b/core/lib/Drupal/Core/Composer/Composer.php @@ -9,6 +9,7 @@ use Drupal\Component\PhpStorage\FileStorage; use Composer\Script\Event; +use Composer\Installer\PackageEvent; /** * Provides static functions for composer script events. @@ -17,6 +18,55 @@ */ class Composer { + protected static $packageToCleanup = [ + 'behat/mink' => ['tests', 'driver-testsuite'], + 'behat/mink-browserkit-driver' => ['tests'], + 'behat/mink-goutte-driver' => ['tests'], + 'doctrine/cache' => ['tests'], + 'doctrine/collections' => ['tests'], + 'doctrine/common' => ['tests'], + 'doctrine/inflector' => ['tests'], + 'doctrine/instantiator' => ['tests'], + 'egulias/email-validator' => ['documentation', 'tests'], + 'fabpot/goutte' => ['Goutte/Tests'], + 'guzzlehttp/promises' => ['tests'], + 'guzzlehttp/psr7' => ['tests'], + 'masterminds/html5' => ['test'], + 'mikey179/vfsStream' => ['src/test'], + 'phpdocumentor/reflection-docblock' => ['tests'], + 'phpunit/php-code-coverage' => ['tests'], + 'phpunit/php-timer' => ['tests'], + 'phpunit/php-token-stream' => ['tests'], + 'phpunit/phpunit' => ['tests'], + 'phpunit/php-mock-objects' => ['tests'], + 'sebastian/comparator' => ['tests'], + 'sebastian/diff' => ['tests'], + 'sebastian/environment' => ['tests'], + 'sebastian/exporter' => ['tests'], + 'sebastian/global-state' => ['tests'], + 'sebastian/recursion-context' => ['tests'], + 'stack/builder' => ['tests'], + 'symfony/browser-kit' => ['Tests'], + 'symfony/class-loader' => ['Tests'], + 'symfony/console' => ['Tests'], + 'symfony/css-selector' => ['Tests'], + 'symfony/debug' => ['Tests'], + 'symfony/dependency-injection' => ['Tests'], + 'symfony/dom-crawler' => ['Tests'], + 'symfony/event-dispatcher' => ['Tests'], + 'symfony/http-foundation' => ['Tests'], + 'symfony/http-kernel' => ['Tests'], + 'symfony/process' => ['Tests'], + 'symfony/psr-http-message-bridge' => ['Tests'], + 'symfony/routing' => ['Tests'], + 'symfony/serializer' => ['Tests'], + 'symfony/translation' => ['Tests'], + 'symfony/validator' => ['Tests'], + 'symfony/yaml' => ['Tests'], + 'symfony-cmf/routing' => ['Test', 'Tests'], + 'twig/twig' => ['doc', 'ext', 'test'], + ]; + /** * Add vendor classes to composers static classmap. */ @@ -70,4 +120,90 @@ public static function ensureHtaccess(Event $event) { } } + /** + * Remove possibly problematic test files from vendored projects. + * + * @param \Composer\Script\Event $event + */ + public static function vendorTestCodeCleanup(PackageEvent $event) { + $vendor_dir = $event->getComposer()->getConfig()->get('vendor-dir'); + $op = $event->getOperation(); + if ($op->getJobType() == 'update') { + $package = $op->getTargetPackage(); + } + else { + $package = $op->getPackage(); + } + $package_key = static::findPackageKey($package->getName()); + if ($package_key) { + foreach (static::$packageToCleanup[$package_key] as $path) { + $dir_to_remove = $vendor_dir . '/' . $package_key . '/' . $path; + if (is_dir($dir_to_remove)) { + if (!static::deleteRecursive($dir_to_remove)) { + throw new \RuntimeException(sprintf("Failure removing directory '%s' in package '%s'.", $path, $package->getPrettyName())); + } + } + else { + throw new \RuntimeException(sprintf("The directory '%s' in package '%s' does not exist.", $path, $package->getPrettyName())); + } + } + } + } + + /** + * Find the array key for a given package name with a case-insensitive search. + * + * @param string $package_name + * The package name from composer. This is always already lower case. + * + * @return NULL|string + * The string key, or NULL if none was found. + */ + protected static function findPackageKey($package_name) { + $package_key = NULL; + // In most cases the package name is already used as the array key. + if (isset(static::$packageToCleanup[$package_name])) { + $package_key = $package_name; + } + else { + // Handle any mismatch in case between the package name and array key. + // For example, the array key 'mikey179/vfsStream' needs to be found + // when composer returns a package name of 'mikey179/vfsstream'. + foreach (static::$packageToCleanup as $key => $dirs) { + if (strtolower($key) === $package_name) { + $package_key = $key; + break; + } + } + } + return $package_key; + } + + /** + * Helper method to remove directories and the files they contain. + * + * @param string $path + * The directory or file to remove. It must exist. + * + * @return bool + * TRUE on success or FALSE on failure. + */ + protected static function deleteRecursive($path) { + if (is_file($path) || is_link($path)) { + return unlink($path); + } + $success = TRUE; + $dir = dir($path); + while (($entry = $dir->read()) !== FALSE) { + if ($entry == '.' || $entry == '..') { + continue; + } + $entry_path = $path . '/' . $entry; + $success = static::deleteRecursive($entry_path) && $success; + } + $dir->close(); + + return rmdir($path) && $success; + } + } diff --git a/vendor/behat/mink-browserkit-driver/README.md b/vendor/behat/mink-browserkit-driver/README.md old mode 100755 new mode 100644 diff --git a/vendor/behat/mink-browserkit-driver/tests/BrowserKitConfig.php b/vendor/behat/mink-browserkit-driver/tests/BrowserKitConfig.php deleted file mode 100644 index b80a2fb..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/BrowserKitConfig.php +++ /dev/null @@ -1,37 +0,0 @@ -visit('http://localhost/foo/index.html'); - $this->assertEquals(200, $session->getStatusCode()); - $this->assertEquals('http://localhost/foo/index.html', $session->getCurrentUrl()); - } -} diff --git a/vendor/behat/mink-browserkit-driver/tests/Custom/ErrorHandlingTest.php b/vendor/behat/mink-browserkit-driver/tests/Custom/ErrorHandlingTest.php deleted file mode 100644 index 9e2643c..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/Custom/ErrorHandlingTest.php +++ /dev/null @@ -1,181 +0,0 @@ -client = new TestClient(); - } - - public function testGetClient() - { - $this->assertSame($this->client, $this->getDriver()->getClient()); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Unable to access the response before visiting a page - */ - public function testGetResponseHeaderWithoutVisit() - { - $this->getDriver()->getResponseHeaders(); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Unable to access the response content before visiting a page - */ - public function testFindWithoutVisit() - { - $this->getDriver()->find('//html'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Unable to access the request before visiting a page - */ - public function testGetCurrentUrlWithoutVisit() - { - $this->getDriver()->getCurrentUrl(); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage The selected node has an invalid form attribute (foo) - */ - public function testNotMatchingHtml5FormId() - { - $html = <<<'HTML' - - -
- - -
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->setValue('//input[./@name="test"]', 'bar'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage The selected node has an invalid form attribute (foo) - */ - public function testInvalidHtml5FormId() - { - $html = <<<'HTML' - - -
- - -
-
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->setValue('//input[./@name="test"]', 'bar'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage The selected node does not have a form ancestor. - */ - public function testManipulateInputWithoutForm() - { - $html = <<<'HTML' - - -
- -
-
- -
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->setValue('//input[./@name="test"]', 'bar'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Behat\Mink\Driver\BrowserKitDriver supports clicking on links and submit or reset buttons only. But "div" provided - */ - public function testClickOnUnsupportedElement() - { - $html = <<<'HTML' - - -
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->click('//div'); - } - - private function getDriver() - { - return new BrowserKitDriver($this->client); - } -} - -class TestClient extends Client -{ - protected $nextResponse = null; - protected $nextScript = null; - - public function setNextResponse(Response $response) - { - $this->nextResponse = $response; - } - - public function setNextScript($script) - { - $this->nextScript = $script; - } - - protected function doRequest($request) - { - if (null === $this->nextResponse) { - return new Response(); - } - - $response = $this->nextResponse; - $this->nextResponse = null; - - return $response; - } -} diff --git a/vendor/behat/mink-browserkit-driver/tests/app.php b/vendor/behat/mink-browserkit-driver/tests/app.php deleted file mode 100644 index d3f1236..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/app.php +++ /dev/null @@ -1,37 +0,0 @@ -register(new \Silex\Provider\SessionServiceProvider()); - -$def = realpath(__DIR__.'/../vendor/behat/mink/driver-testsuite/web-fixtures'); -$ovr = realpath(__DIR__.'/web-fixtures'); -$cbk = function ($file) use ($app, $def, $ovr) { - $file = str_replace('.file', '.php', $file); - $path = file_exists($ovr.'/'.$file) ? $ovr.'/'.$file : $def.'/'.$file; - $resp = null; - - ob_start(); - include($path); - $content = ob_get_clean(); - - if ($resp) { - if ('' === $resp->getContent()) { - $resp->setContent($content); - } - - return $resp; - } - - return $content; -}; - -$app->get('/{file}', $cbk)->assert('file', '.*'); -$app->post('/{file}', $cbk)->assert('file', '.*'); - -$app['debug'] = true; -$app['exception_handler']->disable(); -$app['session.test'] = true; - -return $app; diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/404.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/404.php deleted file mode 100644 index 2ae1ff9..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/404.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - Advanced form save - - - -request->all(); -$FILES = $request->files->all(); - -if (isset($POST['select_multiple_numbers']) && false !== strpos($POST['select_multiple_numbers'][0], ',')) { - $POST['select_multiple_numbers'] = explode(',', $POST['select_multiple_numbers'][0]); -} - -// checkbox can have any value and will be successful in case "on" -// http://www.w3.org/TR/html401/interact/forms.html#checkbox -$POST['agreement'] = isset($POST['agreement']) ? 'on' : 'off'; -ksort($POST); -echo str_replace('>', '', var_export($POST, true)) . "\n"; -if (isset($FILES['about']) && file_exists($FILES['about']->getPathname())) { - echo $FILES['about']->getClientOriginalName() . "\n"; - echo file_get_contents($FILES['about']->getPathname()); -} else { - echo "no file"; -} -?> - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_auth.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_auth.php deleted file mode 100644 index 48132b6..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_auth.php +++ /dev/null @@ -1,15 +0,0 @@ -server->all(); - -$username = isset($SERVER['PHP_AUTH_USER']) ? $SERVER['PHP_AUTH_USER'] : false; -$password = isset($SERVER['PHP_AUTH_PW']) ? $SERVER['PHP_AUTH_PW'] : false; - -if ($username == 'mink-user' && $password == 'mink-password') { - echo 'is authenticated'; -} else { - $resp = new \Symfony\Component\HttpFoundation\Response(); - $resp->setStatusCode(401); - $resp->headers->set('WWW-Authenticate', 'Basic realm="Mink Testing Area"'); - - echo 'is not authenticated'; -} diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_form_post.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_form_post.php deleted file mode 100644 index 1efe45e..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_form_post.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Basic Form Saving - - - -

Anket for request->get('first_name') ?>

- - Firstname: request->get('first_name') ?> - Lastname: request->get('last_name') ?> - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_get_form.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_get_form.php deleted file mode 100644 index fd2817d..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_get_form.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - Basic Get Form - - - -

Basic Get Form Page

- -
- query->all(); - echo isset($GET['q']) && $GET['q'] ? $GET['q'] : 'No search query' - ?> -
- -
- - - -
- - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page1.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page1.php deleted file mode 100644 index a928b2f..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page1.php +++ /dev/null @@ -1,17 +0,0 @@ -headers->setCookie($cook); -?> - - - - basic form - - - - - basic page with cookie set from server side - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page2.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page2.php deleted file mode 100644 index ab54243..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page2.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - Basic Form - - - - - Previous cookie: cookies->has('srvr_cookie') ? $app['request']->cookies->get('srvr_cookie') : 'NO'; - ?> - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page3.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page3.php deleted file mode 100644 index f24d587..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page3.php +++ /dev/null @@ -1,20 +0,0 @@ -cookies->has('foo'); -$resp = new Symfony\Component\HttpFoundation\Response(); -$cook = new Symfony\Component\HttpFoundation\Cookie('foo', 'bar'); -$resp->headers->setCookie($cook); - -?> - - - - HttpOnly Cookie Test - - - - - - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/headers.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/headers.php deleted file mode 100644 index b829425..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/headers.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Headers page - - - - server->all()); ?> - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue130.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue130.php deleted file mode 100644 index 2079673..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue130.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - query->get('p')) { - echo 'Go to 2'; - } else { - echo ''.$app['request']->headers->get('referer').''; - } - ?> - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue140.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue140.php deleted file mode 100644 index 42d8437..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue140.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -isMethod('POST')) { - $resp = new Symfony\Component\HttpFoundation\Response(); - $cook = new Symfony\Component\HttpFoundation\Cookie('tc', $app['request']->request->get('cookie_value')); - $resp->headers->setCookie($cook); -} elseif ($app['request']->query->has('show_value')) { - echo $app['request']->cookies->get('tc'); - return; -} -?> -
- - -
- diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/print_cookies.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/print_cookies.php deleted file mode 100644 index ac6f078..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/print_cookies.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - Cookies page - - - - cookies->all(); - unset($cookies['MOCKSESSID']); - - if (isset($cookies['srvr_cookie'])) { - $srvrCookie = $cookies['srvr_cookie']; - unset($cookies['srvr_cookie']); - $cookies['_SESS'] = ''; - $cookies['srvr_cookie'] = $srvrCookie; - } - - foreach ($cookies as $name => $val) { - $cookies[$name] = (string)$val; - } - echo str_replace(array('>'), '', var_export($cookies, true)); - ?> - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/redirector.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/redirector.php deleted file mode 100644 index 39e8a53..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/redirector.php +++ /dev/null @@ -1,3 +0,0 @@ -headers->set('X-Mink-Test', 'response-headers'); -?> - - - - Response headers - - - -

Response headers

- - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/session_test.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/session_test.php deleted file mode 100644 index 58576e3..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/session_test.php +++ /dev/null @@ -1,19 +0,0 @@ -getSession(); - -if ($app['request']->query->has('login')) { - $session->migrate(); -} -?> - - - - Session Test - - - - -
getId() ?>
- - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page1.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page1.php deleted file mode 100644 index 807c23e..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page1.php +++ /dev/null @@ -1,18 +0,0 @@ -server->get('REQUEST_URI'); - $resp = new Symfony\Component\HttpFoundation\Response(); - $cook = new Symfony\Component\HttpFoundation\Cookie('srvr_cookie', 'srv_var_is_set_sub_folder', 0, dirname($requestUri)); - $resp->headers->setCookie($cook); -?> - - - - basic form - - - - - basic page with cookie set from server side - - diff --git a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page2.php b/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page2.php deleted file mode 100644 index 22a7dab..0000000 --- a/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page2.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - Basic Form - - - - - Previous cookie: cookies->has('srvr_cookie')) { - echo $app['request']->cookies->get('srvr_cookie'); - } else { - echo 'NO'; - } - ?> - - diff --git a/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php b/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php deleted file mode 100644 index db75a18..0000000 --- a/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php +++ /dev/null @@ -1,27 +0,0 @@ -getMockBuilder('Goutte\Client')->disableOriginalConstructor()->getMock(); - $client->expects($this->once()) - ->method('followRedirects') - ->with(true); - - $driver = new GoutteDriver($client); - - $this->assertSame($client, $driver->getClient()); - } - - public function testInstantiateWithoutClient() - { - $driver = new GoutteDriver(); - - $this->assertInstanceOf('Behat\Mink\Driver\Goutte\Client', $driver->getClient()); - } -} diff --git a/vendor/behat/mink-goutte-driver/tests/GoutteConfig.php b/vendor/behat/mink-goutte-driver/tests/GoutteConfig.php deleted file mode 100644 index bbe90f7..0000000 --- a/vendor/behat/mink-goutte-driver/tests/GoutteConfig.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - vendor/behat/mink/driver-testsuite/tests - - - - ./tests/ - - - - - - ./src - - - -``` - -Then create the driver config for the testsuite: - -```php -// tests/Config.php - -namespace Acme\MyDriver\Tests; - -use Behat\Mink\Tests\Driver\AbstractConfig; - -class Config extends AbstractConfig -{ - /** - * Creates an instance of the config. - * - * This is the callable registered as a php variable in the phpunit.xml config file. - * It could be outside the class but this is convenient. - */ - public static function getInstance() - { - return new self(); - } - - /** - * Creates driver instance. - * - * @return \Behat\Mink\Driver\DriverInterface - */ - public function createDriver() - { - return new \Acme\MyDriver\MyDriver(); - } -} -``` - -Some other methods are available in the AbstractConfig which can be overwritten to adapt the testsuite to -the needs of the driver (skipping some tests for instance). - -Adding Driver-specific Tests ----------------------------- - -When adding extra test cases specific to the driver, either use your own namespace or put them in the -``Behat\Mink\Tests\Driver\Custom`` subnamespace to ensure that you will not create conflicts with test cases -added in the driver testsuite in the future. diff --git a/vendor/behat/mink/driver-testsuite/bootstrap.php b/vendor/behat/mink/driver-testsuite/bootstrap.php deleted file mode 100644 index f69a45b..0000000 --- a/vendor/behat/mink/driver-testsuite/bootstrap.php +++ /dev/null @@ -1,28 +0,0 @@ -addPsr4('Behat\Mink\Tests\Driver\\', __DIR__.'/tests'); - -// Clean the global variables -unset($file); -unset($loader); - -// Check the definition of the driverLoaderFactory - -if (!isset($GLOBALS['driver_config_factory'])) { - echo PHP_EOL.'The "driver_config_factory" global variable must be set.'.PHP_EOL; - exit(1); -} -if (!is_callable($GLOBALS['driver_config_factory'])) { - echo PHP_EOL.'The "driver_config_factory" global variable must be a callable.'.PHP_EOL; - exit(1); -} diff --git a/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php b/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php deleted file mode 100644 index 057e6fd..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php +++ /dev/null @@ -1,83 +0,0 @@ -supportsCss() && 0 === strpos($testCase, 'Behat\Mink\Tests\Driver\Css\\')) { - return 'This driver does not support CSS.'; - } - - if (!$this->supportsJs() && 0 === strpos($testCase, 'Behat\Mink\Tests\Driver\Js\\')) { - return 'This driver does not support JavaScript.'; - } - - return null; - } - - /** - * Whether the JS tests should run or no. - * - * @return bool - */ - protected function supportsJs() - { - return true; - } - - /** - * Whether the CSS tests should run or no. - * - * @return bool - */ - protected function supportsCss() - { - return false; - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php deleted file mode 100644 index 40d932d..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php +++ /dev/null @@ -1,64 +0,0 @@ -getSession(); - - $session->setBasicAuth($user, $pass); - - $session->visit($this->pathTo('/basic_auth.php')); - - $this->assertContains($pageText, $session->getPage()->getContent()); - } - - public function setBasicAuthDataProvider() - { - return array( - array('mink-user', 'mink-password', 'is authenticated'), - array('', '', 'is not authenticated'), - ); - } - - public function testResetBasicAuth() - { - $session = $this->getSession(); - - $session->setBasicAuth('mink-user', 'mink-password'); - - $session->visit($this->pathTo('/basic_auth.php')); - - $this->assertContains('is authenticated', $session->getPage()->getContent()); - - $session->setBasicAuth(false); - - $session->visit($this->pathTo('/headers.php')); - - $this->assertNotContains('PHP_AUTH_USER', $session->getPage()->getContent()); - } - - public function testResetWithBasicAuth() - { - $session = $this->getSession(); - - $session->setBasicAuth('mink-user', 'mink-password'); - - $session->visit($this->pathTo('/basic_auth.php')); - - $this->assertContains('is authenticated', $session->getPage()->getContent()); - - $session->reset(); - - $session->visit($this->pathTo('/headers.php')); - - $this->assertNotContains('PHP_AUTH_USER', $session->getPage()->getContent()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/BestPracticesTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/BestPracticesTest.php deleted file mode 100644 index d6cda7d..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/BestPracticesTest.php +++ /dev/null @@ -1,84 +0,0 @@ -createDriver(); - - $this->assertInstanceOf('Behat\Mink\Driver\CoreDriver', $driver); - - return $driver; - } - - /** - * @depends testExtendsCoreDriver - */ - public function testImplementFindXpath() - { - $driver = $this->createDriver(); - - $this->assertNotImplementMethod('find', $driver, 'The driver should overwrite `findElementXpaths` rather than `find` for forward compatibility with Mink 2.'); - $this->assertImplementMethod('findElementXpaths', $driver, 'The driver must be able to find elements.'); - $this->assertNotImplementMethod('setSession', $driver, 'The driver should not deal with the Session directly for forward compatibility with Mink 2.'); - } - - /** - * @dataProvider provideRequiredMethods - */ - public function testImplementBasicApi($method) - { - $driver = $this->createDriver(); - - $this->assertImplementMethod($method, $driver, 'The driver is unusable when this method is not implemented.'); - } - - public function provideRequiredMethods() - { - return array( - array('start'), - array('isStarted'), - array('stop'), - array('reset'), - array('visit'), - array('getCurrentUrl'), - array('getContent'), - array('click'), - ); - } - - private function assertImplementMethod($method, $object, $reason = '') - { - $ref = new \ReflectionClass(get_class($object)); - $refMethod = $ref->getMethod($method); - - $message = sprintf('The driver should implement the `%s` method.', $method); - - if ('' !== $reason) { - $message .= ' '.$reason; - } - - $this->assertSame($ref->name, $refMethod->getDeclaringClass()->name, $message); - } - - private function assertNotImplementMethod($method, $object, $reason = '') - { - $ref = new \ReflectionClass(get_class($object)); - $refMethod = $ref->getMethod($method); - - $message = sprintf('The driver should not implement the `%s` method.', $method); - - if ('' !== $reason) { - $message .= ' '.$reason; - } - - $this->assertNotSame($ref->name, $refMethod->getDeclaringClass()->name, $message); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php deleted file mode 100644 index fdd0ffa..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php +++ /dev/null @@ -1,86 +0,0 @@ -getSession()->visit($this->pathTo('/index.html')); - - $element = $this->getAssertSession()->elementExists('css', '.travers'); - - $this->assertEquals( - "
\n
el1
\n". - "
el2
\n
\n". - " some deep url\n". - "
\n
", - $element->getOuterHtml() - ); - } - - public function testDumpingEmptyElements() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $element = $this->getAssertSession()->elementExists('css', '#empty'); - - $this->assertEquals( - 'An empty tag should be rendered with both open and close tags.', - trim($element->getHtml()) - ); - } - - /** - * @dataProvider getAttributeDataProvider - */ - public function testGetAttribute($attributeName, $attributeValue) - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $element = $this->getSession()->getPage()->findById('attr-elem['.$attributeName.']'); - - $this->assertNotNull($element); - $this->assertSame($attributeValue, $element->getAttribute($attributeName)); - } - - public function getAttributeDataProvider() - { - return array( - array('with-value', 'some-value'), - array('without-value', ''), - array('with-empty-value', ''), - array('with-missing', null), - ); - } - - public function testJson() - { - $this->getSession()->visit($this->pathTo('/json.php')); - $this->assertContains( - '{"key1":"val1","key2":234,"key3":[1,2,3]}', - $this->getSession()->getPage()->getContent() - ); - } - - public function testHtmlDecodingNotPerformed() - { - $session = $this->getSession(); - $webAssert = $this->getAssertSession(); - $session->visit($this->pathTo('/html_decoding.html')); - $page = $session->getPage(); - - $span = $webAssert->elementExists('css', 'span'); - $input = $webAssert->elementExists('css', 'input'); - - $expectedHtml = 'some text'; - $this->assertContains($expectedHtml, $page->getHtml(), '.innerHTML is returned as-is'); - $this->assertContains($expectedHtml, $page->getContent(), '.outerHTML is returned as-is'); - - $this->assertEquals('&', $span->getAttribute('custom-attr'), '.getAttribute value is decoded'); - $this->assertEquals('&', $input->getAttribute('value'), '.getAttribute value is decoded'); - $this->assertEquals('&', $input->getValue(), 'node value is decoded'); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php deleted file mode 100644 index 5636c11..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php +++ /dev/null @@ -1,168 +0,0 @@ -getSession()->visit($this->pathTo('/issue140.php')); - - $this->getSession()->getPage()->fillField('cookie_value', 'some:value;'); - $this->getSession()->getPage()->pressButton('Set cookie'); - - $this->getSession()->visit($this->pathTo('/issue140.php?show_value')); - $this->assertEquals('some:value;', $this->getSession()->getCookie('tc')); - $this->assertEquals('some:value;', $this->getSession()->getPage()->getText()); - } - - public function testCookie() - { - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - $this->assertNull($this->getSession()->getCookie('srvr_cookie')); - - $this->getSession()->setCookie('srvr_cookie', 'client cookie set'); - $this->getSession()->reload(); - $this->assertContains('Previous cookie: client cookie set', $this->getSession()->getPage()->getText()); - $this->assertEquals('client cookie set', $this->getSession()->getCookie('srvr_cookie')); - - $this->getSession()->setCookie('srvr_cookie', null); - $this->getSession()->reload(); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - - $this->getSession()->visit($this->pathTo('/cookie_page1.php')); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - - $this->assertContains('Previous cookie: srv_var_is_set', $this->getSession()->getPage()->getText()); - $this->getSession()->setCookie('srvr_cookie', null); - $this->getSession()->reload(); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - } - - /** - * @dataProvider cookieWithPathsDataProvider - */ - public function testCookieWithPaths($cookieRemovalMode) - { - // start clean - $session = $this->getSession(); - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $session->getPage()->getText()); - - // cookie from root path is accessible in sub-folder - $session->visit($this->pathTo('/cookie_page1.php')); - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: srv_var_is_set', $session->getPage()->getText()); - - // cookie from sub-folder overrides cookie from root path - $session->visit($this->pathTo('/sub-folder/cookie_page1.php')); - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: srv_var_is_set_sub_folder', $session->getPage()->getText()); - - if ($cookieRemovalMode == 'session_reset') { - $session->reset(); - } elseif ($cookieRemovalMode == 'cookie_delete') { - $session->setCookie('srvr_cookie', null); - } - - // cookie is removed from all paths - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $session->getPage()->getText()); - } - - public function cookieWithPathsDataProvider() - { - return array( - array('session_reset'), - array('cookie_delete'), - ); - } - - public function testReset() - { - $this->getSession()->visit($this->pathTo('/cookie_page1.php')); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: srv_var_is_set', $this->getSession()->getPage()->getText()); - - $this->getSession()->reset(); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - - $this->getSession()->setCookie('srvr_cookie', 'test_cookie'); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: test_cookie', $this->getSession()->getPage()->getText()); - $this->getSession()->reset(); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - - $this->getSession()->setCookie('client_cookie1', 'some_val'); - $this->getSession()->setCookie('client_cookie2', 123); - $this->getSession()->visit($this->pathTo('/session_test.php')); - $this->getSession()->visit($this->pathTo('/cookie_page1.php')); - - $this->getSession()->visit($this->pathTo('/print_cookies.php')); - $this->assertContains( - "'client_cookie1' = 'some_val'", - $this->getSession()->getPage()->getText() - ); - $this->assertContains( - "'client_cookie2' = '123'", - $this->getSession()->getPage()->getText() - ); - $this->assertContains( - "_SESS' = ", - $this->getSession()->getPage()->getText() - ); - $this->assertContains( - " 'srvr_cookie' = 'srv_var_is_set'", - $this->getSession()->getPage()->getText() - ); - - $this->getSession()->reset(); - $this->getSession()->visit($this->pathTo('/print_cookies.php')); - $this->assertContains('array ( )', $this->getSession()->getPage()->getText()); - } - - public function testHttpOnlyCookieIsDeleted() - { - $this->getSession()->restart(); - $this->getSession()->visit($this->pathTo('/cookie_page3.php')); - $this->assertEquals('Has Cookie: false', $this->findById('cookie-status')->getText()); - - $this->getSession()->reload(); - $this->assertEquals('Has Cookie: true', $this->findById('cookie-status')->getText()); - - $this->getSession()->restart(); - $this->getSession()->visit($this->pathTo('/cookie_page3.php')); - $this->assertEquals('Has Cookie: false', $this->findById('cookie-status')->getText()); - } - - public function testSessionPersistsBetweenRequests() - { - $this->getSession()->visit($this->pathTo('/session_test.php')); - $webAssert = $this->getAssertSession(); - $node = $webAssert->elementExists('css', '#session-id'); - $sessionId = $node->getText(); - - $this->getSession()->visit($this->pathTo('/session_test.php')); - $node = $webAssert->elementExists('css', '#session-id'); - $this->assertEquals($sessionId, $node->getText()); - - $this->getSession()->visit($this->pathTo('/session_test.php?login')); - $node = $webAssert->elementExists('css', '#session-id'); - $this->assertNotEquals($sessionId, $newSessionId = $node->getText()); - - $this->getSession()->visit($this->pathTo('/session_test.php')); - $node = $webAssert->elementExists('css', '#session-id'); - $this->assertEquals($newSessionId, $node->getText()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/ErrorHandlingTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/ErrorHandlingTest.php deleted file mode 100644 index bb4bb2d..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/ErrorHandlingTest.php +++ /dev/null @@ -1,265 +0,0 @@ -getSession()->visit($this->pathTo('/500.php')); - - $this->assertContains( - 'Sorry, a server error happened', - $this->getSession()->getPage()->getContent(), - 'Drivers allow loading pages with a 500 status code' - ); - } - - public function testCheckInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->check($element->getXpath()); - } - - public function testCheckNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->check(self::NOT_FOUND_XPATH); - } - - public function testUncheckInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->uncheck($element->getXpath()); - } - - public function testUncheckNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->uncheck(self::NOT_FOUND_XPATH); - } - - public function testSelectOptionInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->selectOption($element->getXpath(), 'test'); - } - - public function testSelectOptionNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->selectOption(self::NOT_FOUND_XPATH, 'test'); - } - - public function testAttachFileInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->attachFile($element->getXpath(), __FILE__); - } - - public function testAttachFileNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->attachFile(self::NOT_FOUND_XPATH, __FILE__); - } - - public function testSubmitFormInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('core'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->submitForm($element->getXpath()); - } - - public function testSubmitFormNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->submitForm(self::NOT_FOUND_XPATH); - } - - public function testGetTagNameNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getTagName(self::NOT_FOUND_XPATH); - } - - public function testGetTextNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getText(self::NOT_FOUND_XPATH); - } - - public function testGetHtmlNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getHtml(self::NOT_FOUND_XPATH); - } - - public function testGetOuterHtmlNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getOuterHtml(self::NOT_FOUND_XPATH); - } - - public function testGetValueNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getValue(self::NOT_FOUND_XPATH); - } - - public function testSetValueNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->setValue(self::NOT_FOUND_XPATH, 'test'); - } - - public function testIsSelectedNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->isSelected(self::NOT_FOUND_XPATH); - } - - public function testIsCheckedNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->isChecked(self::NOT_FOUND_XPATH); - } - - public function testIsVisibleNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->isVisible(self::NOT_FOUND_XPATH); - } - - public function testClickNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->click(self::NOT_FOUND_XPATH); - } - - public function testDoubleClickNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->doubleClick(self::NOT_FOUND_XPATH); - } - - public function testRightClickNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->rightClick(self::NOT_FOUND_XPATH); - } - - public function testGetAttributeNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getAttribute(self::NOT_FOUND_XPATH, 'id'); - } - - public function testMouseOverNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->mouseOver(self::NOT_FOUND_XPATH); - } - - public function testFocusNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->focus(self::NOT_FOUND_XPATH); - } - - public function testBlurNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->blur(self::NOT_FOUND_XPATH); - } - - public function testKeyPressNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->keyPress(self::NOT_FOUND_XPATH, 'a'); - } - - public function testKeyDownNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->keyDown(self::NOT_FOUND_XPATH, 'a'); - } - - public function testKeyUpNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->keyUp(self::NOT_FOUND_XPATH, 'a'); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/HeaderTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/HeaderTest.php deleted file mode 100644 index 072ceb4..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/HeaderTest.php +++ /dev/null @@ -1,78 +0,0 @@ -getSession()->visit($this->pathTo('/issue130.php?p=1')); - $page = $this->getSession()->getPage(); - - $page->clickLink('Go to 2'); - $this->assertEquals($this->pathTo('/issue130.php?p=1'), $page->getText()); - } - - public function testHeaders() - { - $this->getSession()->setRequestHeader('Accept-Language', 'fr'); - $this->getSession()->visit($this->pathTo('/headers.php')); - - $this->assertContains('[HTTP_ACCEPT_LANGUAGE] => fr', $this->getSession()->getPage()->getContent()); - } - - public function testSetUserAgent() - { - $session = $this->getSession(); - - $session->setRequestHeader('user-agent', 'foo bar'); - $session->visit($this->pathTo('/headers.php')); - $this->assertContains('[HTTP_USER_AGENT] => foo bar', $session->getPage()->getContent()); - } - - public function testResetHeaders() - { - $session = $this->getSession(); - - $session->setRequestHeader('X-Mink-Test', 'test'); - $session->visit($this->pathTo('/headers.php')); - - $this->assertContains( - '[HTTP_X_MINK_TEST] => test', - $session->getPage()->getContent(), - 'The custom header should be sent', - true - ); - - $session->reset(); - $session->visit($this->pathTo('/headers.php')); - - $this->assertNotContains( - '[HTTP_X_MINK_TEST] => test', - $session->getPage()->getContent(), - 'The custom header should not be sent after resetting', - true - ); - } - - public function testResponseHeaders() - { - $this->getSession()->visit($this->pathTo('/response_headers.php')); - - $headers = $this->getSession()->getResponseHeaders(); - - $lowercasedHeaders = array(); - foreach ($headers as $name => $value) { - $lowercasedHeaders[str_replace('_', '-', strtolower($name))] = $value; - } - - $this->assertArrayHasKey('x-mink-test', $lowercasedHeaders); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/IFrameTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/IFrameTest.php deleted file mode 100644 index 0ed0f9e..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/IFrameTest.php +++ /dev/null @@ -1,27 +0,0 @@ -getSession()->visit($this->pathTo('/iframe.html')); - $webAssert = $this->getAssertSession(); - - $el = $webAssert->elementExists('css', '#text'); - $this->assertSame('Main window div text', $el->getText()); - - $this->getSession()->switchToIFrame('subframe'); - - $el = $webAssert->elementExists('css', '#text'); - $this->assertSame('iFrame div text', $el->getText()); - - $this->getSession()->switchToIFrame(); - - $el = $webAssert->elementExists('css', '#text'); - $this->assertSame('Main window div text', $el->getText()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/NavigationTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/NavigationTest.php deleted file mode 100644 index 7056316..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/NavigationTest.php +++ /dev/null @@ -1,69 +0,0 @@ -getSession()->visit($this->pathTo('/redirector.php')); - $this->assertEquals($this->pathTo('/redirect_destination.html'), $this->getSession()->getCurrentUrl()); - } - - public function testPageControls() - { - $this->getSession()->visit($this->pathTo('/randomizer.php')); - $number1 = $this->getAssertSession()->elementExists('css', '#number')->getText(); - - $this->getSession()->reload(); - $number2 = $this->getAssertSession()->elementExists('css', '#number')->getText(); - - $this->assertNotEquals($number1, $number2); - - $this->getSession()->visit($this->pathTo('/links.html')); - $this->getSession()->getPage()->clickLink('Random number page'); - - $this->assertEquals($this->pathTo('/randomizer.php'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->back(); - $this->assertEquals($this->pathTo('/links.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->forward(); - $this->assertEquals($this->pathTo('/randomizer.php'), $this->getSession()->getCurrentUrl()); - } - - public function testLinks() - { - $this->getSession()->visit($this->pathTo('/links.html')); - $page = $this->getSession()->getPage(); - $link = $page->findLink('Redirect me to'); - - $this->assertNotNull($link); - $this->assertRegExp('/redirector\.php$/', $link->getAttribute('href')); - $link->click(); - - $this->assertEquals($this->pathTo('/redirect_destination.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->visit($this->pathTo('/links.html')); - $page = $this->getSession()->getPage(); - $link = $page->findLink('basic form image'); - - $this->assertNotNull($link); - $this->assertRegExp('/basic_form\.html$/', $link->getAttribute('href')); - $link->click(); - - $this->assertEquals($this->pathTo('/basic_form.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->visit($this->pathTo('/links.html')); - $page = $this->getSession()->getPage(); - $link = $page->findLink('Link with a '); - - $this->assertNotNull($link); - $this->assertRegExp('/links\.html\?quoted$/', $link->getAttribute('href')); - $link->click(); - - $this->assertEquals($this->pathTo('/links.html?quoted'), $this->getSession()->getCurrentUrl()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php deleted file mode 100644 index 329f2d3..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php +++ /dev/null @@ -1,30 +0,0 @@ -markTestSkipped('Testing screenshots requires the GD extension'); - } - - $this->getSession()->visit($this->pathTo('/index.html')); - - $screenShot = $this->getSession()->getScreenshot(); - - $this->assertInternalType('string', $screenShot); - $this->assertFalse(base64_decode($screenShot, true), 'The returned screenshot should not be base64-encoded'); - - $img = imagecreatefromstring($screenShot); - - if (false === $img) { - $this->fail('The screenshot should be a valid image'); - } - - imagedestroy($img); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php deleted file mode 100644 index 34ca7f0..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php +++ /dev/null @@ -1,22 +0,0 @@ -getSession()->visit($this->pathTo('/index.html')); - - $this->assertEquals(200, $this->getSession()->getStatusCode()); - $this->assertEquals($this->pathTo('/index.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->visit($this->pathTo('/404.php')); - - $this->assertEquals($this->pathTo('/404.php'), $this->getSession()->getCurrentUrl()); - $this->assertEquals(404, $this->getSession()->getStatusCode()); - $this->assertEquals('Sorry, page not found', $this->getSession()->getPage()->getContent()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php deleted file mode 100644 index 6f1ebcb..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php +++ /dev/null @@ -1,143 +0,0 @@ -getSession()->visit($this->pathTo('/issue211.html')); - $field = $this->getSession()->getPage()->findField('Téléphone'); - - $this->assertNotNull($field); - } - - public function testElementsTraversing() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $page = $this->getSession()->getPage(); - - $title = $page->find('css', 'h1'); - $this->assertNotNull($title); - $this->assertEquals('Extremely useless page', $title->getText()); - $this->assertEquals('h1', $title->getTagName()); - - $strong = $page->find('xpath', '//div/strong[3]'); - $this->assertNotNull($strong); - $this->assertEquals('pariatur', $strong->getText()); - $this->assertEquals('super-duper', $strong->getAttribute('class')); - $this->assertTrue($strong->hasAttribute('class')); - - $strong2 = $page->find('xpath', '//div/strong[2]'); - $this->assertNotNull($strong2); - $this->assertEquals('veniam', $strong2->getText()); - $this->assertEquals('strong', $strong2->getTagName()); - $this->assertNull($strong2->getAttribute('class')); - $this->assertFalse($strong2->hasAttribute('class')); - - $strongs = $page->findAll('css', 'div#core > strong'); - $this->assertCount(3, $strongs); - $this->assertEquals('Lorem', $strongs[0]->getText()); - $this->assertEquals('pariatur', $strongs[2]->getText()); - - $element = $page->find('css', '#some-element'); - - $this->assertNotNull($element); - $this->assertEquals('some very interesting text', $element->getText()); - $this->assertEquals( - "\n some
very\n
\n". - "interesting text\n ", - $element->getHtml() - ); - - $this->assertTrue($element->hasAttribute('data-href')); - $this->assertFalse($element->hasAttribute('data-url')); - $this->assertEquals('http://mink.behat.org', $element->getAttribute('data-href')); - $this->assertNull($element->getAttribute('data-url')); - $this->assertEquals('div', $element->getTagName()); - } - - public function testVeryDeepElementsTraversing() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $page = $this->getSession()->getPage(); - - $footer = $page->find('css', 'footer'); - $this->assertNotNull($footer); - - $searchForm = $footer->find('css', 'form#search-form'); - $this->assertNotNull($searchForm); - $this->assertEquals('search-form', $searchForm->getAttribute('id')); - - $searchInput = $searchForm->findField('Search site...'); - $this->assertNotNull($searchInput); - $this->assertEquals('text', $searchInput->getAttribute('type')); - - $searchInput = $searchForm->findField('Search site...'); - $this->assertNotNull($searchInput); - $this->assertEquals('text', $searchInput->getAttribute('type')); - - $profileForm = $footer->find('css', '#profile'); - $this->assertNotNull($profileForm); - - $profileFormDiv = $profileForm->find('css', 'div'); - $this->assertNotNull($profileFormDiv); - - $profileFormDivLabel = $profileFormDiv->find('css', 'label'); - $this->assertNotNull($profileFormDivLabel); - - $profileFormDivParent = $profileFormDivLabel->getParent(); - $this->assertNotNull($profileFormDivParent); - - $profileFormDivParent = $profileFormDivLabel->getParent(); - $this->assertEquals('something', $profileFormDivParent->getAttribute('data-custom')); - - $profileFormInput = $profileFormDivLabel->findField('user-name'); - $this->assertNotNull($profileFormInput); - $this->assertEquals('username', $profileFormInput->getAttribute('name')); - } - - public function testDeepTraversing() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $traversDivs = $this->getSession()->getPage()->findAll('css', 'div.travers'); - - $this->assertCount(1, $traversDivs); - - $subDivs = $traversDivs[0]->findAll('css', 'div.sub'); - $this->assertCount(3, $subDivs); - - $this->assertTrue($subDivs[2]->hasLink('some deep url')); - $this->assertFalse($subDivs[2]->hasLink('come deep url')); - $subUrl = $subDivs[2]->findLink('some deep url'); - $this->assertNotNull($subUrl); - - $this->assertRegExp('/some_url$/', $subUrl->getAttribute('href')); - $this->assertEquals('some deep url', $subUrl->getText()); - $this->assertEquals('some deep url', $subUrl->getHtml()); - - $this->assertTrue($subUrl->has('css', 'strong')); - $this->assertFalse($subUrl->has('css', 'em')); - $this->assertEquals('deep', $subUrl->find('css', 'strong')->getText()); - } - - public function testFindingChild() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $form = $this->getSession()->getPage()->find('css', 'footer form'); - $this->assertNotNull($form); - - $this->assertCount(1, $form->findAll('css', 'input'), 'Elements are searched only in the element, not in all previous matches'); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/VisibilityTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/VisibilityTest.php deleted file mode 100644 index bb5634e..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/VisibilityTest.php +++ /dev/null @@ -1,20 +0,0 @@ -getSession()->visit($this->pathTo('/js_test.html')); - $webAssert = $this->getAssertSession(); - - $clicker = $webAssert->elementExists('css', '.elements div#clicker'); - $invisible = $webAssert->elementExists('css', '#invisible'); - - $this->assertFalse($invisible->isVisible()); - $this->assertTrue($clicker->isVisible()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Css/HoverTest.php b/vendor/behat/mink/driver-testsuite/tests/Css/HoverTest.php deleted file mode 100644 index 87041d4..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Css/HoverTest.php +++ /dev/null @@ -1,76 +0,0 @@ -getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->mouseOver(); - $this->assertActionSquareHeight(200); - } - - /** - * @group mouse-events - * @depends testMouseOverHover - */ - public function testClickHover() - { - $this->getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->click(); - $this->assertActionSquareHeight(200); - } - - /** - * @group mouse-events - * @depends testMouseOverHover - */ - public function testDoubleClickHover() - { - $this->getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->doubleClick(); - $this->assertActionSquareHeight(200); - } - - /** - * @group mouse-events - * @depends testMouseOverHover - */ - public function testRightClickHover() - { - $this->getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->rightClick(); - $this->assertActionSquareHeight(200); - } - - private function assertActionSquareHeight($expected) - { - $this->assertEquals( - $expected, - $this->getSession()->evaluateScript("return window.$('#action-square').height();"), - 'Mouse is located over the object when mouse-related action is performed' - ); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php b/vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php deleted file mode 100644 index 18c4088..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php +++ /dev/null @@ -1,73 +0,0 @@ -getSession()->visit($this->pathTo('advanced_form.html')); - - $checkbox = $this->getAssertSession()->fieldExists('agreement'); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - - $checkbox->check(); - - $this->assertEquals('yes', $checkbox->getValue()); - $this->assertTrue($checkbox->isChecked()); - - $checkbox->uncheck(); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - } - - public function testSetValue() - { - $this->getSession()->visit($this->pathTo('advanced_form.html')); - - $checkbox = $this->getAssertSession()->fieldExists('agreement'); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - - $checkbox->setValue(true); - - $this->assertEquals('yes', $checkbox->getValue()); - $this->assertTrue($checkbox->isChecked()); - - $checkbox->setValue(false); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - } - - public function testCheckboxMultiple() - { - $this->getSession()->visit($this->pathTo('/multicheckbox_form.html')); - $webAssert = $this->getAssertSession(); - - $this->assertEquals('Multicheckbox Test', $webAssert->elementExists('css', 'h1')->getText()); - - $updateMail = $webAssert->elementExists('css', '[name="mail_types[]"][value="update"]'); - $spamMail = $webAssert->elementExists('css', '[name="mail_types[]"][value="spam"]'); - - $this->assertEquals('update', $updateMail->getValue()); - $this->assertNull($spamMail->getValue()); - - $this->assertTrue($updateMail->isChecked()); - $this->assertFalse($spamMail->isChecked()); - - $updateMail->uncheck(); - $this->assertFalse($updateMail->isChecked()); - $this->assertFalse($spamMail->isChecked()); - - $spamMail->check(); - $this->assertFalse($updateMail->isChecked()); - $this->assertTrue($spamMail->isChecked()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php b/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php deleted file mode 100644 index 0e08d34..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php +++ /dev/null @@ -1,312 +0,0 @@ -getSession(); - - $session->visit($this->pathTo('/issue212.html')); - - $field = $this->findById('poney-button'); - $this->assertEquals('poney', $field->getValue()); - } - - public function testBasicForm() - { - $this->getSession()->visit($this->pathTo('/basic_form.html')); - - $webAssert = $this->getAssertSession(); - $page = $this->getSession()->getPage(); - $this->assertEquals('Basic Form Page', $webAssert->elementExists('css', 'h1')->getText()); - - $firstname = $webAssert->fieldExists('first_name'); - $lastname = $webAssert->fieldExists('lastn'); - - $this->assertEquals('Firstname', $firstname->getValue()); - $this->assertEquals('Lastname', $lastname->getValue()); - - $firstname->setValue('Konstantin'); - $page->fillField('last_name', 'Kudryashov'); - - $this->assertEquals('Konstantin', $firstname->getValue()); - $this->assertEquals('Kudryashov', $lastname->getValue()); - - $page->findButton('Reset')->click(); - - $this->assertEquals('Firstname', $firstname->getValue()); - $this->assertEquals('Lastname', $lastname->getValue()); - - $firstname->setValue('Konstantin'); - $page->fillField('last_name', 'Kudryashov'); - - $page->findButton('Save')->click(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Anket for Konstantin', $webAssert->elementExists('css', 'h1')->getText()); - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - $this->assertEquals('Lastname: Kudryashov', $webAssert->elementExists('css', '#last')->getText()); - } - } - - /** - * @dataProvider formSubmitWaysDataProvider - */ - public function testFormSubmitWays($submitVia) - { - $session = $this->getSession(); - $session->visit($this->pathTo('/basic_form.html')); - $page = $session->getPage(); - $webAssert = $this->getAssertSession(); - - $firstname = $webAssert->fieldExists('first_name'); - $firstname->setValue('Konstantin'); - - $page->findButton($submitVia)->click(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - } else { - $this->fail('Form was never submitted'); - } - } - - public function formSubmitWaysDataProvider() - { - return array( - array('Save'), - array('input-type-image'), - array('button-without-type'), - array('button-type-submit'), - ); - } - - public function testFormSubmit() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/basic_form.html')); - - $webAssert = $this->getAssertSession(); - $webAssert->fieldExists('first_name')->setValue('Konstantin'); - - $webAssert->elementExists('xpath', 'descendant-or-self::form[1]')->submit(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - }; - } - - public function testFormSubmitWithoutButton() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/form_without_button.html')); - - $webAssert = $this->getAssertSession(); - $webAssert->fieldExists('first_name')->setValue('Konstantin'); - - $webAssert->elementExists('xpath', 'descendant-or-self::form[1]')->submit(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - }; - } - - public function testBasicGetForm() - { - $this->getSession()->visit($this->pathTo('/basic_get_form.php')); - $webAssert = $this->getAssertSession(); - - $page = $this->getSession()->getPage(); - $this->assertEquals('Basic Get Form Page', $webAssert->elementExists('css', 'h1')->getText()); - - $search = $webAssert->fieldExists('q'); - $search->setValue('some#query'); - $page->pressButton('Find'); - - $div = $webAssert->elementExists('css', 'div'); - $this->assertEquals('some#query', $div->getText()); - } - - public function testAdvancedForm() - { - $this->getSession()->visit($this->pathTo('/advanced_form.html')); - $page = $this->getSession()->getPage(); - - $page->fillField('first_name', 'ever'); - $page->fillField('last_name', 'zet'); - - $page->pressButton('Register'); - - $this->assertContains('no file', $page->getContent()); - - $this->getSession()->visit($this->pathTo('/advanced_form.html')); - - $webAssert = $this->getAssertSession(); - $page = $this->getSession()->getPage(); - $this->assertEquals('ADvanced Form Page', $webAssert->elementExists('css', 'h1')->getText()); - - $firstname = $webAssert->fieldExists('first_name'); - $lastname = $webAssert->fieldExists('lastn'); - $email = $webAssert->fieldExists('Your email:'); - $select = $webAssert->fieldExists('select_number'); - $sex = $webAssert->fieldExists('sex'); - $maillist = $webAssert->fieldExists('mail_list'); - $agreement = $webAssert->fieldExists('agreement'); - $notes = $webAssert->fieldExists('notes'); - $about = $webAssert->fieldExists('about'); - - $this->assertEquals('Firstname', $firstname->getValue()); - $this->assertEquals('Lastname', $lastname->getValue()); - $this->assertEquals('your@email.com', $email->getValue()); - $this->assertEquals('20', $select->getValue()); - $this->assertEquals('w', $sex->getValue()); - $this->assertEquals('original notes', $notes->getValue()); - - $this->assertEquals('on', $maillist->getValue()); - $this->assertNull($agreement->getValue()); - - $this->assertTrue($maillist->isChecked()); - $this->assertFalse($agreement->isChecked()); - - $agreement->check(); - $this->assertTrue($agreement->isChecked()); - - $maillist->uncheck(); - $this->assertFalse($maillist->isChecked()); - - $select->selectOption('thirty'); - $this->assertEquals('30', $select->getValue()); - - $sex->selectOption('m'); - $this->assertEquals('m', $sex->getValue()); - - $notes->setValue('new notes'); - $this->assertEquals('new notes', $notes->getValue()); - - $about->attachFile($this->mapRemoteFilePath(__DIR__.'/../../web-fixtures/some_file.txt')); - - $button = $page->findButton('Register'); - $this->assertNotNull($button); - - $page->fillField('first_name', 'Foo "item"'); - $page->fillField('last_name', 'Bar'); - $page->fillField('Your email:', 'ever.zet@gmail.com'); - - $this->assertEquals('Foo "item"', $firstname->getValue()); - $this->assertEquals('Bar', $lastname->getValue()); - - $button->press(); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - } - } - - public function testMultiInput() - { - $this->getSession()->visit($this->pathTo('/multi_input_form.html')); - $page = $this->getSession()->getPage(); - $webAssert = $this->getAssertSession(); - $this->assertEquals('Multi input Test', $webAssert->elementExists('css', 'h1')->getText()); - - $first = $webAssert->fieldExists('First'); - $second = $webAssert->fieldExists('Second'); - $third = $webAssert->fieldExists('Third'); - - $this->assertEquals('tag1', $first->getValue()); - $this->assertSame('tag2', $second->getValue()); - $this->assertEquals('tag1', $third->getValue()); - - $first->setValue('tag2'); - $this->assertEquals('tag2', $first->getValue()); - $this->assertSame('tag2', $second->getValue()); - $this->assertEquals('tag1', $third->getValue()); - - $second->setValue('one'); - - $this->assertEquals('tag2', $first->getValue()); - $this->assertSame('one', $second->getValue()); - - $third->setValue('tag3'); - - $this->assertEquals('tag2', $first->getValue()); - $this->assertSame('one', $second->getValue()); - $this->assertEquals('tag3', $third->getValue()); - - $button = $page->findButton('Register'); - $this->assertNotNull($button); - $button->press(); - - $space = ' '; - $out = <<assertContains($out, $page->getContent()); - } - - public function testAdvancedFormSecondSubmit() - { - $this->getSession()->visit($this->pathTo('/advanced_form.html')); - $page = $this->getSession()->getPage(); - - $button = $page->findButton('Login'); - $this->assertNotNull($button); - $button->press(); - - $toSearch = array( - "'agreement' = 'off',", - "'submit' = 'Login',", - 'no file', - ); - - $pageContent = $page->getContent(); - - foreach ($toSearch as $searchString) { - $this->assertContains($searchString, $pageContent); - } - } - - public function testSubmitEmptyTextarea() - { - $this->getSession()->visit($this->pathTo('/empty_textarea.html')); - $page = $this->getSession()->getPage(); - - $page->pressButton('Save'); - - $toSearch = array( - "'textarea' = '',", - "'submit' = 'Save',", - 'no file', - ); - - $pageContent = $page->getContent(); - - foreach ($toSearch as $searchString) { - $this->assertContains($searchString, $pageContent); - } - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Form/Html5Test.php b/vendor/behat/mink/driver-testsuite/tests/Form/Html5Test.php deleted file mode 100644 index b7f4716..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Form/Html5Test.php +++ /dev/null @@ -1,128 +0,0 @@ -getSession()->visit($this->pathTo('/html5_form.html')); - $page = $this->getSession()->getPage(); - $webAssert = $this->getAssertSession(); - - $firstName = $webAssert->fieldExists('first_name'); - $lastName = $webAssert->fieldExists('last_name'); - - $this->assertEquals('not set', $lastName->getValue()); - $firstName->setValue('John'); - $lastName->setValue('Doe'); - - $this->assertEquals('Doe', $lastName->getValue()); - - $page->pressButton('Submit in form'); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - $this->assertNotContains('other_field', $page->getContent()); - } - } - - public function testHtml5FormRadioAttribute() - { - $this->getSession()->visit($this->pathTo('html5_radio.html')); - $page = $this->getSession()->getPage(); - - $radio = $this->findById('sex_f'); - $otherRadio = $this->findById('sex_invalid'); - - $this->assertEquals('f', $radio->getValue()); - $this->assertEquals('invalid', $otherRadio->getValue()); - - $radio->selectOption('m'); - - $this->assertEquals('m', $radio->getValue()); - $this->assertEquals('invalid', $otherRadio->getValue()); - - $page->pressButton('Submit in form'); - - $out = <<assertContains($out, $page->getContent()); - } - - public function testHtml5FormButtonAttribute() - { - $this->getSession()->visit($this->pathTo('/html5_form.html')); - $page = $this->getSession()->getPage(); - $webAssert = $this->getAssertSession(); - - $firstName = $webAssert->fieldExists('first_name'); - $lastName = $webAssert->fieldExists('last_name'); - - $firstName->setValue('John'); - $lastName->setValue('Doe'); - - $page->pressButton('Submit outside form'); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - } - } - - public function testHtml5FormOutside() - { - $this->getSession()->visit($this->pathTo('/html5_form.html')); - $page = $this->getSession()->getPage(); - - $page->fillField('other_field', 'hello'); - - $page->pressButton('Submit separate form'); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - $this->assertNotContains('first_name', $page->getContent()); - } - } - - public function testHtml5Types() - { - $this->getSession()->visit($this->pathTo('html5_types.html')); - $page = $this->getSession()->getPage(); - - $page->fillField('url', 'http://mink.behat.org/'); - $page->fillField('email', 'mink@example.org'); - $page->fillField('number', '6'); - $page->fillField('search', 'mink'); - $page->fillField('date', '2014-05-19'); - $page->fillField('color', '#ff00aa'); - - $page->pressButton('Submit'); - - $out = <<assertContains($out, $page->getContent()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php b/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php deleted file mode 100644 index b21ab7d..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php +++ /dev/null @@ -1,84 +0,0 @@ -getSession()->visit($this->pathTo('radio.html')); - } - - public function testIsChecked() - { - $option = $this->findById('first'); - $option2 = $this->findById('second'); - - $this->assertTrue($option->isChecked()); - $this->assertFalse($option2->isChecked()); - - $option2->selectOption('updated'); - - $this->assertFalse($option->isChecked()); - $this->assertTrue($option2->isChecked()); - } - - public function testSelectOption() - { - $option = $this->findById('first'); - - $this->assertEquals('set', $option->getValue()); - - $option->selectOption('updated'); - - $this->assertEquals('updated', $option->getValue()); - - $option->selectOption('set'); - - $this->assertEquals('set', $option->getValue()); - } - - public function testSetValue() - { - $option = $this->findById('first'); - - $this->assertEquals('set', $option->getValue()); - - $option->setValue('updated'); - - $this->assertEquals('updated', $option->getValue()); - $this->assertFalse($option->isChecked()); - } - - public function testSameNameInMultipleForms() - { - $option1 = $this->findById('reused_form1'); - $option2 = $this->findById('reused_form2'); - - $this->assertEquals('test2', $option1->getValue()); - $this->assertEquals('test3', $option2->getValue()); - - $option1->selectOption('test'); - - $this->assertEquals('test', $option1->getValue()); - $this->assertEquals('test3', $option2->getValue()); - } - - /** - * @see https://github.com/Behat/MinkSahiDriver/issues/32 - */ - public function testSetValueXPathEscaping() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/advanced_form.html')); - $page = $session->getPage(); - - $sex = $page->find('xpath', '//*[@name = "sex"]'."\n|\n".'//*[@id = "sex"]'); - $this->assertNotNull($sex, 'xpath with line ending works'); - - $sex->setValue('m'); - $this->assertEquals('m', $sex->getValue(), 'no double xpath escaping during radio button value change'); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Form/SelectTest.php b/vendor/behat/mink/driver-testsuite/tests/Form/SelectTest.php deleted file mode 100644 index f06d5f0..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Form/SelectTest.php +++ /dev/null @@ -1,134 +0,0 @@ -getSession()->visit($this->pathTo('/multiselect_form.html')); - $webAssert = $this->getAssertSession(); - $page = $this->getSession()->getPage(); - $this->assertEquals('Multiselect Test', $webAssert->elementExists('css', 'h1')->getText()); - - $select = $webAssert->fieldExists('select_number'); - $multiSelect = $webAssert->fieldExists('select_multiple_numbers[]'); - $secondMultiSelect = $webAssert->fieldExists('select_multiple_values[]'); - - $this->assertEquals('20', $select->getValue()); - $this->assertSame(array(), $multiSelect->getValue()); - $this->assertSame(array('2', '3'), $secondMultiSelect->getValue()); - - $select->selectOption('thirty'); - $this->assertEquals('30', $select->getValue()); - - $multiSelect->selectOption('one', true); - - $this->assertSame(array('1'), $multiSelect->getValue()); - - $multiSelect->selectOption('three', true); - - $this->assertEquals(array('1', '3'), $multiSelect->getValue()); - - $secondMultiSelect->selectOption('two'); - $this->assertSame(array('2'), $secondMultiSelect->getValue()); - - $button = $page->findButton('Register'); - $this->assertNotNull($button); - $button->press(); - - $space = ' '; - $out = <<assertContains($out, $page->getContent()); - } - - /** - * @dataProvider testElementSelectedStateCheckDataProvider - */ - public function testElementSelectedStateCheck($selectName, $optionValue, $optionText) - { - $session = $this->getSession(); - $webAssert = $this->getAssertSession(); - $session->visit($this->pathTo('/multiselect_form.html')); - $select = $webAssert->fieldExists($selectName); - - $option = $webAssert->elementExists('named', array('option', $optionValue)); - - $this->assertFalse($option->isSelected()); - $select->selectOption($optionText); - $this->assertTrue($option->isSelected()); - } - - public function testElementSelectedStateCheckDataProvider() - { - return array( - array('select_number', '30', 'thirty'), - array('select_multiple_numbers[]', '2', 'two'), - ); - } - - public function testSetValueSingleSelect() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/multiselect_form.html')); - $select = $this->getAssertSession()->fieldExists('select_number'); - - $select->setValue('10'); - $this->assertEquals('10', $select->getValue()); - } - - public function testSetValueMultiSelect() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/multiselect_form.html')); - $select = $this->getAssertSession()->fieldExists('select_multiple_values[]'); - - $select->setValue(array('1', '2')); - $this->assertEquals(array('1', '2'), $select->getValue()); - } - - /** - * @see https://github.com/Behat/Mink/issues/193 - */ - public function testOptionWithoutValue() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/issue193.html')); - - $session->getPage()->selectFieldOption('options-without-values', 'Two'); - $this->assertEquals('Two', $this->findById('options-without-values')->getValue()); - - $this->assertTrue($this->findById('two')->isSelected()); - $this->assertFalse($this->findById('one')->isSelected()); - - $session->getPage()->selectFieldOption('options-with-values', 'two'); - $this->assertEquals('two', $this->findById('options-with-values')->getValue()); - } - - /** - * @see https://github.com/Behat/Mink/issues/131 - */ - public function testAccentuatedOption() - { - $this->getSession()->visit($this->pathTo('/issue131.html')); - $page = $this->getSession()->getPage(); - - $page->selectFieldOption('foobar', 'Gimme some accentués characters'); - - $this->assertEquals('1', $page->findField('foobar')->getValue()); - } -} diff --git a/vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php b/vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php deleted file mode 100644 index 4c8a30f..0000000 --- a/vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php +++ /dev/null @@ -1,155 +0,0 @@ - in a - - - - - - - - - - - - - - - - - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/advanced_form_post.php b/vendor/behat/mink/driver-testsuite/web-fixtures/advanced_form_post.php deleted file mode 100644 index 755806d..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/advanced_form_post.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - Advanced form save - - - -', '', var_export($_POST, true)) . "\n"; -if (isset($_FILES['about']) && file_exists($_FILES['about']['tmp_name'])) { - echo $_FILES['about']['name'] . "\n"; - echo file_get_contents($_FILES['about']['tmp_name']); -} else { - echo "no file"; -} -?> - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/aria_roles.html b/vendor/behat/mink/driver-testsuite/web-fixtures/aria_roles.html deleted file mode 100644 index 7074e85..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/aria_roles.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - ARIA roles test - - - - This page tests selected ARIA roles
- (see http://www.w3.org/TR/wai-aria/) - -
Toggle
- - - - - - - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/basic_auth.php b/vendor/behat/mink/driver-testsuite/web-fixtures/basic_auth.php deleted file mode 100644 index 9620a0e..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/basic_auth.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - Basic Form - - - -

Basic Form Page

- -
- - - - - - - - - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/basic_form_post.php b/vendor/behat/mink/driver-testsuite/web-fixtures/basic_form_post.php deleted file mode 100644 index 8a5e340..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/basic_form_post.php +++ /dev/null @@ -1,13 +0,0 @@ - - - - Basic Form Saving - - - -

Anket for

- - Firstname: - Lastname: - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/basic_get_form.php b/vendor/behat/mink/driver-testsuite/web-fixtures/basic_get_form.php deleted file mode 100644 index a0b3516..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/basic_get_form.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - Basic Get Form - - - -

Basic Get Form Page

- -
- -
- -
- - - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page1.php b/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page1.php deleted file mode 100644 index 7f128ca..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page1.php +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Basic Form - - - - Basic Page With Cookie Set from Server Side - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page2.php b/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page2.php deleted file mode 100644 index 22bcd1b..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page2.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Basic Form - - - - Previous cookie: - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page3.php b/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page3.php deleted file mode 100644 index caa28bc..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page3.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - - HttpOnly Cookie Test - - - - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/css_mouse_events.html b/vendor/behat/mink/driver-testsuite/web-fixtures/css_mouse_events.html deleted file mode 100644 index 750ca54..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/css_mouse_events.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - CSS Mouse Events Testing - - - - - - -
-
reset
-
mouse action
-
- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/element_change_detector.html b/vendor/behat/mink/driver-testsuite/web-fixtures/element_change_detector.html deleted file mode 100644 index c309bae..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/element_change_detector.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - ADvanced Form - - - - -

ADvanced Form Page

- -
- - - - - - - - - - - - - - -
- -
    -
  • for easy element location
  • -
- - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/empty_textarea.html b/vendor/behat/mink/driver-testsuite/web-fixtures/empty_textarea.html deleted file mode 100644 index f0779ee..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/empty_textarea.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Empty textarea submission - - - -

Empty textarea submission

-
- - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/form_without_button.html b/vendor/behat/mink/driver-testsuite/web-fixtures/form_without_button.html deleted file mode 100644 index 8063026..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/form_without_button.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Form submission without button test - - -
- - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/headers.php b/vendor/behat/mink/driver-testsuite/web-fixtures/headers.php deleted file mode 100644 index 25d9b90..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/headers.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Headers page - - - - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/html5_form.html b/vendor/behat/mink/driver-testsuite/web-fixtures/html5_form.html deleted file mode 100644 index 9070353..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/html5_form.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - HTML5 form attribute test - - -
- - - - -
- - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/html5_radio.html b/vendor/behat/mink/driver-testsuite/web-fixtures/html5_radio.html deleted file mode 100644 index fd54c2d..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/html5_radio.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - HTML5 form attribute test - - -
- - - -
- -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/html5_types.html b/vendor/behat/mink/driver-testsuite/web-fixtures/html5_types.html deleted file mode 100644 index bd46cfa..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/html5_types.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - HTML5 form attribute test - - -
- - - - - - - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/html_decoding.html b/vendor/behat/mink/driver-testsuite/web-fixtures/html_decoding.html deleted file mode 100644 index 341f226..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/html_decoding.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - HTML Decoding Test - - -
- some text - -
- - - -
-
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/iframe.html b/vendor/behat/mink/driver-testsuite/web-fixtures/iframe.html deleted file mode 100644 index c54797f..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/iframe.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -
- Main window div text -
- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/iframe_inner.html b/vendor/behat/mink/driver-testsuite/web-fixtures/iframe_inner.html deleted file mode 100644 index 512f058..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/iframe_inner.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - -
- iFrame div text -
- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/index.html b/vendor/behat/mink/driver-testsuite/web-fixtures/index.html deleted file mode 100644 index cc8c821..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - Index page - - - -

Extremely useless page

-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - -
- An empty tag should be rendered with both open and close tags. -
- -
- some
very -
-interesting text -
- -
- - - - -
- -
-
el1
-
el2
- -
- -
el4
- -
- -
-
- -
-
-
- -
- -
-
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue130.php b/vendor/behat/mink/driver-testsuite/web-fixtures/issue130.php deleted file mode 100644 index 201d982..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue130.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - Go to 2'; - } else { - echo ''.$_SERVER['HTTP_REFERER'].''; - } - ?> - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue131.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue131.html deleted file mode 100644 index fa3427a..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue131.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Issue 131 - - - -

There is a non breaking space

-
Some accentués characters
-
- - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue140.php b/vendor/behat/mink/driver-testsuite/web-fixtures/issue140.php deleted file mode 100644 index 04a4caf..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue140.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - -
- - -
- diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue178.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue178.html deleted file mode 100644 index 3efc743..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue178.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Index page - - - -
-
- -
-
- -
- - - \ No newline at end of file diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue193.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue193.html deleted file mode 100644 index e722a43..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue193.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Index page - - - - -
- - - -
- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue211.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue211.html deleted file mode 100644 index bb977ec..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue211.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - Index page - - - - -
-

- - -

-

- - -

- - -
- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue212.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue212.html deleted file mode 100644 index 24ae62f..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue212.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
- - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue215.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue215.html deleted file mode 100644 index adff3fb..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue215.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Index page - - - -
- -
- - - \ No newline at end of file diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue225.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue225.html deleted file mode 100644 index 1321463..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue225.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Index page - - - - - - - -
- - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/issue255.html b/vendor/behat/mink/driver-testsuite/web-fixtures/issue255.html deleted file mode 100644 index d56a427..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/issue255.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - Issue 255 - - - - -
- - - - -

-

-
- - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-1.6.2-min.js b/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-1.6.2-min.js deleted file mode 100644 index 8cdc80e..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-1.6.2-min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Jun 30 14:16:56 2011 -0400 - */ -(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. -shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j -)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-ui-1.8.14.custom.min.js b/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-ui-1.8.14.custom.min.js deleted file mode 100644 index 1764e11..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-ui-1.8.14.custom.min.js +++ /dev/null @@ -1,127 +0,0 @@ -/*! - * jQuery UI 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14", -keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus(); -b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this, -"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection", -function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth, -outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b); -return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e= -0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= -false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Draggable 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper= -this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); -this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, -_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= -false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, -10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| -!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& -a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= -this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), -10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), -10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, -(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= -"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), -10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ -this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& -!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f - - - JS elements test - - - - - -
-
not clicked
-
no mouse action detected
- - - - - -
-
- -
- -
-

Drop here

-
- -
- - - - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/json.php b/vendor/behat/mink/driver-testsuite/web-fixtures/json.php deleted file mode 100644 index 173d358..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/json.php +++ /dev/null @@ -1,7 +0,0 @@ - 'val1', - 'key2' => 234, - 'key3' => array(1, 2, 3) -)); diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/links.html b/vendor/behat/mink/driver-testsuite/web-fixtures/links.html deleted file mode 100644 index ec626bf..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/links.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Links page - - - - Redirect me to - Random number page - Link with a ' - - basic form image - - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/multi_input_form.html b/vendor/behat/mink/driver-testsuite/web-fixtures/multi_input_form.html deleted file mode 100644 index 600a500..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/multi_input_form.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - Multi input Test - - - -

Multi input Test

- -
- - - - - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/multicheckbox_form.html b/vendor/behat/mink/driver-testsuite/web-fixtures/multicheckbox_form.html deleted file mode 100644 index a2ae375..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/multicheckbox_form.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Multicheckbox Test - - - -

Multicheckbox Test

- -
- - - - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/multiselect_form.html b/vendor/behat/mink/driver-testsuite/web-fixtures/multiselect_form.html deleted file mode 100644 index 0d28986..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/multiselect_form.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - Multiselect Test - - - -

Multiselect Test

- -
- - - - - - - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/popup1.html b/vendor/behat/mink/driver-testsuite/web-fixtures/popup1.html deleted file mode 100644 index b8e3fe2..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/popup1.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - popup_1 - - - -
- Popup#1 div text -
- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/popup2.html b/vendor/behat/mink/driver-testsuite/web-fixtures/popup2.html deleted file mode 100644 index dae1932..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/popup2.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - popup_2 - - - -
- Popup#2 div text -
- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/print_cookies.php b/vendor/behat/mink/driver-testsuite/web-fixtures/print_cookies.php deleted file mode 100644 index eef496e..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/print_cookies.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Cookies page - - - - ', '', var_export($_COOKIE, true)); ?> - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/radio.html b/vendor/behat/mink/driver-testsuite/web-fixtures/radio.html deleted file mode 100644 index 69a916a..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/radio.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Radio group - - -
- - - - - -
- -
- - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/randomizer.php b/vendor/behat/mink/driver-testsuite/web-fixtures/randomizer.php deleted file mode 100644 index 07a73ec..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/randomizer.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - Index page - - - - -

- - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/redirect_destination.html b/vendor/behat/mink/driver-testsuite/web-fixtures/redirect_destination.html deleted file mode 100644 index 3de7481..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/redirect_destination.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirect destination - - - - You were redirected! - - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/redirector.php b/vendor/behat/mink/driver-testsuite/web-fixtures/redirector.php deleted file mode 100644 index 44ac8f3..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/redirector.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - - Response headers - - - -

Response headers

- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/session_test.php b/vendor/behat/mink/driver-testsuite/web-fixtures/session_test.php deleted file mode 100644 index df1af6f..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/session_test.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Session Test - - - -
- - diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/some_file.txt b/vendor/behat/mink/driver-testsuite/web-fixtures/some_file.txt deleted file mode 100644 index d515a02..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/some_file.txt +++ /dev/null @@ -1 +0,0 @@ -1 uploaded file diff --git a/vendor/behat/mink/driver-testsuite/web-fixtures/sub-folder/cookie_page1.php b/vendor/behat/mink/driver-testsuite/web-fixtures/sub-folder/cookie_page1.php deleted file mode 100644 index 750249b..0000000 --- a/vendor/behat/mink/driver-testsuite/web-fixtures/sub-folder/cookie_page1.php +++ /dev/null @@ -1,4 +0,0 @@ - - - - - - - - Popup #1 - - - - Popup #2 - - -
- Main window div text -
- - - diff --git a/vendor/behat/mink/tests/Driver/CoreDriverTest.php b/vendor/behat/mink/tests/Driver/CoreDriverTest.php deleted file mode 100644 index cd1fe64..0000000 --- a/vendor/behat/mink/tests/Driver/CoreDriverTest.php +++ /dev/null @@ -1,110 +0,0 @@ -getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { - $this->assertTrue( - $interfaceRef->hasMethod($method->getName()), - sprintf('CoreDriver should not implement methods which are not part of the DriverInterface but %s found', $method->getName()) - ); - } - } - - public function testCreateNodeElements() - { - $driver = $this->getMockBuilder('Behat\Mink\Driver\CoreDriver') - ->setMethods(array('findElementXpaths')) - ->getMockForAbstractClass(); - - $session = $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - - $driver->setSession($session); - - $driver->expects($this->once()) - ->method('findElementXpaths') - ->with('xpath') - ->willReturn(array('xpath1', 'xpath2')); - - /** @var NodeElement[] $elements */ - $elements = $driver->find('xpath'); - - $this->assertInternalType('array', $elements); - $this->assertCount(2, $elements); - $this->assertContainsOnlyInstancesOf('Behat\Mink\Element\NodeElement', $elements); - - $this->assertSame('xpath1', $elements[0]->getXpath()); - $this->assertSame('xpath2', $elements[1]->getXpath()); - } - - /** - * @dataProvider getDriverInterfaceMethods - */ - public function testInterfaceMethods(\ReflectionMethod $method) - { - $refl = new \ReflectionClass('Behat\Mink\Driver\CoreDriver'); - - $this->assertFalse( - $refl->getMethod($method->getName())->isAbstract(), - sprintf('CoreDriver should implement a dummy %s method', $method->getName()) - ); - - if ('setSession' === $method->getName()) { - return; // setSession is actually implemented, so we don't expect an exception here. - } - - $driver = $this->getMockForAbstractClass('Behat\Mink\Driver\CoreDriver'); - - $this->setExpectedException('Behat\Mink\Exception\UnsupportedDriverActionException'); - call_user_func_array(array($driver, $method->getName()), $this->getArguments($method)); - } - - public function getDriverInterfaceMethods() - { - $ref = new \ReflectionClass('Behat\Mink\Driver\DriverInterface'); - - return array_map(function ($method) { - return array($method); - }, $ref->getMethods()); - } - - private function getArguments(\ReflectionMethod $method) - { - $arguments = array(); - - foreach ($method->getParameters() as $parameter) { - $arguments[] = $this->getArgument($parameter); - } - - return $arguments; - } - - private function getArgument(\ReflectionParameter $argument) - { - if ($argument->isOptional()) { - return $argument->getDefaultValue(); - } - - if ($argument->allowsNull()) { - return null; - } - - if ($argument->getClass()) { - return $this->getMockBuilder($argument->getClass()->getName()) - ->disableOriginalConstructor() - ->getMock(); - } - - return null; - } -} diff --git a/vendor/behat/mink/tests/Element/DocumentElementTest.php b/vendor/behat/mink/tests/Element/DocumentElementTest.php deleted file mode 100644 index 2105ab7..0000000 --- a/vendor/behat/mink/tests/Element/DocumentElementTest.php +++ /dev/null @@ -1,449 +0,0 @@ -document = new DocumentElement($this->session); - } - - /** - * @group legacy - */ - public function testGetSession() - { - $this->assertEquals($this->session, $this->document->getSession()); - } - - public function testFindAll() - { - $xpath = 'h3[a]'; - $css = 'h3 > a'; - - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->will($this->returnValueMap(array( - array('//html/'.$xpath, array(2, 3, 4)), - array('//html/'.$css, array(1, 2)), - ))); - - $this->selectors - ->expects($this->exactly(2)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - array('css', $css, $css), - ))); - - $this->assertEquals(3, count($this->document->findAll('xpath', $xpath))); - $this->assertEquals(2, count($this->document->findAll('css', $css))); - } - - public function testFind() - { - $this->driver - ->expects($this->exactly(3)) - ->method('find') - ->with('//html/h3[a]') - ->will($this->onConsecutiveCalls(array(2, 3, 4), array(1, 2), array())); - - $xpath = 'h3[a]'; - $css = 'h3 > a'; - - $this->selectors - ->expects($this->exactly(3)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - array('xpath', $xpath, $xpath), - array('css', $css, $xpath), - ))); - - $this->assertEquals(2, $this->document->find('xpath', $xpath)); - $this->assertEquals(1, $this->document->find('css', $css)); - $this->assertNull($this->document->find('xpath', $xpath)); - } - - public function testFindField() - { - $this->mockNamedFinder( - '//field', - array('field1', 'field2', 'field3'), - array('field', 'some field') - ); - - $this->assertEquals('field1', $this->document->findField('some field')); - $this->assertEquals(null, $this->document->findField('some field')); - } - - public function testFindLink() - { - $this->mockNamedFinder( - '//link', - array('link1', 'link2', 'link3'), - array('link', 'some link') - ); - - $this->assertEquals('link1', $this->document->findLink('some link')); - $this->assertEquals(null, $this->document->findLink('some link')); - } - - public function testFindButton() - { - $this->mockNamedFinder( - '//button', - array('button1', 'button2', 'button3'), - array('button', 'some button') - ); - - $this->assertEquals('button1', $this->document->findButton('some button')); - $this->assertEquals(null, $this->document->findButton('some button')); - } - - public function testFindById() - { - $xpath = '//*[@id=some-item-2]'; - - $this->mockNamedFinder($xpath, array(array('id2', 'id3'), array()), array('id', 'some-item-2')); - - $this->assertEquals('id2', $this->document->findById('some-item-2')); - $this->assertEquals(null, $this->document->findById('some-item-2')); - } - - public function testHasSelector() - { - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->with('//html/some xpath') - ->will($this->onConsecutiveCalls(array('id2', 'id3'), array())); - - $this->selectors - ->expects($this->exactly(2)) - ->method('selectorToXpath') - ->with('xpath', 'some xpath') - ->will($this->returnValue('some xpath')); - - $this->assertTrue($this->document->has('xpath', 'some xpath')); - $this->assertFalse($this->document->has('xpath', 'some xpath')); - } - - public function testHasContent() - { - $this->mockNamedFinder( - '//some content', - array('item1', 'item2'), - array('content', 'some content') - ); - - $this->assertTrue($this->document->hasContent('some content')); - $this->assertFalse($this->document->hasContent('some content')); - } - - public function testHasLink() - { - $this->mockNamedFinder( - '//link', - array('link1', 'link2', 'link3'), - array('link', 'some link') - ); - - $this->assertTrue($this->document->hasLink('some link')); - $this->assertFalse($this->document->hasLink('some link')); - } - - public function testHasButton() - { - $this->mockNamedFinder( - '//button', - array('button1', 'button2', 'button3'), - array('button', 'some button') - ); - - $this->assertTrue($this->document->hasButton('some button')); - $this->assertFalse($this->document->hasButton('some button')); - } - - public function testHasField() - { - $this->mockNamedFinder( - '//field', - array('field1', 'field2', 'field3'), - array('field', 'some field') - ); - - $this->assertTrue($this->document->hasField('some field')); - $this->assertFalse($this->document->hasField('some field')); - } - - public function testHasCheckedField() - { - $checkbox = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $checkbox - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(true, false)); - - $this->mockNamedFinder( - '//field', - array(array($checkbox), array(), array($checkbox)), - array('field', 'some checkbox'), - 3 - ); - - $this->assertTrue($this->document->hasCheckedField('some checkbox')); - $this->assertFalse($this->document->hasCheckedField('some checkbox')); - $this->assertFalse($this->document->hasCheckedField('some checkbox')); - } - - public function testHasUncheckedField() - { - $checkbox = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $checkbox - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(true, false)); - - $this->mockNamedFinder( - '//field', - array(array($checkbox), array(), array($checkbox)), - array('field', 'some checkbox'), - 3 - ); - - $this->assertFalse($this->document->hasUncheckedField('some checkbox')); - $this->assertFalse($this->document->hasUncheckedField('some checkbox')); - $this->assertTrue($this->document->hasUncheckedField('some checkbox')); - } - - public function testHasSelect() - { - $this->mockNamedFinder( - '//select', - array('select'), - array('select', 'some select field') - ); - - $this->assertTrue($this->document->hasSelect('some select field')); - $this->assertFalse($this->document->hasSelect('some select field')); - } - - public function testHasTable() - { - $this->mockNamedFinder( - '//table', - array('table'), - array('table', 'some table') - ); - - $this->assertTrue($this->document->hasTable('some table')); - $this->assertFalse($this->document->hasTable('some table')); - } - - public function testClickLink() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('click'); - - $this->mockNamedFinder( - '//link', - array($node), - array('link', 'some link') - ); - - $this->document->clickLink('some link'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->clickLink('some link'); - } - - public function testClickButton() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('press'); - - $this->mockNamedFinder( - '//button', - array($node), - array('button', 'some button') - ); - - $this->document->pressButton('some button'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->pressButton('some button'); - } - - public function testFillField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('setValue') - ->with('some val'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->fillField('some field', 'some val'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->fillField('some field', 'some val'); - } - - public function testCheckField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('check'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->checkField('some field'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->checkField('some field'); - } - - public function testUncheckField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('uncheck'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->uncheckField('some field'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->uncheckField('some field'); - } - - public function testSelectField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('selectOption') - ->with('option2'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->selectFieldOption('some field', 'option2'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->selectFieldOption('some field', 'option2'); - } - - public function testAttachFileToField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('attachFile') - ->with('/path/to/file'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->attachFileToField('some field', '/path/to/file'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->attachFileToField('some field', '/path/to/file'); - } - - public function testGetContent() - { - $expects = 'page content'; - $this->driver - ->expects($this->once()) - ->method('getContent') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getContent()); - } - - public function testGetText() - { - $expects = 'val1'; - $this->driver - ->expects($this->once()) - ->method('getText') - ->with('//html') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getText()); - } - - public function testGetHtml() - { - $expects = 'val1'; - $this->driver - ->expects($this->once()) - ->method('getHtml') - ->with('//html') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getHtml()); - } - - public function testGetOuterHtml() - { - $expects = 'val1'; - $this->driver - ->expects($this->once()) - ->method('getOuterHtml') - ->with('//html') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getOuterHtml()); - } -} diff --git a/vendor/behat/mink/tests/Element/ElementTest.php b/vendor/behat/mink/tests/Element/ElementTest.php deleted file mode 100644 index 650284c..0000000 --- a/vendor/behat/mink/tests/Element/ElementTest.php +++ /dev/null @@ -1,71 +0,0 @@ -driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock(); - $this->driver - ->expects($this->once()) - ->method('setSession'); - - $this->selectors = $this->getMockBuilder('Behat\Mink\Selector\SelectorsHandler')->getMock(); - $this->session = new Session($this->driver, $this->selectors); - } - - protected function mockNamedFinder($xpath, array $results, $locator, $times = 2) - { - if (!is_array($results[0])) { - $results = array($results, array()); - } - - // In case of empty results, a second call will be done using the partial selector - $processedResults = array(); - foreach ($results as $result) { - $processedResults[] = $result; - if (empty($result)) { - $processedResults[] = $result; - ++$times; - } - } - - $returnValue = call_user_func_array(array($this, 'onConsecutiveCalls'), $processedResults); - - $this->driver - ->expects($this->exactly($times)) - ->method('find') - ->with('//html'.$xpath) - ->will($returnValue); - - $this->selectors - ->expects($this->exactly($times)) - ->method('selectorToXpath') - ->with($this->logicalOr('named_exact', 'named_partial'), $locator) - ->will($this->returnValue($xpath)); - } -} diff --git a/vendor/behat/mink/tests/Element/NodeElementTest.php b/vendor/behat/mink/tests/Element/NodeElementTest.php deleted file mode 100644 index f769ddd..0000000 --- a/vendor/behat/mink/tests/Element/NodeElementTest.php +++ /dev/null @@ -1,598 +0,0 @@ -session); - - $this->assertEquals('some custom xpath', $node->getXpath()); - $this->assertNotEquals('not some custom xpath', $node->getXpath()); - } - - public function testGetText() - { - $expected = 'val1'; - $node = new NodeElement('text_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getText') - ->with('text_tag') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getText()); - } - - public function testGetOuterHtml() - { - $expected = 'val1'; - $node = new NodeElement('text_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getOuterHtml') - ->with('text_tag') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getOuterHtml()); - } - - public function testElementIsValid() - { - $elementXpath = 'some xpath'; - $node = new NodeElement($elementXpath, $this->session); - - $this->driver - ->expects($this->once()) - ->method('find') - ->with($elementXpath) - ->will($this->returnValue(array($elementXpath))); - - $this->assertTrue($node->isValid()); - } - - public function testElementIsNotValid() - { - $node = new NodeElement('some xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->with('some xpath') - ->will($this->onConsecutiveCalls(array(), array('xpath1', 'xpath2'))); - - $this->assertFalse($node->isValid(), 'no elements found is invalid element'); - $this->assertFalse($node->isValid(), 'more then 1 element found is invalid element'); - } - - public function testWaitForSuccess() - { - $callCounter = 0; - $node = new NodeElement('some xpath', $this->session); - - $result = $node->waitFor(5, function ($givenNode) use (&$callCounter) { - ++$callCounter; - - if (1 === $callCounter) { - return null; - } elseif (2 === $callCounter) { - return false; - } elseif (3 === $callCounter) { - return array(); - } - - return $givenNode; - }); - - $this->assertEquals(4, $callCounter, '->waitFor() tries to locate element several times before failing'); - $this->assertSame($node, $result, '->waitFor() returns node found in callback'); - } - - /** - * @medium - */ - public function testWaitForTimeout() - { - $node = new NodeElement('some xpath', $this->session); - - $expectedTimeout = 2; - $startTime = microtime(true); - $result = $node->waitFor($expectedTimeout, function () { - return null; - }); - $endTime = microtime(true); - - $this->assertNull($result, '->waitFor() returns whatever callback gives'); - $this->assertEquals($expectedTimeout, round($endTime - $startTime)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testWaitForFailure() - { - $node = new NodeElement('some xpath', $this->session); - $node->waitFor(5, 'not a callable'); - } - - public function testHasAttribute() - { - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('getAttribute') - ->with('input_tag', 'href') - ->will($this->onConsecutiveCalls(null, 'http://...')); - - $this->assertFalse($node->hasAttribute('href')); - $this->assertTrue($node->hasAttribute('href')); - } - - public function testGetAttribute() - { - $expected = 'http://...'; - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getAttribute') - ->with('input_tag', 'href') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getAttribute('href')); - } - - public function testHasClass() - { - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->exactly(6)) - ->method('getAttribute') - ->with('input_tag', 'class') - ->will($this->returnValue(' - class1 class2 - ')); - - $this->assertTrue($node->hasClass('class1'), 'The "class1" was found'); - $this->assertTrue($node->hasClass('class2'), 'The "class2" was found'); - $this->assertFalse($node->hasClass('class3'), 'The "class3" was not found'); - } - - public function testHasClassWithoutArgument() - { - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getAttribute') - ->with('input_tag', 'class') - ->will($this->returnValue(null)); - - $this->assertFalse($node->hasClass('class3')); - } - - public function testGetValue() - { - $expected = 'val1'; - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getValue') - ->with('input_tag') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getValue()); - } - - public function testSetValue() - { - $expected = 'new_val'; - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('setValue') - ->with('input_tag', $expected); - - $node->setValue($expected); - } - - public function testClick() - { - $node = new NodeElement('link_or_button', $this->session); - - $this->driver - ->expects($this->once()) - ->method('click') - ->with('link_or_button'); - - $node->click(); - } - - public function testPress() - { - $node = new NodeElement('link_or_button', $this->session); - - $this->driver - ->expects($this->once()) - ->method('click') - ->with('link_or_button'); - - $node->press(); - } - - public function testRightClick() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('rightClick') - ->with('elem'); - - $node->rightClick(); - } - - public function testDoubleClick() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('doubleClick') - ->with('elem'); - - $node->doubleClick(); - } - - public function testCheck() - { - $node = new NodeElement('checkbox_or_radio', $this->session); - - $this->driver - ->expects($this->once()) - ->method('check') - ->with('checkbox_or_radio'); - - $node->check(); - } - - public function testUncheck() - { - $node = new NodeElement('checkbox_or_radio', $this->session); - - $this->driver - ->expects($this->once()) - ->method('uncheck') - ->with('checkbox_or_radio'); - - $node->uncheck(); - } - - public function testSelectOption() - { - $node = new NodeElement('select', $this->session); - $option = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $option - ->expects($this->once()) - ->method('getValue') - ->will($this->returnValue('item1')); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('select') - ->will($this->returnValue('select')); - - $this->driver - ->expects($this->once()) - ->method('find') - ->with('select/option') - ->will($this->returnValue(array($option))); - - $this->selectors - ->expects($this->once()) - ->method('selectorToXpath') - ->with('named_exact', array('option', 'item1')) - ->will($this->returnValue('option')); - - $this->driver - ->expects($this->once()) - ->method('selectOption') - ->with('select', 'item1', false); - - $node->selectOption('item1'); - } - - /** - * @expectedException \Behat\Mink\Exception\ElementNotFoundException - */ - public function testSelectOptionNotFound() - { - $node = new NodeElement('select', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('select') - ->will($this->returnValue('select')); - - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->with('select/option') - ->will($this->returnValue(array())); - - $this->selectors - ->expects($this->exactly(2)) - ->method('selectorToXpath') - ->with($this->logicalOr('named_exact', 'named_partial'), array('option', 'item1')) - ->will($this->returnValue('option')); - - $node->selectOption('item1'); - } - - public function testSelectOptionOtherTag() - { - $node = new NodeElement('div', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('div') - ->will($this->returnValue('div')); - - $this->driver - ->expects($this->once()) - ->method('selectOption') - ->with('div', 'item1', false); - - $node->selectOption('item1'); - } - - public function testGetTagName() - { - $node = new NodeElement('html//h3', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('html//h3') - ->will($this->returnValue('h3')); - - $this->assertEquals('h3', $node->getTagName()); - } - - public function testGetParent() - { - $node = new NodeElement('elem', $this->session); - $parent = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - - $this->driver - ->expects($this->once()) - ->method('find') - ->with('elem/..') - ->will($this->returnValue(array($parent))); - - $this->selectors - ->expects($this->once()) - ->method('selectorToXpath') - ->with('xpath', '..') - ->will($this->returnValue('..')); - - $this->assertSame($parent, $node->getParent()); - } - - public function testAttachFile() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('attachFile') - ->with('elem', 'path'); - - $node->attachFile('path'); - } - - public function testIsVisible() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('isVisible') - ->with('some_xpath') - ->will($this->onConsecutiveCalls(true, false)); - - $this->assertTrue($node->isVisible()); - $this->assertFalse($node->isVisible()); - } - - public function testIsChecked() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('isChecked') - ->with('some_xpath') - ->will($this->onConsecutiveCalls(true, false)); - - $this->assertTrue($node->isChecked()); - $this->assertFalse($node->isChecked()); - } - - public function testIsSelected() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('isSelected') - ->with('some_xpath') - ->will($this->onConsecutiveCalls(true, false)); - - $this->assertTrue($node->isSelected()); - $this->assertFalse($node->isSelected()); - } - - public function testFocus() - { - $node = new NodeElement('some-element', $this->session); - - $this->driver - ->expects($this->once()) - ->method('focus') - ->with('some-element'); - - $node->focus(); - } - - public function testBlur() - { - $node = new NodeElement('some-element', $this->session); - - $this->driver - ->expects($this->once()) - ->method('blur') - ->with('some-element'); - - $node->blur(); - } - - public function testMouseOver() - { - $node = new NodeElement('some-element', $this->session); - - $this->driver - ->expects($this->once()) - ->method('mouseOver') - ->with('some-element'); - - $node->mouseOver(); - } - - public function testDragTo() - { - $node = new NodeElement('some_tag1', $this->session); - - $target = $this->getMock('Behat\Mink\Element\ElementInterface'); - $target->expects($this->any()) - ->method('getXPath') - ->will($this->returnValue('some_tag2')); - - $this->driver - ->expects($this->once()) - ->method('dragTo') - ->with('some_tag1', 'some_tag2'); - - $node->dragTo($target); - } - - public function testKeyPress() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('keyPress') - ->with('elem', 'key'); - - $node->keyPress('key'); - } - - public function testKeyDown() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('keyDown') - ->with('elem', 'key'); - - $node->keyDown('key'); - } - - public function testKeyUp() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('keyUp') - ->with('elem', 'key'); - - $node->keyUp('key'); - } - - public function testSubmitForm() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->once()) - ->method('submitForm') - ->with('some_xpath'); - - $node->submit(); - } - - public function testFindAllUnion() - { - $node = new NodeElement('some_xpath', $this->session); - $xpath = "some_tag1 | some_tag2[@foo =\n 'bar|'']\n | some_tag3[foo | bar]"; - $expected = "some_xpath/some_tag1 | some_xpath/some_tag2[@foo =\n 'bar|''] | some_xpath/some_tag3[foo | bar]"; - - $this->driver - ->expects($this->exactly(1)) - ->method('find') - ->will($this->returnValueMap(array( - array($expected, array(2, 3, 4)), - ))); - - $this->selectors - ->expects($this->exactly(1)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - ))); - - $this->assertEquals(3, count($node->findAll('xpath', $xpath))); - } - - public function testFindAllParentUnion() - { - $node = new NodeElement('some_xpath | another_xpath', $this->session); - $xpath = 'some_tag1 | some_tag2'; - $expectedPrefixed = '(some_xpath | another_xpath)/some_tag1 | (some_xpath | another_xpath)/some_tag2'; - - $this->driver - ->expects($this->exactly(1)) - ->method('find') - ->will($this->returnValueMap(array( - array($expectedPrefixed, array(2, 3, 4)), - ))); - - $this->selectors - ->expects($this->exactly(1)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - ))); - - $this->assertEquals(3, count($node->findAll('xpath', $xpath))); - } -} diff --git a/vendor/behat/mink/tests/Exception/ElementExceptionTest.php b/vendor/behat/mink/tests/Exception/ElementExceptionTest.php deleted file mode 100644 index 87bf2ca..0000000 --- a/vendor/behat/mink/tests/Exception/ElementExceptionTest.php +++ /dev/null @@ -1,42 +0,0 @@ -getElementMock(), new \Exception('Something went wrong')); - - $expectedMessage = "Exception thrown by element XPath\nSomething went wrong"; - $this->assertEquals($expectedMessage, $exception->getMessage()); - $this->assertEquals($expectedMessage, (string) $exception); - } - - public function testElement() - { - $element = $this->getElementMock(); - - $exception = new ElementException($element, new \Exception('Something went wrong')); - - $this->assertSame($element, $exception->getElement()); - } - - private function getElementMock() - { - $mock = $this->getMockBuilder('Behat\Mink\Element\Element') - ->disableOriginalConstructor() - ->getMock(); - - $mock->expects($this->any()) - ->method('getXPath') - ->will($this->returnValue('element XPath')); - - return $mock; - } -} diff --git a/vendor/behat/mink/tests/Exception/ElementHtmlExceptionTest.php b/vendor/behat/mink/tests/Exception/ElementHtmlExceptionTest.php deleted file mode 100644 index 7d6ea82..0000000 --- a/vendor/behat/mink/tests/Exception/ElementHtmlExceptionTest.php +++ /dev/null @@ -1,50 +0,0 @@ -getMock('Behat\Mink\Driver\DriverInterface'); - $element = $this->getElementMock(); - - $driver->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $driver->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $element->expects($this->any()) - ->method('getOuterHtml') - ->will($this->returnValue("
\n

Hello world

\n

Test

\n
")); - - $expected = <<<'TXT' -Html error - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -|
-|

Hello world

-|

Test

-|
-| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ElementHtmlException('Html error', $driver, $element); - - $this->assertEquals($expected, $exception->__toString()); - } - - private function getElementMock() - { - return $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/vendor/behat/mink/tests/Exception/ElementNotFoundExceptionTest.php b/vendor/behat/mink/tests/Exception/ElementNotFoundExceptionTest.php deleted file mode 100644 index 6faa55c..0000000 --- a/vendor/behat/mink/tests/Exception/ElementNotFoundExceptionTest.php +++ /dev/null @@ -1,50 +0,0 @@ -getMock('Behat\Mink\Driver\DriverInterface'); - - $exception = new ElementNotFoundException($driver, $type, $selector, $locator); - - $this->assertEquals($message, $exception->getMessage()); - } - - public function provideExceptionMessage() - { - return array( - array('Tag not found.', null), - array('Field not found.', 'field'), - array('Tag matching locator "foobar" not found.', null, null, 'foobar'), - array('Tag matching css "foobar" not found.', null, 'css', 'foobar'), - array('Field matching xpath "foobar" not found.', 'Field', 'xpath', 'foobar'), - array('Tag with name "foobar" not found.', null, 'name', 'foobar'), - ); - } - - /** - * @group legacy - */ - public function testConstructWithSession() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - $session = $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - $session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($driver)); - - $exception = new ElementNotFoundException($session); - - $this->assertEquals('Tag not found.', $exception->getMessage()); - } -} diff --git a/vendor/behat/mink/tests/Exception/ElementTextExceptionTest.php b/vendor/behat/mink/tests/Exception/ElementTextExceptionTest.php deleted file mode 100644 index f8d5e4c..0000000 --- a/vendor/behat/mink/tests/Exception/ElementTextExceptionTest.php +++ /dev/null @@ -1,48 +0,0 @@ -getMock('Behat\Mink\Driver\DriverInterface'); - $element = $this->getElementMock(); - - $driver->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $driver->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $element->expects($this->any()) - ->method('getText') - ->will($this->returnValue("Hello world\nTest\n")); - - $expected = <<<'TXT' -Text error - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| Hello world -| Test -| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ElementTextException('Text error', $driver, $element); - - $this->assertEquals($expected, $exception->__toString()); - } - - private function getElementMock() - { - return $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php b/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php deleted file mode 100644 index a327fcb..0000000 --- a/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php +++ /dev/null @@ -1,114 +0,0 @@ -getMock('Behat\Mink\Driver\DriverInterface'), new \Exception('Something failed')); - - $this->assertEquals('Something failed', $exception->getMessage()); - } - - public function testExceptionToString() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - - $driver->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $driver->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $html = "Hello\n\n

Hello world

\n

Test

\n"; - $driver->expects($this->any()) - ->method('getContent') - ->will($this->returnValue($html)); - - $expected = <<<'TXT' -Expectation failure - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| -|

Hello world

-|

Test

-| -| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ExpectationException('Expectation failure', $driver); - - $this->assertEquals($expected, $exception->__toString()); - } - - public function testBigContent() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - - $driver->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $driver->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $body = str_repeat('a', 1001 - strlen('')); - - $html = sprintf("Hello\n%s", $body); - $driver->expects($this->any()) - ->method('getContent') - ->will($this->returnValue($html)); - - $expected = <<<'TXT' -Expectation failure - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| %sassertEquals($expected, $exception->__toString()); - } - - public function testExceptionWhileRenderingString() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - $driver->expects($this->any()) - ->method('getContent') - ->will($this->throwException(new \Exception('Broken page'))); - - $exception = new ExpectationException('Expectation failure', $driver); - - $this->assertEquals('Expectation failure', $exception->__toString()); - } - - /** - * @group legacy - */ - public function testConstructWithSession() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - $session = $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - $session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($driver)); - - $exception = new ExpectationException('', $session, new \Exception('Something failed')); - - $this->assertEquals('Something failed', $exception->getMessage()); - } -} diff --git a/vendor/behat/mink/tests/Exception/ResponseTextExceptionTest.php b/vendor/behat/mink/tests/Exception/ResponseTextExceptionTest.php deleted file mode 100644 index 429721d..0000000 --- a/vendor/behat/mink/tests/Exception/ResponseTextExceptionTest.php +++ /dev/null @@ -1,40 +0,0 @@ -getMock('Behat\Mink\Driver\DriverInterface'); - - $driver->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $driver->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - $driver->expects($this->any()) - ->method('getText') - ->with('//html') - ->will($this->returnValue("Hello world\nTest\n")); - - $expected = <<<'TXT' -Text error - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| Hello world -| Test -| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ResponseTextException('Text error', $driver); - - $this->assertEquals($expected, $exception->__toString()); - } -} diff --git a/vendor/behat/mink/tests/MinkTest.php b/vendor/behat/mink/tests/MinkTest.php deleted file mode 100644 index 11d6466..0000000 --- a/vendor/behat/mink/tests/MinkTest.php +++ /dev/null @@ -1,246 +0,0 @@ -mink = new Mink(); - } - - public function testRegisterSession() - { - $session = $this->getSessionMock(); - - $this->assertFalse($this->mink->hasSession('not_registered')); - $this->assertFalse($this->mink->hasSession('js')); - $this->assertFalse($this->mink->hasSession('my')); - - $this->mink->registerSession('my', $session); - - $this->assertTrue($this->mink->hasSession('my')); - $this->assertFalse($this->mink->hasSession('not_registered')); - $this->assertFalse($this->mink->hasSession('js')); - } - - public function testRegisterSessionThroughConstructor() - { - $mink = new Mink(array('my' => $this->getSessionMock())); - - $this->assertTrue($mink->hasSession('my')); - } - - public function testSessionAutostop() - { - $session1 = $this->getSessionMock(); - $session2 = $this->getSessionMock(); - $this->mink->registerSession('my1', $session1); - $this->mink->registerSession('my2', $session2); - - $session1 - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session1 - ->expects($this->once()) - ->method('stop'); - $session2 - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session2 - ->expects($this->never()) - ->method('stop'); - - unset($this->mink); - } - - public function testNotStartedSession() - { - $session = $this->getSessionMock(); - - $session - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session - ->expects($this->once()) - ->method('start'); - - $this->mink->registerSession('mock_session', $session); - $this->assertSame($session, $this->mink->getSession('mock_session')); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->getSession('not_registered'); - } - - public function testGetAlreadyStartedSession() - { - $session = $this->getSessionMock(); - - $session - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session - ->expects($this->never()) - ->method('start'); - - $this->mink->registerSession('mock_session', $session); - $this->assertSame($session, $this->mink->getSession('mock_session')); - } - - public function testSetDefaultSessionName() - { - $this->assertNull($this->mink->getDefaultSessionName()); - - $session = $this->getSessionMock(); - $this->mink->registerSession('session_name', $session); - $this->mink->setDefaultSessionName('session_name'); - - $this->assertEquals('session_name', $this->mink->getDefaultSessionName()); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->setDefaultSessionName('not_registered'); - } - - public function testGetDefaultSession() - { - $session1 = $this->getSessionMock(); - $session2 = $this->getSessionMock(); - - $this->assertNotSame($session1, $session2); - - $this->mink->registerSession('session_1', $session1); - $this->mink->registerSession('session_2', $session2); - $this->mink->setDefaultSessionName('session_2'); - - $this->assertSame($session1, $this->mink->getSession('session_1')); - $this->assertSame($session2, $this->mink->getSession('session_2')); - $this->assertSame($session2, $this->mink->getSession()); - - $this->mink->setDefaultSessionName('session_1'); - - $this->assertSame($session1, $this->mink->getSession()); - } - - public function testGetNoDefaultSession() - { - $session1 = $this->getSessionMock(); - - $this->mink->registerSession('session_1', $session1); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->getSession(); - } - - public function testIsSessionStarted() - { - $session_1 = $this->getSessionMock(); - $session_2 = $this->getSessionMock(); - - $session_1 - ->expects($this->any()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session_1 - ->expects($this->never()) - ->method('start'); - - $session_2 - ->expects($this->any()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session_2 - ->expects($this->never()) - ->method('start'); - - $this->mink->registerSession('not_started', $session_1); - $this->assertFalse($this->mink->isSessionStarted('not_started')); - - $this->mink->registerSession('started', $session_2); - $this->assertTrue($this->mink->isSessionStarted('started')); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->getSession('not_registered'); - } - - public function testAssertSession() - { - $session = $this->getSessionMock(); - - $this->mink->registerSession('my', $session); - - $this->assertInstanceOf('Behat\Mink\WebAssert', $this->mink->assertSession('my')); - } - - public function testAssertSessionNotRegistered() - { - $session = $this->getSessionMock(); - - $this->assertInstanceOf('Behat\Mink\WebAssert', $this->mink->assertSession($session)); - } - - public function testResetSessions() - { - $session1 = $this->getSessionMock(); - $session1->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session1->expects($this->never()) - ->method('reset'); - - $session2 = $this->getSessionMock(); - $session2->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session2->expects($this->once()) - ->method('reset'); - - $this->mink->registerSession('not started', $session1); - $this->mink->registerSession('started', $session2); - - $this->mink->resetSessions(); - } - - public function testRestartSessions() - { - $session1 = $this->getSessionMock(); - $session1->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session1->expects($this->never()) - ->method('restart'); - - $session2 = $this->getSessionMock(); - $session2->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session2->expects($this->once()) - ->method('restart'); - - $this->mink->registerSession('not started', $session1); - $this->mink->registerSession('started', $session2); - - $this->mink->restartSessions(); - } - - private function getSessionMock() - { - return $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/vendor/behat/mink/tests/Selector/CssSelectorTest.php b/vendor/behat/mink/tests/Selector/CssSelectorTest.php deleted file mode 100644 index ea80d93..0000000 --- a/vendor/behat/mink/tests/Selector/CssSelectorTest.php +++ /dev/null @@ -1,41 +0,0 @@ -markTestSkipped('Symfony2 CssSelector component not installed'); - } - } - - public function testSelector() - { - $selector = new CssSelector(); - - $this->assertEquals('descendant-or-self::h3', $selector->translateToXPath('h3')); - $this->assertEquals('descendant-or-self::h3/span', $selector->translateToXPath('h3 > span')); - - if (interface_exists('Symfony\Component\CssSelector\XPath\TranslatorInterface')) { - // The rewritten component of Symfony 2.3 checks for attribute existence first for the class. - $expectation = "descendant-or-self::h3/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]"; - } else { - $expectation = "descendant-or-self::h3/*[contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]"; - } - $this->assertEquals($expectation, $selector->translateToXPath('h3 > .my_div')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsForArrayLocator() - { - $selector = new CssSelector(); - - $selector->translateToXPath(array('h3')); - } -} diff --git a/vendor/behat/mink/tests/Selector/ExactNamedSelectorTest.php b/vendor/behat/mink/tests/Selector/ExactNamedSelectorTest.php deleted file mode 100644 index df51f0f..0000000 --- a/vendor/behat/mink/tests/Selector/ExactNamedSelectorTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getSelector(); - - $selector->registerNamedXpath('some', 'my_xpath'); - $this->assertEquals('my_xpath', $selector->translateToXPath('some')); - - $this->setExpectedException('InvalidArgumentException'); - - $selector->translateToXPath('custom'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testInvalidLocator() - { - $namedSelector = $this->getSelector(); - - $namedSelector->translateToXPath(array('foo', 'bar', 'baz')); - } - - /** - * @dataProvider getSelectorTests - */ - public function testSelectors($fixtureFile, $selector, $locator, $expectedExactCount, $expectedPartialCount = null) - { - $expectedCount = $this->allowPartialMatch() && null !== $expectedPartialCount - ? $expectedPartialCount - : $expectedExactCount; - - // Don't use "loadHTMLFile" due HHVM 3.3.0 issue. - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->loadHTML(file_get_contents(__DIR__.'/fixtures/'.$fixtureFile)); - - $namedSelector = $this->getSelector(); - - $xpath = $namedSelector->translateToXPath(array($selector, $locator)); - - $domXpath = new \DOMXPath($dom); - $nodeList = $domXpath->query($xpath); - - $this->assertEquals($expectedCount, $nodeList->length); - } - - /** - * @dataProvider getSelectorTests - * @group legacy - */ - public function testEscapedSelectors($fixtureFile, $selector, $locator, $expectedExactCount, $expectedPartialCount = null) - { - // Escape the locator as Mink 1.x expects the caller of the NamedSelector to handle it - $escaper = new Escaper(); - $locator = $escaper->escapeLiteral($locator); - - $this->testSelectors($fixtureFile, $selector, $locator, $expectedExactCount, $expectedPartialCount); - } - - public function getSelectorTests() - { - $fieldCount = 8; // fields without `type` attribute - $fieldCount += 4; // fields with `type=checkbox` attribute - $fieldCount += 4; // fields with `type=radio` attribute - $fieldCount += 4; // fields with `type=file` attribute - - // Fixture file, selector name, locator, expected number of exact matched elements, expected number of partial matched elements if different - return array( - 'fieldset' => array('test.html', 'fieldset', 'fieldset-text', 2, 3), - - 'field (name/placeholder/label)' => array('test.html', 'field', 'the-field', $fieldCount), - 'field (input, with-id)' => array('test.html', 'field', 'the-field-input', 1), - 'field (textarea, with-id)' => array('test.html', 'field', 'the-field-textarea', 1), - 'field (select, with-id)' => array('test.html', 'field', 'the-field-select', 1), - 'field (input type=submit, with-id) ignored' => array('test.html', 'field', 'the-field-submit-button', 0), - 'field (input type=image, with-id) ignored' => array('test.html', 'field', 'the-field-image-button', 0), - 'field (input type=button, with-id) ignored' => array('test.html', 'field', 'the-field-button-button', 0), - 'field (input type=reset, with-id) ignored' => array('test.html', 'field', 'the-field-reset-button', 0), - 'field (input type=hidden, with-id) ignored' => array('test.html', 'field', 'the-field-hidden', 0), - - 'link (with-href)' => array('test.html', 'link', 'link-text', 5, 9), - 'link (without-href) ignored' => array('test.html', 'link', 'bad-link-text', 0), - 'link* (role=link)' => array('test.html', 'link', 'link-role-text', 4, 7), - - 'button (input, name/value/title)' => array('test.html', 'button', 'button-text', 25, 42), - 'button (type=image, with-alt)' => array('test.html', 'button', 'button-alt-text', 1, 2), - 'button (input type=submit, with-id)' => array('test.html', 'button', 'input-submit-button', 1), - 'button (input type=image, with-id)' => array('test.html', 'button', 'input-image-button', 1), - 'button (input type=button, with-id)' => array('test.html', 'button', 'input-button-button', 1), - 'button (input type=reset, with-id)' => array('test.html', 'button', 'input-reset-button', 1), - 'button (button type=submit, with-id)' => array('test.html', 'button', 'button-submit-button', 1), - 'button (button type=image, with-id)' => array('test.html', 'button', 'button-image-button', 1), - 'button (button type=button, with-id)' => array('test.html', 'button', 'button-button-button', 1), - 'button (button type=reset, with-id)' => array('test.html', 'button', 'button-reset-button', 1), - 'button* (role=button, name/value/title)' => array('test.html', 'button', 'button-role-text', 12, 20), - 'button* (role=button type=submit, with-id)' => array('test.html', 'button', 'role-button-submit-button', 1), - 'button* (role=button type=image, with-id)' => array('test.html', 'button', 'role-button-image-button', 1), - 'button* (role=button type=button, with-id)' => array('test.html', 'button', 'role-button-button-button', 1), - 'button* (role=button type=reset, with-id)' => array('test.html', 'button', 'role-button-reset-button', 1), - - 'link_or_button (with-href)' => array('test.html', 'link_or_button', 'link-text', 5, 9), - 'link_or_button (without-href) ignored' => array('test.html', 'link_or_button', 'bad-link-text', 0), - 'link_or_button* (role=link)' => array('test.html', 'link_or_button', 'link-role-text', 4, 7), - - // bug in selector: 17 instead of 25 and 34 instead of 42, because 8 buttons with `name` attribute were not matched - 'link_or_button (input, name/value/title)' => array('test.html', 'link_or_button', 'button-text', 17, 34), - 'link_or_button (type=image, with-alt)' => array('test.html', 'link_or_button', 'button-alt-text', 1, 2), - 'link_or_button (input type=submit, with-id)' => array('test.html', 'link_or_button', 'input-submit-button', 1), - 'link_or_button (input type=image, with-id)' => array('test.html', 'link_or_button', 'input-image-button', 1), - 'link_or_button (input type=button, with-id)' => array('test.html', 'link_or_button', 'input-button-button', 1), - 'link_or_button (input type=reset, with-id)' => array('test.html', 'link_or_button', 'input-reset-button', 1), - 'link_or_button (button type=submit, with-id)' => array('test.html', 'link_or_button', 'button-submit-button', 1), - 'link_or_button (button type=image, with-id)' => array('test.html', 'link_or_button', 'button-image-button', 1), - 'link_or_button (button type=button, with-id)' => array('test.html', 'link_or_button', 'button-button-button', 1), - 'link_or_button (button type=reset, with-id)' => array('test.html', 'link_or_button', 'button-reset-button', 1), - - // bug in selector: 8 instead of 12 and 16 instead of 20, because 4 buttons with `name` attribute were not matched - 'link_or_button* (role=button, name/value/title)' => array('test.html', 'link_or_button', 'button-role-text', 8, 16), - 'link_or_button* (role=button type=submit, with-id)' => array('test.html', 'link_or_button', 'role-button-submit-button', 1), - 'link_or_button* (role=button type=image, with-id)' => array('test.html', 'link_or_button', 'role-button-image-button', 1), - 'link_or_button* (role=button type=button, with-id)' => array('test.html', 'link_or_button', 'role-button-button-button', 1), - 'link_or_button* (role=button type=reset, with-id)' => array('test.html', 'link_or_button', 'role-button-reset-button', 1), - - // 3 matches, because matches every HTML node in path: html > body > div - 'content' => array('test.html', 'content', 'content-text', 1, 4), - 'content with quotes' => array('test.html', 'content', 'some "quoted" content', 1, 3), - - 'select (name/label)' => array('test.html', 'select', 'the-field', 3), - 'select (with-id)' => array('test.html', 'select', 'the-field-select', 1), - - 'checkbox (name/label)' => array('test.html', 'checkbox', 'the-field', 3), - 'checkbox (with-id)' => array('test.html', 'checkbox', 'the-field-checkbox', 1), - - 'radio (name/label)' => array('test.html', 'radio', 'the-field', 3), - 'radio (with-id)' => array('test.html', 'radio', 'the-field-radio', 1), - - 'file (name/label)' => array('test.html', 'file', 'the-field', 3), - 'file (with-id)' => array('test.html', 'file', 'the-field-file', 1), - - 'optgroup' => array('test.html', 'optgroup', 'group-label', 1, 2), - - 'option' => array('test.html', 'option', 'option-value', 2, 3), - - 'table' => array('test.html', 'table', 'the-table', 2, 3), - - 'id' => array('test.html', 'id', 'bad-link-text', 1), - 'id or name' => array('test.html', 'id_or_name', 'the-table', 2), - ); - } - - /** - * @return NamedSelector - */ - abstract protected function getSelector(); - - /** - * @return bool - */ - abstract protected function allowPartialMatch(); -} diff --git a/vendor/behat/mink/tests/Selector/PartialNamedSelectorTest.php b/vendor/behat/mink/tests/Selector/PartialNamedSelectorTest.php deleted file mode 100644 index c3e631a..0000000 --- a/vendor/behat/mink/tests/Selector/PartialNamedSelectorTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(); - - $this->assertFalse($handler->isSelectorRegistered('custom')); - - $handler->registerSelector('custom', $selector); - - $this->assertTrue($handler->isSelectorRegistered('custom')); - $this->assertSame($selector, $handler->getSelector('custom')); - } - - public function testRegisterSelectorThroughConstructor() - { - $selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(array('custom' => $selector)); - - $this->assertTrue($handler->isSelectorRegistered('custom')); - $this->assertSame($selector, $handler->getSelector('custom')); - } - - public function testRegisterDefaultSelectors() - { - $handler = new SelectorsHandler(); - - $this->assertTrue($handler->isSelectorRegistered('css')); - $this->assertTrue($handler->isSelectorRegistered('named_exact')); - $this->assertTrue($handler->isSelectorRegistered('named_partial')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testXpathSelectorThrowsExceptionForArrayLocator() - { - $handler = new SelectorsHandler(); - $handler->selectorToXpath('xpath', array('some_xpath')); - } - - public function testXpathSelectorIsReturnedAsIs() - { - $handler = new SelectorsHandler(); - $this->assertEquals('some_xpath', $handler->selectorToXpath('xpath', 'some_xpath')); - } - - public function testSelectorToXpath() - { - $selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(); - - $handler->registerSelector('custom_selector', $selector); - - $selector - ->expects($this->once()) - ->method('translateToXPath') - ->with($locator = 'some[locator]') - ->will($this->returnValue($ret = '[]some[]locator')); - - $this->assertEquals($ret, $handler->selectorToXpath('custom_selector', $locator)); - - $this->setExpectedException('InvalidArgumentException'); - $handler->selectorToXpath('undefined', 'asd'); - } - - /** - * @group legacy - */ - public function testXpathLiteral() - { - $handler = new SelectorsHandler(); - - $this->assertEquals("'some simple string'", $handler->xpathLiteral('some simple string')); - } - - /** - * @group legacy - */ - public function testBcLayer() - { - $selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(); - - $handler->registerSelector('named_partial', $selector); - - $this->assertSame($selector, $handler->getSelector('named')); - } -} diff --git a/vendor/behat/mink/tests/Selector/Xpath/EscaperTest.php b/vendor/behat/mink/tests/Selector/Xpath/EscaperTest.php deleted file mode 100644 index 535dac6..0000000 --- a/vendor/behat/mink/tests/Selector/Xpath/EscaperTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals($expected, $escaper->escapeLiteral($string)); - } - - public function getXpathLiterals() - { - return array( - array('some simple string', "'some simple string'"), - array('some "d-brackets" string', "'some \"d-brackets\" string'"), - array('some \'s-brackets\' string', "\"some 's-brackets' string\""), - array( - 'some \'s-brackets\' and "d-brackets" string', - 'concat(\'some \',"\'",\'s-brackets\',"\'",\' and "d-brackets" string\')', - ), - ); - } -} diff --git a/vendor/behat/mink/tests/Selector/Xpath/ManipulatorTest.php b/vendor/behat/mink/tests/Selector/Xpath/ManipulatorTest.php deleted file mode 100644 index 7c20561..0000000 --- a/vendor/behat/mink/tests/Selector/Xpath/ManipulatorTest.php +++ /dev/null @@ -1,64 +0,0 @@ -assertEquals($expectedXpath, $manipulator->prepend($xpath, $prefix)); - } - - public function getPrependedXpath() - { - return array( - 'simple' => array( - 'some_xpath', - 'some_tag1', - 'some_xpath/some_tag1', - ), - 'with slash' => array( - 'some_xpath', - '/some_tag1', - 'some_xpath/some_tag1', - ), - 'union' => array( - 'some_xpath', - 'some_tag1 | some_tag2', - 'some_xpath/some_tag1 | some_xpath/some_tag2', - ), - 'wrapped union' => array( - 'some_xpath', - '(some_tag1 | some_tag2)/some_child', - '(some_xpath/some_tag1 | some_xpath/some_tag2)/some_child', - ), - 'multiple wrapped union' => array( - 'some_xpath', - '( ( some_tag1 | some_tag2)/some_child | some_tag3)/leaf', - '( ( some_xpath/some_tag1 | some_xpath/some_tag2)/some_child | some_xpath/some_tag3)/leaf', - ), - 'parent union' => array( - 'some_xpath | another_xpath', - 'some_tag1 | some_tag2', - '(some_xpath | another_xpath)/some_tag1 | (some_xpath | another_xpath)/some_tag2', - ), - 'complex condition' => array( - 'some_xpath', - 'some_tag1 | some_tag2[@foo = "bar|"] | some_tag3[foo | bar]', - 'some_xpath/some_tag1 | some_xpath/some_tag2[@foo = "bar|"] | some_xpath/some_tag3[foo | bar]', - ), - 'multiline' => array( - 'some_xpath', - "some_tag1 | some_tag2[@foo =\n 'bar|'']\n | some_tag3[foo | bar]", - "some_xpath/some_tag1 | some_xpath/some_tag2[@foo =\n 'bar|''] | some_xpath/some_tag3[foo | bar]", - ), - ); - } -} diff --git a/vendor/behat/mink/tests/Selector/fixtures/test.html b/vendor/behat/mink/tests/Selector/fixtures/test.html deleted file mode 100644 index 1190e9e..0000000 --- a/vendor/behat/mink/tests/Selector/fixtures/test.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - -
- -
- -
- fieldset-text -
- -
- fieldset-text sample -
- - -
fieldset-text
-
-
- -
- content-text -
- -
- some content-text -
- -
some "quoted" content
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
- -
- - - - - -
- -
- - - - - -
- - -
- -
- -
- - -
the-table
- - - -
some the-table
- - - - - - - -
the-tablethe-table
-
- - - - diff --git a/vendor/behat/mink/tests/SessionTest.php b/vendor/behat/mink/tests/SessionTest.php deleted file mode 100644 index 3e0104a..0000000 --- a/vendor/behat/mink/tests/SessionTest.php +++ /dev/null @@ -1,312 +0,0 @@ -driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock(); - $this->selectorsHandler = $this->getMockBuilder('Behat\Mink\Selector\SelectorsHandler')->getMock(); - $this->session = new Session($this->driver, $this->selectorsHandler); - } - - public function testGetDriver() - { - $this->assertSame($this->driver, $this->session->getDriver()); - } - - public function testGetPage() - { - $this->assertInstanceOf('Behat\Mink\Element\DocumentElement', $this->session->getPage()); - } - - public function testGetSelectorsHandler() - { - $this->assertSame($this->selectorsHandler, $this->session->getSelectorsHandler()); - } - - public function testInstantiateWithoutOptionalDeps() - { - $session = new Session($this->driver); - - $this->assertInstanceOf('Behat\Mink\Selector\SelectorsHandler', $session->getSelectorsHandler()); - } - - public function testIsStarted() - { - $this->driver->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - - $this->assertTrue($this->session->isStarted()); - } - - public function testStart() - { - $this->driver->expects($this->once()) - ->method('start'); - - $this->session->start(); - } - - public function testStop() - { - $this->driver->expects($this->once()) - ->method('stop'); - - $this->session->stop(); - } - - public function testRestart() - { - $this->driver->expects($this->at(0)) - ->method('stop'); - $this->driver->expects($this->at(1)) - ->method('start'); - - $this->session->restart(); - } - - public function testVisit() - { - $this->driver - ->expects($this->once()) - ->method('visit') - ->with($url = 'some_url'); - - $this->session->visit($url); - } - - public function testReset() - { - $this->driver - ->expects($this->once()) - ->method('reset'); - - $this->session->reset(); - } - - public function testSetBasicAuth() - { - $this->driver->expects($this->once()) - ->method('setBasicAuth') - ->with('user', 'pass'); - - $this->session->setBasicAuth('user', 'pass'); - } - - public function testSetRequestHeader() - { - $this->driver->expects($this->once()) - ->method('setRequestHeader') - ->with('name', 'value'); - - $this->session->setRequestHeader('name', 'value'); - } - - public function testGetResponseHeaders() - { - $this->driver - ->expects($this->once()) - ->method('getResponseHeaders') - ->will($this->returnValue($ret = array(2, 3, 4))); - - $this->assertEquals($ret, $this->session->getResponseHeaders()); - } - - /** - * @dataProvider provideResponseHeader - */ - public function testGetResponseHeader($expected, $name, array $headers) - { - $this->driver->expects($this->once()) - ->method('getResponseHeaders') - ->willReturn($headers); - - $this->assertSame($expected, $this->session->getResponseHeader($name)); - } - - public function provideResponseHeader() - { - return array( - array('test', 'Mink', array('Mink' => 'test')), - array('test', 'mink', array('Mink' => 'test')), - array('test', 'Mink', array('mink' => 'test')), - array('test', 'Mink', array('Mink' => array('test', 'test2'))), - array(null, 'other', array('Mink' => 'test')), - ); - } - - public function testSetCookie() - { - $this->driver->expects($this->once()) - ->method('setCookie') - ->with('name', 'value'); - - $this->session->setCookie('name', 'value'); - } - - public function testGetCookie() - { - $this->driver->expects($this->once()) - ->method('getCookie') - ->with('name') - ->will($this->returnValue('value')); - - $this->assertEquals('value', $this->session->getCookie('name')); - } - - public function testGetStatusCode() - { - $this->driver - ->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue($ret = 404)); - - $this->assertEquals($ret, $this->session->getStatusCode()); - } - - public function testGetCurrentUrl() - { - $this->driver - ->expects($this->once()) - ->method('getCurrentUrl') - ->will($this->returnValue($ret = 'http://some.url')); - - $this->assertEquals($ret, $this->session->getCurrentUrl()); - } - - public function testGetScreenshot() - { - $this->driver->expects($this->once()) - ->method('getScreenshot') - ->will($this->returnValue('screenshot')); - - $this->assertEquals('screenshot', $this->session->getScreenshot()); - } - - public function testGetWindowNames() - { - $this->driver->expects($this->once()) - ->method('getWindowNames') - ->will($this->returnValue($names = array('window 1', 'window 2'))); - - $this->assertEquals($names, $this->session->getWindowNames()); - } - - public function testGetWindowName() - { - $this->driver->expects($this->once()) - ->method('getWindowName') - ->will($this->returnValue('name')); - - $this->assertEquals('name', $this->session->getWindowName()); - } - - public function testReload() - { - $this->driver->expects($this->once()) - ->method('reload'); - - $this->session->reload(); - } - - public function testBack() - { - $this->driver->expects($this->once()) - ->method('back'); - - $this->session->back(); - } - - public function testForward() - { - $this->driver->expects($this->once()) - ->method('forward'); - - $this->session->forward(); - } - - public function testSwitchToWindow() - { - $this->driver->expects($this->once()) - ->method('switchToWindow') - ->with('test'); - - $this->session->switchToWindow('test'); - } - - public function testSwitchToIFrame() - { - $this->driver->expects($this->once()) - ->method('switchToIFrame') - ->with('test'); - - $this->session->switchToIFrame('test'); - } - - public function testExecuteScript() - { - $this->driver - ->expects($this->once()) - ->method('executeScript') - ->with($arg = 'JS'); - - $this->session->executeScript($arg); - } - - public function testEvaluateScript() - { - $this->driver - ->expects($this->once()) - ->method('evaluateScript') - ->with($arg = 'JS func') - ->will($this->returnValue($ret = '23')); - - $this->assertEquals($ret, $this->session->evaluateScript($arg)); - } - - public function testWait() - { - $this->driver - ->expects($this->once()) - ->method('wait') - ->with(1000, 'function () {}'); - - $this->session->wait(1000, 'function () {}'); - } - - public function testResizeWindow() - { - $this->driver->expects($this->once()) - ->method('resizeWindow') - ->with(800, 600, 'test'); - - $this->session->resizeWindow(800, 600, 'test'); - } - - public function testMaximizeWindow() - { - $this->driver->expects($this->once()) - ->method('maximizeWindow') - ->with('test'); - - $this->session->maximizeWindow('test'); - } -} diff --git a/vendor/behat/mink/tests/WebAssertTest.php b/vendor/behat/mink/tests/WebAssertTest.php deleted file mode 100644 index ef55d2d..0000000 --- a/vendor/behat/mink/tests/WebAssertTest.php +++ /dev/null @@ -1,1297 +0,0 @@ -session = $this->getMockBuilder('Behat\\Mink\\Session') - ->disableOriginalConstructor() - ->getMock(); - $this->session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($this->getMock('Behat\Mink\Driver\DriverInterface'))); - - $this->assert = new WebAssert($this->session); - } - - public function testAddressEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php/sub/url?param=true#webapp/nav')) - ; - - $this->assertCorrectAssertion('addressEquals', array('/sub/url#webapp/nav')); - $this->assertWrongAssertion( - 'addressEquals', - array('sub_url'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page is "/sub/url#webapp/nav", but "sub_url" expected.' - ); - } - - public function testAddressEqualsEmptyPath() - { - $this->session - ->expects($this->once()) - ->method('getCurrentUrl') - ->willReturn('http://example.com') - ; - - $this->assertCorrectAssertion('addressEquals', array('/')); - } - - public function testAddressEqualsEndingInScript() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php')) - ; - - $this->assertCorrectAssertion('addressEquals', array('/script.php')); - $this->assertWrongAssertion( - 'addressEquals', - array('/'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page is "/script.php", but "/" expected.' - ); - } - - public function testAddressNotEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php/sub/url')) - ; - - $this->assertCorrectAssertion('addressNotEquals', array('sub_url')); - $this->assertWrongAssertion( - 'addressNotEquals', - array('/sub/url'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page is "/sub/url", but should not be.' - ); - } - - public function testAddressNotEqualsEndingInScript() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php')) - ; - - $this->assertCorrectAssertion('addressNotEquals', array('/')); - $this->assertWrongAssertion( - 'addressNotEquals', - array('/script.php'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page is "/script.php", but should not be.' - ); - } - - public function testAddressMatches() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php/sub/url')) - ; - - $this->assertCorrectAssertion('addressMatches', array('/su.*rl/')); - $this->assertWrongAssertion( - 'addressMatches', - array('/suburl/'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page "/sub/url" does not match the regex "/suburl/".' - ); - } - - public function testCookieEquals() - { - $this->session-> - expects($this->any())-> - method('getCookie')-> - will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('cookieEquals', array('foo', 'bar')); - $this->assertWrongAssertion( - 'cookieEquals', - array('bar', 'foo'), - 'Behat\Mink\Exception\ExpectationException', - 'Cookie "bar" value is "baz", but should be "foo".' - ); - } - - public function testCookieExists() - { - $this->session-> - expects($this->any())-> - method('getCookie')-> - will($this->returnValueMap( - array( - array('foo', '1'), - array('bar', null), - ) - )); - - $this->assertCorrectAssertion('cookieExists', array('foo')); - $this->assertWrongAssertion( - 'cookieExists', - array('bar'), - 'Behat\Mink\Exception\ExpectationException', - 'Cookie "bar" is not set, but should be.' - ); - } - - public function testStatusCodeEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getStatusCode') - ->will($this->returnValue(200)) - ; - - $this->assertCorrectAssertion('statusCodeEquals', array(200)); - $this->assertWrongAssertion( - 'statusCodeEquals', - array(404), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current response status code is 200, but 404 expected.' - ); - } - - public function testStatusCodeNotEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getStatusCode') - ->will($this->returnValue(404)) - ; - - $this->assertCorrectAssertion('statusCodeNotEquals', array(200)); - $this->assertWrongAssertion( - 'statusCodeNotEquals', - array(404), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current response status code is 404, but should not be.' - ); - } - - public function testResponseHeaderEquals() - { - $this->session - ->expects($this->any()) - ->method('getResponseHeader') - ->will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('responseHeaderEquals', array('foo', 'bar')); - $this->assertWrongAssertion( - 'responseHeaderEquals', - array('bar', 'foo'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current response header "bar" is "baz", but "foo" expected.' - ); - } - - public function testResponseHeaderNotEquals() - { - $this->session - ->expects($this->any()) - ->method('getResponseHeader') - ->will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('responseHeaderNotEquals', array('foo', 'baz')); - $this->assertWrongAssertion( - 'responseHeaderNotEquals', - array('bar', 'baz'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current response header "bar" is "baz", but should not be.' - ); - } - - public function testResponseHeaderContains() - { - $this->session - ->expects($this->any()) - ->method('getResponseHeader') - ->will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('responseHeaderContains', array('foo', 'ba')); - $this->assertWrongAssertion( - 'responseHeaderContains', - array('bar', 'bz'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The text "bz" was not found anywhere in the "bar" response header.' - ); - } - - public function testResponseHeaderNotContains() - { - $this->session - ->expects($this->any()) - ->method('getResponseHeader') - ->will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('responseHeaderNotContains', array('foo', 'bz')); - $this->assertWrongAssertion( - 'responseHeaderNotContains', - array('bar', 'ba'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The text "ba" was found in the "bar" response header, but it should not.' - ); - } - - public function testResponseHeaderMatches() - { - $this->session - ->expects($this->any()) - ->method('getResponseHeader') - ->will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('responseHeaderMatches', array('foo', '/ba(.*)/')); - $this->assertWrongAssertion( - 'responseHeaderMatches', - array('bar', '/b[^a]/'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The pattern "/b[^a]/" was not found anywhere in the "bar" response header.' - ); - } - - public function testResponseHeaderNotMatches() - { - $this->session - ->expects($this->any()) - ->method('getResponseHeader') - ->will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('responseHeaderNotMatches', array('foo', '/bz/')); - $this->assertWrongAssertion( - 'responseHeaderNotMatches', - array('bar', '/b[ab]z/'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The pattern "/b[ab]z/" was found in the text of the "bar" response header, but it should not.' - ); - } - - public function testPageTextContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue("Some page\n\ttext")) - ; - - $this->assertCorrectAssertion('pageTextContains', array('PAGE text')); - $this->assertWrongAssertion( - 'pageTextContains', - array('html text'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The text "html text" was not found anywhere in the text of the current page.' - ); - } - - public function testPageTextNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue("Some html\n\ttext")) - ; - - $this->assertCorrectAssertion('pageTextNotContains', array('PAGE text')); - $this->assertWrongAssertion( - 'pageTextNotContains', - array('HTML text'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The text "HTML text" appears in the text of this page, but it should not.' - ); - } - - public function testPageTextMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('Some page text')) - ; - - $this->assertCorrectAssertion('pageTextMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'pageTextMatches', - array('/html/'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The pattern /html/ was not found anywhere in the text of the current page.' - ); - } - - public function testPageTextNotMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('Some html text')) - ; - - $this->assertCorrectAssertion('pageTextNotMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'pageTextNotMatches', - array('/HTML/i'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The pattern /HTML/i was found in the text of the current page, but it should not.' - ); - } - - public function testResponseContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some page text')) - ; - - $this->assertCorrectAssertion('responseContains', array('PAGE text')); - $this->assertWrongAssertion( - 'responseContains', - array('html text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "html text" was not found anywhere in the HTML response of the current page.' - ); - } - - public function testResponseNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some html text')) - ; - - $this->assertCorrectAssertion('responseNotContains', array('PAGE text')); - $this->assertWrongAssertion( - 'responseNotContains', - array('HTML text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "HTML text" appears in the HTML response of this page, but it should not.' - ); - } - - public function testResponseMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some page text')) - ; - - $this->assertCorrectAssertion('responseMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'responseMatches', - array('/html/'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The pattern /html/ was not found anywhere in the HTML response of the page.' - ); - } - - public function testResponseNotMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some html text')) - ; - - $this->assertCorrectAssertion('responseNotMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'responseNotMatches', - array('/HTML/i'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The pattern /HTML/i was found in the HTML response of the page, but it should not.' - ); - } - - public function testElementsCount() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findAll') - ->with('css', 'h2 > span') - ->will($this->returnValue(array(1, 2))) - ; - - $this->assertCorrectAssertion('elementsCount', array('css', 'h2 > span', 2)); - $this->assertWrongAssertion( - 'elementsCount', - array('css', 'h2 > span', 3), - 'Behat\\Mink\\Exception\\ExpectationException', - '2 elements matching css "h2 > span" found on the page, but should be 3.' - ); - } - - public function testElementExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->onConsecutiveCalls(1, null, 1, null)) - ; - - $this->assertCorrectAssertion('elementExists', array('css', 'h2 > span')); - $this->assertWrongAssertion( - 'elementExists', - array('css', 'h2 > span'), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Element matching css "h2 > span" not found.' - ); - - $this->assertCorrectAssertion('elementExists', array('css', 'h2 > span', $page)); - $this->assertWrongAssertion( - 'elementExists', - array('css', 'h2 > span', $page), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Element matching css "h2 > span" not found.' - ); - } - - public function testElementExistsWithArrayLocator() - { - $container = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session->expects($this->never()) - ->method('getPage') - ; - - $container - ->expects($this->exactly(2)) - ->method('find') - ->with('named', array('element', 'Test')) - ->will($this->onConsecutiveCalls(1, null)) - ; - - $this->assertCorrectAssertion('elementExists', array('named', array('element', 'Test'), $container)); - $this->assertWrongAssertion( - 'elementExists', - array('named', array('element', 'Test'), $container), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Element with named "element Test" not found.' - ); - } - - public function testElementNotExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->onConsecutiveCalls(null, 1, null, 1)) - ; - - $this->assertCorrectAssertion('elementNotExists', array('css', 'h2 > span')); - $this->assertWrongAssertion( - 'elementNotExists', - array('css', 'h2 > span'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'An element matching css "h2 > span" appears on this page, but it should not.' - ); - - $this->assertCorrectAssertion('elementNotExists', array('css', 'h2 > span', $page)); - $this->assertWrongAssertion( - 'elementNotExists', - array('css', 'h2 > span', $page), - 'Behat\\Mink\\Exception\\ExpectationException', - 'An element matching css "h2 > span" appears on this page, but it should not.' - ); - } - - /** - * @dataProvider getArrayLocatorFormats - */ - public function testElementNotExistsArrayLocator($selector, $locator, $expectedMessage) - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->once()) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->once()) - ->method('find') - ->with($selector, $locator) - ->will($this->returnValue(1)) - ; - - $this->assertWrongAssertion( - 'elementNotExists', - array($selector, $locator), - 'Behat\\Mink\\Exception\\ExpectationException', - $expectedMessage - ); - } - - public function getArrayLocatorFormats() - { - return array( - 'named' => array( - 'named', - array('button', 'Test'), - 'An button matching locator "Test" appears on this page, but it should not.', - ), - 'custom' => array( - 'custom', - array('test', 'foo'), - 'An element matching custom "test foo" appears on this page, but it should not.', - ), - ); - } - - public function testElementTextContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('element text')) - ; - - $this->assertCorrectAssertion('elementTextContains', array('css', 'h2 > span', 'text')); - $this->assertWrongAssertion( - 'elementTextContains', - array('css', 'h2 > span', 'html'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The text "html" was not found in the text of the element matching css "h2 > span".' - ); - } - - public function testElementTextNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('element text')) - ; - - $this->assertCorrectAssertion('elementTextNotContains', array('css', 'h2 > span', 'html')); - $this->assertWrongAssertion( - 'elementTextNotContains', - array('css', 'h2 > span', 'text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The text "text" appears in the text of the element matching css "h2 > span", but it should not.' - ); - } - - public function testElementContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getHtml') - ->will($this->returnValue('element html')) - ; - - $this->assertCorrectAssertion('elementContains', array('css', 'h2 > span', 'html')); - $this->assertWrongAssertion( - 'elementContains', - array('css', 'h2 > span', 'text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "text" was not found in the HTML of the element matching css "h2 > span".' - ); - } - - public function testElementNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getHtml') - ->will($this->returnValue('element html')) - ; - - $this->assertCorrectAssertion('elementNotContains', array('css', 'h2 > span', 'text')); - $this->assertWrongAssertion( - 'elementNotContains', - array('css', 'h2 > span', 'html'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "html" appears in the HTML of the element matching css "h2 > span", but it should not.' - ); - } - - public function testElementAttributeContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('hasAttribute') - ->will($this->returnValue(true)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getAttribute') - ->with('name') - ->will($this->returnValue('foo')) - ; - - $this->assertCorrectAssertion('elementAttributeContains', array('css', 'h2 > span', 'name', 'foo')); - $this->assertWrongAssertion( - 'elementAttributeContains', - array('css', 'h2 > span', 'name', 'bar'), - 'Behat\\Mink\\Exception\\ElementHtmlException', - 'The text "bar" was not found in the attribute "name" of the element matching css "h2 > span".' - ); - } - - public function testElementAttributeExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->at(0)) - ->method('hasAttribute') - ->with('name') - ->will($this->returnValue(true)) - ; - - $element - ->expects($this->at(1)) - ->method('hasAttribute') - ->with('name') - ->will($this->returnValue(false)) - ; - - $this->assertCorrectAssertion('elementAttributeExists', array('css', 'h2 > span', 'name')); - $this->assertWrongAssertion( - 'elementAttributeExists', - array('css', 'h2 > span', 'name'), - 'Behat\\Mink\\Exception\\ElementHtmlException', - 'The attribute "name" was not found in the element matching css "h2 > span".' - ); - } - - public function testElementAttributeNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('hasAttribute') - ->will($this->returnValue(true)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getAttribute') - ->with('name') - ->will($this->returnValue('foo')) - ; - - $this->assertCorrectAssertion('elementAttributeNotContains', array('css', 'h2 > span', 'name', 'bar')); - $this->assertWrongAssertion( - 'elementAttributeNotContains', - array('css', 'h2 > span', 'name', 'foo'), - 'Behat\\Mink\\Exception\\ElementHtmlException', - 'The text "foo" was found in the attribute "name" of the element matching css "h2 > span".' - ); - } - - public function testFieldExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('username') - ->will($this->onConsecutiveCalls($element, null)) - ; - - $this->assertCorrectAssertion('fieldExists', array('username')); - $this->assertWrongAssertion( - 'fieldExists', - array('username'), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Form field with id|name|label|value "username" not found.' - ); - } - - public function testFieldNotExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('username') - ->will($this->onConsecutiveCalls(null, $element)) - ; - - $this->assertCorrectAssertion('fieldNotExists', array('username')); - $this->assertWrongAssertion( - 'fieldNotExists', - array('username'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'A field "username" appears on this page, but it should not.' - ); - } - - public function testFieldValueEquals() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(4)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('findField') - ->with('username') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(4)) - ->method('getValue') - ->will($this->returnValue(234)) - ; - - $this->assertCorrectAssertion('fieldValueEquals', array('username', 234)); - $this->assertWrongAssertion( - 'fieldValueEquals', - array('username', 235), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "234", but "235" expected.' - ); - $this->assertWrongAssertion( - 'fieldValueEquals', - array('username', 23), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "234", but "23" expected.' - ); - $this->assertWrongAssertion( - 'fieldValueEquals', - array('username', ''), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "234", but "" expected.' - ); - } - - public function testFieldValueNotEquals() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(4)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('findField') - ->with('username') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(4)) - ->method('getValue') - ->will($this->returnValue(235)) - ; - - $this->assertCorrectAssertion('fieldValueNotEquals', array('username', 234)); - $this->assertWrongAssertion( - 'fieldValueNotEquals', - array('username', 235), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "235", but it should not be.' - ); - $this->assertCorrectAssertion('fieldValueNotEquals', array('username', 23)); - $this->assertCorrectAssertion('fieldValueNotEquals', array('username', '')); - } - - public function testCheckboxChecked() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('remember_me') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(true, false)) - ; - - $this->assertCorrectAssertion('checkboxChecked', array('remember_me')); - $this->assertWrongAssertion( - 'checkboxChecked', - array('remember_me'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Checkbox "remember_me" is not checked, but it should be.' - ); - } - - public function testCheckboxNotChecked() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('remember_me') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(false, true)) - ; - - $this->assertCorrectAssertion('checkboxNotChecked', array('remember_me')); - $this->assertWrongAssertion( - 'checkboxNotChecked', - array('remember_me'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Checkbox "remember_me" is checked, but it should not be.' - ); - } - - private function assertCorrectAssertion($assertion, $arguments) - { - try { - call_user_func_array(array($this->assert, $assertion), $arguments); - } catch (ExpectationException $e) { - $this->fail('Correct assertion should not throw an exception: '.$e->getMessage()); - } - } - - private function assertWrongAssertion($assertion, $arguments, $exceptionClass, $exceptionMessage) - { - if ('Behat\Mink\Exception\ExpectationException' !== $exceptionClass && !is_subclass_of($exceptionClass, 'Behat\Mink\Exception\ExpectationException')) { - throw new \LogicException('Wrong expected exception for the failed assertion. It should be a Behat\Mink\Exception\ExpectationException.'); - } - - try { - call_user_func_array(array($this->assert, $assertion), $arguments); - $this->fail('Wrong assertion should throw an exception'); - } catch (ExpectationException $e) { - $this->assertInstanceOf($exceptionClass, $e); - $this->assertSame($exceptionMessage, $e->getMessage()); - } - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index fdd91a9..c321463 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,25 +1,39 @@ [ { - "name": "psr/log", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "name": "composer/installers", + "version": "v1.0.21", + "version_normalized": "1.0.21.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "1.0.0" + "url": "https://github.com/composer/installers.git", + "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "1.0.0", + "url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", + "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", "shasum": "" }, - "time": "2012-12-21 11:40:51", - "type": "library", + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "4.1.*" + }, + "time": "2015-02-18 17:17:01", + "type": "composer-installer", + "extra": { + "class": "Composer\\Installers\\Installer", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "Psr\\Log\\": "" + "Composer\\Installers\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -28,57 +42,98 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" } ], - "description": "Common interface for logging libraries", + "description": "A multi-framework Composer library installer", + "homepage": "http://composer.github.com/installers/", "keywords": [ - "log", - "psr", - "psr-3" + "Craft", + "Dolibarr", + "Hurad", + "MODX Evo", + "OXID", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "bitrix", + "cakephp", + "chef", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "elgg", + "fuelphp", + "grav", + "installer", + "joomla", + "kohana", + "laravel", + "lithium", + "magento", + "mako", + "mediawiki", + "modulework", + "moodle", + "phpbb", + "piwik", + "ppi", + "puppet", + "roundcube", + "shopware", + "silverstripe", + "symfony", + "typo3", + "wordpress", + "zend", + "zikula" ] }, { - "name": "symfony-cmf/routing", - "version": "1.3.0", - "version_normalized": "1.3.0.0", + "name": "wikimedia/composer-merge-plugin", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony-cmf/Routing.git", - "reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6" + "url": "https://github.com/wikimedia/composer-merge-plugin.git", + "reference": "47bb3388cfeae41a38087ac8465a7d08fa92ea2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/8e87981d72c6930a27585dcd3119f3199f6cb2a6", - "reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6", + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/47bb3388cfeae41a38087ac8465a7d08fa92ea2e", + "reference": "47bb3388cfeae41a38087ac8465a7d08fa92ea2e", "shasum": "" }, "require": { - "php": ">=5.3.3", - "psr/log": "~1.0", - "symfony/http-kernel": "~2.2", - "symfony/routing": "~2.2" + "composer-plugin-api": "^1.0", + "php": ">=5.3.2" }, "require-dev": { - "symfony/config": "~2.2", - "symfony/dependency-injection": "~2.0@stable", - "symfony/event-dispatcher": "~2.1" - }, - "suggest": { - "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version ~2.1" + "composer/composer": "1.0.*@dev", + "jakub-onderka/php-parallel-lint": "~0.8", + "phpspec/prophecy-phpunit": "~1.0", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.1.0" }, - "time": "2014-10-20 20:55:17", - "type": "library", + "time": "2015-09-22 21:14:25", + "type": "composer-plugin", "extra": { "branch-alias": { - "dev-master": "1.3-dev" - } + "dev-master": "1.3.x-dev" + }, + "class": "Wikimedia\\Composer\\MergePlugin" }, "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Cmf\\Component\\Routing\\": "" + "Wikimedia\\Composer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -87,162 +142,163 @@ ], "authors": [ { - "name": "Symfony CMF Community", - "homepage": "https://github.com/symfony-cmf/Routing/contributors" + "name": "Bryan Davis", + "email": "bd808@wikimedia.org" } ], - "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", - "homepage": "http://cmf.symfony.com", - "keywords": [ - "database", - "routing" - ] + "description": "Composer plugin to merge multiple composer.json files" }, { - "name": "sebastian/global-state", + "name": "composer/semver", "version": "1.0.0", "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "url": "https://github.com/composer/semver.git", + "reference": "d0e1ccc6d44ab318b758d709e19176037da6b1ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/composer/semver/zipball/d0e1ccc6d44ab318b758d709e19176037da6b1ba", + "reference": "d0e1ccc6d44ab318b758d709e19176037da6b1ba", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.2" }, "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "~2.3" }, - "time": "2014-10-06 09:23:50", + "time": "2015-09-21 09:42:36", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "0.1-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Composer\\Semver\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Rob Bast", + "email": "rob.bast@gmail.com" + }, + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "global state" + "semantic", + "semver", + "validation", + "versioning" ] }, { - "name": "sebastian/diff", - "version": "1.3.0", - "version_normalized": "1.3.0.0", + "name": "doctrine/lexer", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" + "php": ">=5.3.2" }, - "time": "2015-02-22 15:13:53", + "time": "2014-09-09 13:34:57", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Roman Borschel", + "email": "roman@code-factory.org" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", "keywords": [ - "diff" + "lexer", + "parser" ] }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "version_normalized": "2.0.4.0", + "name": "doctrine/inflector", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "url": "https://github.com/doctrine/inflector.git", + "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", + "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.2" }, "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "phpunit/phpunit": "4.*" }, - "time": "2015-02-03 12:10:50", + "time": "2014-12-20 21:24:13", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "phpDocumentor": [ - "src/" - ] + "Doctrine\\Common\\Inflector\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -251,40 +307,67 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" ] }, { - "name": "doctrine/lexer", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", + "name": "doctrine/collections", + "version": "v1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "url": "https://github.com/doctrine/collections.git", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", "shasum": "" }, "require": { "php": ">=5.3.2" }, - "time": "2014-09-09 13:34:57", + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2015-04-14 22:21:58", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "Doctrine\\Common\\Collections\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -297,50 +380,67 @@ "email": "roman@code-factory.org" }, { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "description": "Collections Abstraction library", "homepage": "http://www.doctrine-project.org", "keywords": [ - "lexer", - "parser" + "array", + "collections", + "iterator" ] }, { - "name": "psr/http-message", - "version": "1.0", - "version_normalized": "1.0.0.0", + "name": "doctrine/cache", + "version": "v1.4.2", + "version_normalized": "1.4.2.0", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + "url": "https://github.com/doctrine/cache.git", + "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "url": "https://api.github.com/repos/doctrine/cache/zipball/8c434000f420ade76a07c64cbe08ca47e5c101ca", + "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.2" }, - "time": "2015-05-04 20:22:00", + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7", + "predis/predis": "~1.0", + "satooshi/php-coveralls": "~0.6" + }, + "time": "2015-08-31 12:36:41", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.5.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" + "psr-0": { + "Doctrine\\Common\\Cache\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -349,52 +449,67 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "Common interface for HTTP messages", + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" + "cache", + "caching" ] }, { - "name": "symfony/psr-http-message-bridge", - "version": "v0.2", - "version_normalized": "0.2.0.0", + "name": "doctrine/annotations", + "version": "v1.2.7", + "version_normalized": "1.2.7.0", "source": { "type": "git", - "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "dc7e308e1dc2898a46776e2221a643cb08315453" + "url": "https://github.com/doctrine/annotations.git", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/dc7e308e1dc2898a46776e2221a643cb08315453", - "reference": "dc7e308e1dc2898a46776e2221a643cb08315453", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", "shasum": "" }, "require": { - "php": ">=5.3.3", - "psr/http-message": "~1.0", - "symfony/http-foundation": "~2.3|~3.0" + "doctrine/lexer": "1.*", + "php": ">=5.3.2" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" }, - "suggest": { - "zendframework/zend-diactoros": "To use the Zend Diactoros factory" + "time": "2015-08-31 12:32:49", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } }, - "time": "2015-05-29 17:57:12", - "type": "symfony-bridge", "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Bridge\\PsrHttpMessage\\": "" + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -403,56 +518,71 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Roman Borschel", + "email": "roman@code-factory.org" }, { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "PSR HTTP message bridge", - "homepage": "http://symfony.com", + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", "keywords": [ - "http", - "http-message", - "psr-7" + "annotations", + "docblock", + "parser" ] }, { - "name": "egulias/email-validator", - "version": "1.2.9", - "version_normalized": "1.2.9.0", + "name": "doctrine/common", + "version": "v2.5.1", + "version_normalized": "2.5.1.0", "source": { "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "af864423f50ea59f96c87bb1eae147a70bcf67a1" + "url": "https://github.com/doctrine/common.git", + "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/af864423f50ea59f96c87bb1eae147a70bcf67a1", - "reference": "af864423f50ea59f96c87bb1eae147a70bcf67a1", + "url": "https://api.github.com/repos/doctrine/common/zipball/0009b8f0d4a917aabc971fb089eba80e872f83f9", + "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9", "shasum": "" }, "require": { - "doctrine/lexer": "~1.0,>=1.0.1", - "php": ">= 5.3.3" + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": ">=5.3.2" }, "require-dev": { - "phpunit/phpunit": "~4.4", - "satooshi/php-coveralls": "dev-master" + "phpunit/phpunit": "~3.7" }, - "time": "2015-06-22 21:07:51", + "time": "2015-08-31 13:00:22", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.6.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Egulias\\": "src/" + "Doctrine\\Common\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -461,18 +591,154 @@ ], "authors": [ { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "emailvalidation", - "emailvalidator", - "validation", - "validator" - ] + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ] + }, + { + "name": "easyrdf/easyrdf", + "version": "0.9.1", + "version_normalized": "0.9.1.0", + "source": { + "type": "git", + "url": "https://github.com/njh/easyrdf.git", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", + "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-pcre": "*", + "php": ">=5.2.8" + }, + "require-dev": { + "phpunit/phpunit": "~3.5", + "sami/sami": "~1.4", + "squizlabs/php_codesniffer": "~1.4.3" + }, + "suggest": { + "ml/json-ld": "~1.0" + }, + "time": "2015-02-27 09:45:49", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "EasyRdf_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nicholas Humfrey", + "email": "njh@aelius.com", + "homepage": "http://www.aelius.com/njh/", + "role": "Developer" + }, + { + "name": "Alexey Zakhlestin", + "email": "indeyets@gmail.com", + "role": "Developer" + } + ], + "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", + "homepage": "http://www.easyrdf.org/", + "keywords": [ + "Linked Data", + "RDF", + "Semantic Web", + "Turtle", + "rdfa", + "sparql" + ] + }, + { + "name": "egulias/email-validator", + "version": "1.2.9", + "version_normalized": "1.2.9.0", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "af864423f50ea59f96c87bb1eae147a70bcf67a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/af864423f50ea59f96c87bb1eae147a70bcf67a1", + "reference": "af864423f50ea59f96c87bb1eae147a70bcf67a1", + "shasum": "" + }, + "require": { + "doctrine/lexer": "~1.0,>=1.0.1", + "php": ">= 5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4", + "satooshi/php-coveralls": "dev-master" + }, + "time": "2015-06-22 21:07:51", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Egulias\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ] }, { "name": "guzzlehttp/promises", @@ -528,6 +794,57 @@ ] }, { + "name": "psr/http-message", + "version": "1.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2015-05-04 20:22:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ] + }, + { "name": "guzzlehttp/psr7", "version": "1.2.0", "version_normalized": "1.2.0.0", @@ -588,42 +905,40 @@ ] }, { - "name": "doctrine/common", - "version": "v2.5.1", - "version_normalized": "2.5.1.0", + "name": "masterminds/html5", + "version": "2.1.2", + "version_normalized": "2.1.2.0", "source": { "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9" + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "8f782e0f01a6e33a319bdc8f6de9cfd6569979a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/0009b8f0d4a917aabc971fb089eba80e872f83f9", - "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/8f782e0f01a6e33a319bdc8f6de9cfd6569979a4", + "reference": "8f782e0f01a6e33a319bdc8f6de9cfd6569979a4", "shasum": "" }, "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": ">=5.3.2" + "ext-libxml": "*", + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "~3.7" + "phpunit/phpunit": "4.*", + "sami/sami": "~2.0", + "satooshi/php-coveralls": "0.6.*" }, - "time": "2015-08-31 13:00:22", + "time": "2015-06-07 08:43:18", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6.x-dev" + "dev-master": "2.1-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "Doctrine\\Common\\": "lib/" + "psr-4": { + "Masterminds\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -632,71 +947,67 @@ ], "authors": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "name": "Matt Butcher", + "email": "technosophos@gmail.com" }, { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Matt Farina", + "email": "matt@mattfarina.com" } ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" ] }, { - "name": "doctrine/annotations", - "version": "v1.2.7", - "version_normalized": "1.2.7.0", + "name": "symfony/http-foundation", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + "url": "https://github.com/symfony/http-foundation.git", + "reference": "e1509119f164a0d0a940d7d924d693a7a28a5470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e1509119f164a0d0a940d7d924d693a7a28a5470", + "reference": "e1509119f164a0d0a940d7d924d693a7a28a5470", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", - "php": ">=5.3.2" + "php": ">=5.3.9" }, "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" + "symfony/expression-language": "~2.4", + "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-08-31 12:32:49", + "time": "2015-09-22 13:49:29", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" - } + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -704,70 +1015,58 @@ ], "authors": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ] + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com" }, { - "name": "doctrine/instantiator", - "version": "1.0.5", - "version_normalized": "1.0.5.0", + "name": "symfony/event-dispatcher", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", + "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": ">=5.3.9" }, "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.6", + "symfony/expression-language": "~2.6", + "symfony/phpunit-bridge": "~2.7", + "symfony/stopwatch": "~2.3" }, - "time": "2015-06-14 21:17:01", + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "time": "2015-09-22 13:49:29", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Symfony\\Component\\EventDispatcher\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -776,55 +1075,38 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ] + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com" }, { - "name": "doctrine/cache", - "version": "v1.4.2", - "version_normalized": "1.4.2.0", + "name": "psr/log", + "version": "1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca" + "url": "https://github.com/php-fig/log.git", + "reference": "1.0.0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/8c434000f420ade76a07c64cbe08ca47e5c101ca", - "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "1.0.0", "shasum": "" }, - "require": { - "php": ">=5.3.2" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "phpunit/phpunit": ">=3.7", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" - }, - "time": "2015-08-31 12:36:41", + "time": "2012-12-21 11:40:51", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-0": { - "Doctrine\\Common\\Cache\\": "lib/" + "Psr\\Log\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -833,65 +1115,55 @@ ], "authors": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", + "description": "Common interface for logging libraries", "keywords": [ - "cache", - "caching" + "log", + "psr", + "psr-3" ] }, { - "name": "doctrine/collections", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "name": "symfony/debug", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + "url": "https://github.com/symfony/debug.git", + "reference": "c79c361bca8e5ada6a47603875a3c964d03b67b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "url": "https://api.github.com/repos/symfony/debug/zipball/c79c361bca8e5ada6a47603875a3c964d03b67b1", + "reference": "c79c361bca8e5ada6a47603875a3c964d03b67b1", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "symfony/class-loader": "~2.2", + "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2", + "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-04-14 22:21:58", + "time": "2015-09-14 08:41:38", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" + "psr-4": { + "Symfony\\Component\\Debug\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -900,66 +1172,80 @@ ], "authors": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ] + "description": "Symfony Debug Component", + "homepage": "https://symfony.com" }, { - "name": "doctrine/inflector", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", + "name": "symfony/http-kernel", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" + "url": "https://github.com/symfony/http-kernel.git", + "reference": "353aa457424262d7d4e4289ea483145921cffcb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", - "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/353aa457424262d7d4e4289ea483145921cffcb5", + "reference": "353aa457424262d7d4e4289ea483145921cffcb5", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.3.9", + "psr/log": "~1.0", + "symfony/debug": "~2.6,>=2.6.2", + "symfony/event-dispatcher": "~2.6,>=2.6.7", + "symfony/http-foundation": "~2.5,>=2.5.4" + }, + "conflict": { + "symfony/config": "<2.7" }, "require-dev": { - "phpunit/phpunit": "4.*" + "symfony/browser-kit": "~2.3", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.7", + "symfony/console": "~2.3", + "symfony/css-selector": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.2", + "symfony/dom-crawler": "~2.0,>=2.0.5", + "symfony/expression-language": "~2.4", + "symfony/finder": "~2.0,>=2.0.5", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.0,>=2.0.5", + "symfony/routing": "~2.2", + "symfony/stopwatch": "~2.3", + "symfony/templating": "~2.2", + "symfony/translation": "~2.0,>=2.0.5", + "symfony/var-dumper": "~2.6" }, - "time": "2014-12-20 21:24:13", + "suggest": { + "symfony/browser-kit": "", + "symfony/class-loader": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" + }, + "time": "2015-09-25 11:16:52", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -968,386 +1254,405 @@ ], "authors": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ] + "description": "Symfony HttpKernel Component", + "homepage": "https://symfony.com" }, { - "name": "sebastian/environment", - "version": "1.3.2", - "version_normalized": "1.3.2.0", + "name": "stack/builder", + "version": "v1.0.3", + "version_normalized": "1.0.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + "url": "https://github.com/stackphp/builder.git", + "reference": "c1f8a4693b55c563405024f708a76ef576c3b276" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "url": "https://api.github.com/repos/stackphp/builder/zipball/c1f8a4693b55c563405024f708a76ef576c3b276", + "reference": "c1f8a4693b55c563405024f708a76ef576c3b276", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.0", + "symfony/http-foundation": "~2.1", + "symfony/http-kernel": "~2.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "silex/silex": "~1.0" }, - "time": "2015-08-03 06:14:51", + "time": "2014-11-23 20:37:11", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.0-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "Stack": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "Builder for stack middlewares based on HttpKernelInterface.", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "stack" ] }, { - "name": "phpunit/php-timer", - "version": "1.0.7", - "version_normalized": "1.0.7.0", + "name": "symfony/routing", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "url": "https://github.com/symfony/routing.git", + "reference": "6c5fae83efa20baf166fcf4582f57094e9f60f16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/symfony/routing/zipball/6c5fae83efa20baf166fcf4582f57094e9f60f16", + "reference": "6c5fae83efa20baf166fcf4582f57094e9f60f16", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, - "time": "2015-06-21 08:01:12", + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "~2.7", + "symfony/expression-language": "~2.4", + "symfony/http-foundation": "~2.3", + "symfony/phpunit-bridge": "~2.7", + "symfony/yaml": "~2.0,>=2.0.5" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/yaml": "For using the YAML loader" + }, + "time": "2015-09-14 14:14:09", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Component\\Routing\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", "keywords": [ - "timer" + "router", + "routing", + "uri", + "url" ] }, { - "name": "easyrdf/easyrdf", - "version": "0.9.1", - "version_normalized": "0.9.1.0", + "name": "symfony-cmf/routing", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", - "url": "https://github.com/njh/easyrdf.git", - "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566" + "url": "https://github.com/symfony-cmf/Routing.git", + "reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", - "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566", + "url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/8e87981d72c6930a27585dcd3119f3199f6cb2a6", + "reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6", "shasum": "" }, "require": { - "ext-mbstring": "*", - "ext-pcre": "*", - "php": ">=5.2.8" + "php": ">=5.3.3", + "psr/log": "~1.0", + "symfony/http-kernel": "~2.2", + "symfony/routing": "~2.2" }, "require-dev": { - "phpunit/phpunit": "~3.5", - "sami/sami": "~1.4", - "squizlabs/php_codesniffer": "~1.4.3" + "symfony/config": "~2.2", + "symfony/dependency-injection": "~2.0@stable", + "symfony/event-dispatcher": "~2.1" }, "suggest": { - "ml/json-ld": "~1.0" + "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version ~2.1" }, - "time": "2015-02-27 09:45:49", + "time": "2014-10-20 20:55:17", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, "installation-source": "dist", "autoload": { - "psr-0": { - "EasyRdf_": "lib/" + "psr-4": { + "Symfony\\Cmf\\Component\\Routing\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nicholas Humfrey", - "email": "njh@aelius.com", - "homepage": "http://www.aelius.com/njh/", - "role": "Developer" - }, - { - "name": "Alexey Zakhlestin", - "email": "indeyets@gmail.com", - "role": "Developer" + "name": "Symfony CMF Community", + "homepage": "https://github.com/symfony-cmf/Routing/contributors" } ], - "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", - "homepage": "http://www.easyrdf.org/", + "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", + "homepage": "http://cmf.symfony.com", "keywords": [ - "Linked Data", - "RDF", - "Semantic Web", - "Turtle", - "rdfa", - "sparql" + "database", + "routing" ] }, { - "name": "zendframework/zend-escaper", - "version": "2.5.1", - "version_normalized": "2.5.1.0", + "name": "symfony/class-loader", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "a4b227d8a477f4e7e9073f8e0a7ae7dbd3104a73" + "url": "https://github.com/symfony/class-loader.git", + "reference": "d957ea6295d7016e20d7eff33a6c1deef819c0d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/a4b227d8a477f4e7e9073f8e0a7ae7dbd3104a73", - "reference": "a4b227d8a477f4e7e9073f8e0a7ae7dbd3104a73", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/d957ea6295d7016e20d7eff33a6c1deef819c0d4", + "reference": "d957ea6295d7016e20d7eff33a6c1deef819c0d4", "shasum": "" }, "require": { - "php": ">=5.3.23" + "php": ">=5.3.9" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "symfony/finder": "~2.0,>=2.0.5", + "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-06-03 14:05:37", + "time": "2015-08-26 17:56:37", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Zend\\Escaper\\": "src/" + "Symfony\\Component\\ClassLoader\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "homepage": "https://github.com/zendframework/zend-escaper", - "keywords": [ - "escaper", - "zf2" - ] + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ClassLoader Component", + "homepage": "https://symfony.com" }, { - "name": "zendframework/zend-feed", - "version": "2.5.2", - "version_normalized": "2.5.2.0", + "name": "symfony/console", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-feed.git", - "reference": "0661345b82b51428619e05d3aadd3de65b57fa54" + "url": "https://github.com/symfony/console.git", + "reference": "06cb17c013a82f94a3d840682b49425cd00a2161" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/0661345b82b51428619e05d3aadd3de65b57fa54", - "reference": "0661345b82b51428619e05d3aadd3de65b57fa54", + "url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161", + "reference": "06cb17c013a82f94a3d840682b49425cd00a2161", "shasum": "" }, "require": { - "php": ">=5.5", - "zendframework/zend-escaper": "~2.5", - "zendframework/zend-stdlib": "~2.5" + "php": ">=5.3.9" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-cache": "~2.5", - "zendframework/zend-db": "~2.5", - "zendframework/zend-http": "~2.5", - "zendframework/zend-servicemanager": "~2.5", - "zendframework/zend-validator": "~2.5" + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.1" }, "suggest": { - "zendframework/zend-cache": "Zend\\Cache component", - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for default/recommended ExtensionManager implementations", - "zendframework/zend-validator": "Zend\\Validator component" + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" }, - "time": "2015-08-04 21:39:18", + "time": "2015-09-25 08:32:23", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Zend\\Feed\\": "src/" + "Symfony\\Component\\Console\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "description": "provides functionality for consuming RSS and Atom feeds", - "homepage": "https://github.com/zendframework/zend-feed", - "keywords": [ - "feed", - "zf2" - ] + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com" }, { - "name": "zendframework/zend-diactoros", - "version": "1.1.3", - "version_normalized": "1.1.3.0", + "name": "symfony/dependency-injection", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "e2f5c12916c74da384058d0dfbc7fbc0b03d1181" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "422c3819b110f610d79c6f1dc38af23787dc790e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/e2f5c12916c74da384058d0dfbc7fbc0b03d1181", - "reference": "e2f5c12916c74da384058d0dfbc7fbc0b03d1181", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/422c3819b110f610d79c6f1dc38af23787dc790e", + "reference": "422c3819b110f610d79c6f1dc38af23787dc790e", "shasum": "" }, "require": { - "php": ">=5.4", - "psr/http-message": "~1.0" + "php": ">=5.3.9" }, - "provide": { - "psr/http-message-implementation": "~1.0.0" + "conflict": { + "symfony/expression-language": "<2.6" }, "require-dev": { - "phpunit/phpunit": "~4.6", - "squizlabs/php_codesniffer": "^2.3.1" + "symfony/config": "~2.2", + "symfony/expression-language": "~2.6", + "symfony/phpunit-bridge": "~2.7", + "symfony/yaml": "~2.1" }, - "time": "2015-08-10 20:04:20", + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "time": "2015-09-15 08:30:42", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev", - "dev-develop": "1.1-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Zend\\Diactoros\\": "src/" + "Symfony\\Component\\DependencyInjection\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" ], - "description": "PSR HTTP Message implementations", - "homepage": "https://github.com/zendframework/zend-diactoros", - "keywords": [ - "http", - "psr", - "psr-7" - ] + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com" }, { - "name": "fabpot/goutte", - "version": "v3.1.1", - "version_normalized": "3.1.1.0", + "name": "symfony/process", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc" + "url": "https://github.com/symfony/process.git", + "reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", - "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", + "url": "https://api.github.com/repos/symfony/process/zipball/b27c8e317922cd3cdd3600850273cf6b82b2e8e9", + "reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "symfony/browser-kit": "~2.1", - "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1" + "php": ">=5.3.9" }, - "time": "2015-08-29 16:16:56", - "type": "application", + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-09-19 19:59:23", + "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Goutte\\": "Goutte" + "Symfony\\Component\\Process\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1358,48 +1663,47 @@ { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A simple PHP Web Scraper", - "homepage": "https://github.com/FriendsOfPHP/Goutte", - "keywords": [ - "scraper" - ] + "description": "Symfony Process Component", + "homepage": "https://symfony.com" }, { - "name": "phpspec/prophecy", - "version": "v1.5.0", - "version_normalized": "1.5.0.0", + "name": "symfony/psr-http-message-bridge", + "version": "v0.2", + "version_normalized": "0.2.0.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "dc7e308e1dc2898a46776e2221a643cb08315453" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/dc7e308e1dc2898a46776e2221a643cb08315453", + "reference": "dc7e308e1dc2898a46776e2221a643cb08315453", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "php": ">=5.3.3", + "psr/http-message": "~1.0", + "symfony/http-foundation": "~2.3|~3.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "symfony/phpunit-bridge": "~2.7|~3.0" }, - "time": "2015-08-13 10:07:40", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } + "suggest": { + "zendframework/zend-diactoros": "To use the Zend Diactoros factory" }, + "time": "2015-05-29 17:57:12", + "type": "symfony-bridge", "installation-source": "dist", "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1408,218 +1712,254 @@ ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" }, { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "http", + "http-message", + "psr-7" ] }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", - "version_normalized": "1.4.1.0", + "name": "symfony/serializer", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "url": "https://github.com/symfony/serializer.git", + "reference": "baf24f86a8656eea9c80988f332e51461bfcb67f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/symfony/serializer/zipball/baf24f86a8656eea9c80988f332e51461bfcb67f", + "reference": "baf24f86a8656eea9c80988f332e51461bfcb67f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, - "time": "2015-06-21 13:08:43", + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "symfony/config": "~2.2", + "symfony/phpunit-bridge": "~2.7", + "symfony/property-access": "~2.3", + "symfony/yaml": "~2.0,>=2.0.5" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "time": "2015-08-31 16:44:53", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ] + "description": "Symfony Serializer Component", + "homepage": "https://symfony.com" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "version_normalized": "1.2.1.0", + "name": "symfony/translation", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/symfony/translation.git", + "reference": "485877661835e188cd78345c6d4eef1290d17571" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/symfony/translation/zipball/485877661835e188cd78345c6d4eef1290d17571", + "reference": "485877661835e188cd78345c6d4eef1290d17571", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, - "time": "2015-06-21 13:50:34", + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.7", + "symfony/intl": "~2.4", + "symfony/phpunit-bridge": "~2.7", + "symfony/yaml": "~2.2" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "time": "2015-09-06 08:36:38", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Component\\Translation\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ] + "description": "Symfony Translation Component", + "homepage": "https://symfony.com" }, { - "name": "sebastian/comparator", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "name": "symfony/validator", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "url": "https://github.com/symfony/validator.git", + "reference": "b359dc71e253ce6eb69eefbd5088032241e7a66f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/symfony/validator/zipball/b359dc71e253ce6eb69eefbd5088032241e7a66f", + "reference": "b359dc71e253ce6eb69eefbd5088032241e7a66f", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "php": ">=5.3.9", + "symfony/translation": "~2.4" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "~1.2,>=1.2.1", + "symfony/config": "~2.2", + "symfony/expression-language": "~2.4", + "symfony/http-foundation": "~2.1", + "symfony/intl": "~2.4", + "symfony/phpunit-bridge": "~2.7", + "symfony/property-access": "~2.3", + "symfony/yaml": "~2.0,>=2.0.5" }, - "time": "2015-07-26 15:48:44", + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "symfony/config": "", + "symfony/expression-language": "For using the 2.4 Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For using the 2.4 Validator API", + "symfony/yaml": "" + }, + "time": "2015-09-23 11:13:27", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Component\\Validator\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ] + "description": "Symfony Validator Component", + "homepage": "https://symfony.com" }, { - "name": "sebastian/exporter", - "version": "1.2.1", - "version_normalized": "1.2.1.0", + "name": "twig/twig", + "version": "v1.22.2", + "version_normalized": "1.22.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "url": "https://github.com/twigphp/Twig.git", + "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/79249fc8c9ff62e41e217e0c630e2e00bcadda6a", + "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": ">=5.2.7" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-06-21 07:55:53", + "time": "2015-09-22 13:59:32", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.22-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "Twig_": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1627,159 +1967,392 @@ ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", "keywords": [ - "export", - "exporter" + "templating" ] }, { - "name": "sebastian/recursion-context", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "name": "zendframework/zend-diactoros", + "version": "1.1.3", + "version_normalized": "1.1.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + "url": "https://github.com/zendframework/zend-diactoros.git", + "reference": "e2f5c12916c74da384058d0dfbc7fbc0b03d1181" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/e2f5c12916c74da384058d0dfbc7fbc0b03d1181", + "reference": "e2f5c12916c74da384058d0dfbc7fbc0b03d1181", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.4", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "~1.0.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "~4.6", + "squizlabs/php_codesniffer": "^2.3.1" }, - "time": "2015-06-21 08:04:50", + "time": "2015-08-10 20:04:20", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.0-dev", + "dev-develop": "1.1-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Zend\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://github.com/zendframework/zend-diactoros", + "keywords": [ + "http", + "psr", + "psr-7" + ] + }, + { + "name": "zendframework/zend-stdlib", + "version": "2.7.3", + "version_normalized": "2.7.3.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "8ac0c77ff567fcf49b58689ee3bfa7595be102bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8ac0c77ff567fcf49b58689ee3bfa7595be102bc", + "reference": "8ac0c77ff567fcf49b58689ee3bfa7595be102bc", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "zendframework/zend-hydrator": "~1.0" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-config": "~2.5", + "zendframework/zend-eventmanager": "~2.5", + "zendframework/zend-filter": "~2.5", + "zendframework/zend-inputfilter": "~2.5", + "zendframework/zend-serializer": "~2.5", + "zendframework/zend-servicemanager": "~2.5" + }, + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-filter": "To support naming strategy hydrator usage", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + }, + "time": "2015-09-25 04:06:33", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ] + }, + { + "name": "zendframework/zend-hydrator", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-hydrator.git", + "reference": "f3ed8b833355140350bbed98d8a7b8b66875903f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/f3ed8b833355140350bbed98d8a7b8b66875903f", + "reference": "f3ed8b833355140350bbed98d8a7b8b66875903f", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "zendframework/zend-stdlib": "^2.5.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.0@dev", + "zendframework/zend-eventmanager": "^2.5.1", + "zendframework/zend-filter": "^2.5.1", + "zendframework/zend-inputfilter": "^2.5.1", + "zendframework/zend-serializer": "^2.5.1", + "zendframework/zend-servicemanager": "^2.5.1" + }, + "suggest": { + "zendframework/zend-eventmanager": "^2.5.1, to support aggregate hydrator usage", + "zendframework/zend-filter": "^2.5.1, to support naming strategy hydrator usage", + "zendframework/zend-serializer": "^2.5.1, to use the SerializableStrategy", + "zendframework/zend-servicemanager": "^2.5.1, to support hydrator plugin manager usage" + }, + "time": "2015-09-17 14:06:43", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev", + "dev-develop": "1.1-dev" } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zend\\Hydrator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context" + "homepage": "https://github.com/zendframework/zend-hydrator", + "keywords": [ + "hydrator", + "zf2" + ] }, { - "name": "sebastian/version", - "version": "1.0.6", - "version_normalized": "1.0.6.0", + "name": "zendframework/zend-escaper", + "version": "2.5.1", + "version_normalized": "2.5.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "a4b227d8a477f4e7e9073f8e0a7ae7dbd3104a73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/a4b227d8a477f4e7e9073f8e0a7ae7dbd3104a73", + "reference": "a4b227d8a477f4e7e9073f8e0a7ae7dbd3104a73", "shasum": "" }, - "time": "2015-06-21 13:59:46", + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "time": "2015-06-03 14:05:37", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Zend\\Escaper\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], + "homepage": "https://github.com/zendframework/zend-escaper", + "keywords": [ + "escaper", + "zf2" + ] + }, + { + "name": "zendframework/zend-feed", + "version": "2.5.2", + "version_normalized": "2.5.2.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-feed.git", + "reference": "0661345b82b51428619e05d3aadd3de65b57fa54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/0661345b82b51428619e05d3aadd3de65b57fa54", + "reference": "0661345b82b51428619e05d3aadd3de65b57fa54", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "zendframework/zend-escaper": "~2.5", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-cache": "~2.5", + "zendframework/zend-db": "~2.5", + "zendframework/zend-http": "~2.5", + "zendframework/zend-servicemanager": "~2.5", + "zendframework/zend-validator": "~2.5" + }, + "suggest": { + "zendframework/zend-cache": "Zend\\Cache component", + "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for default/recommended ExtensionManager implementations", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "time": "2015-08-04 21:39:18", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Zend\\Feed\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides functionality for consuming RSS and Atom feeds", + "homepage": "https://github.com/zendframework/zend-feed", + "keywords": [ + "feed", + "zf2" + ] + }, + { + "name": "symfony/dom-crawler", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "2e185ca136399f902b948694987e62c80099c052" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2e185ca136399f902b948694987e62c80099c052", + "reference": "2e185ca136399f902b948694987e62c80099c052", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/css-selector": "~2.3", + "symfony/phpunit-bridge": "~2.7" + }, + "suggest": { + "symfony/css-selector": "" + }, + "time": "2015-09-20 21:13:58", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version" + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com" }, { - "name": "stack/builder", - "version": "v1.0.3", - "version_normalized": "1.0.3.0", + "name": "symfony/css-selector", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/stackphp/builder.git", - "reference": "c1f8a4693b55c563405024f708a76ef576c3b276" + "url": "https://github.com/symfony/css-selector.git", + "reference": "abe19cc0429a06be0c133056d1f9859854860970" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stackphp/builder/zipball/c1f8a4693b55c563405024f708a76ef576c3b276", - "reference": "c1f8a4693b55c563405024f708a76ef576c3b276", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/abe19cc0429a06be0c133056d1f9859854860970", + "reference": "abe19cc0429a06be0c133056d1f9859854860970", "shasum": "" }, "require": { - "php": ">=5.3.0", - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.1" + "php": ">=5.3.9" }, "require-dev": { - "silex/silex": "~1.0" + "symfony/phpunit-bridge": "~2.7" }, - "time": "2014-11-23 20:37:11", + "time": "2015-09-22 13:49:29", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "Stack": "src" + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1788,50 +2361,59 @@ ], "authors": [ { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Builder for stack middlewares based on HttpKernelInterface.", - "keywords": [ - "stack" - ] + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com" }, { - "name": "masterminds/html5", - "version": "2.1.2", - "version_normalized": "2.1.2.0", + "name": "symfony/browser-kit", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/Masterminds/html5-php.git", - "reference": "8f782e0f01a6e33a319bdc8f6de9cfd6569979a4" + "url": "https://github.com/symfony/browser-kit.git", + "reference": "277a2457776d4cc25706fbdd9d1e4ab2dac884e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/8f782e0f01a6e33a319bdc8f6de9cfd6569979a4", - "reference": "8f782e0f01a6e33a319bdc8f6de9cfd6569979a4", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/277a2457776d4cc25706fbdd9d1e4ab2dac884e4", + "reference": "277a2457776d4cc25706fbdd9d1e4ab2dac884e4", "shasum": "" }, "require": { - "ext-libxml": "*", - "php": ">=5.3.0" + "php": ">=5.3.9", + "symfony/dom-crawler": "~2.0,>=2.0.5" }, "require-dev": { - "phpunit/phpunit": "4.*", - "sami/sami": "~2.0", - "satooshi/php-coveralls": "0.6.*" + "symfony/css-selector": "~2.0,>=2.0.5", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.0,>=2.0.5" }, - "time": "2015-06-07 08:43:18", + "suggest": { + "symfony/process": "" + }, + "time": "2015-09-06 08:36:38", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.7-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Masterminds\\": "src" + "Symfony\\Component\\BrowserKit\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1840,29 +2422,16 @@ ], "authors": [ { - "name": "Matt Butcher", - "email": "technosophos@gmail.com" - }, - { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Matt Farina", - "email": "matt@mattfarina.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "An HTML5 parser and serializer.", - "homepage": "http://masterminds.github.io/html5-php", - "keywords": [ - "HTML5", - "dom", - "html", - "parser", - "querypath", - "serializer", - "xml" - ] + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com" }, { "name": "guzzlehttp/guzzle", @@ -1929,155 +2498,38 @@ ] }, { - "name": "twig/twig", - "version": "v1.22.2", - "version_normalized": "1.22.2.0", + "name": "fabpot/goutte", + "version": "v3.1.1", + "version_normalized": "3.1.1.0", "source": { "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a" + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/79249fc8c9ff62e41e217e0c630e2e00bcadda6a", - "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", + "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", "shasum": "" }, "require": { - "php": ">=5.2.7" - }, - "require-dev": { - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1" }, - "time": "2015-09-22 13:59:32", - "type": "library", + "time": "2015-08-29 16:16:56", + "type": "application", "extra": { "branch-alias": { - "dev-master": "1.22-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" + "dev-master": "3.1-dev" } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ] - }, - { - "name": "wikimedia/composer-merge-plugin", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/wikimedia/composer-merge-plugin.git", - "reference": "47bb3388cfeae41a38087ac8465a7d08fa92ea2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/47bb3388cfeae41a38087ac8465a7d08fa92ea2e", - "reference": "47bb3388cfeae41a38087ac8465a7d08fa92ea2e", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0", - "php": ">=5.3.2" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "jakub-onderka/php-parallel-lint": "~0.8", - "phpspec/prophecy-phpunit": "~1.0", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.1.0" - }, - "time": "2015-09-22 21:14:25", - "type": "composer-plugin", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - }, - "class": "Wikimedia\\Composer\\MergePlugin" }, "installation-source": "dist", "autoload": { "psr-4": { - "Wikimedia\\Composer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bryan Davis", - "email": "bd808@wikimedia.org" - } - ], - "description": "Composer plugin to merge multiple composer.json files" - }, - { - "name": "composer/installers", - "version": "v1.0.21", - "version_normalized": "1.0.21.0", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", - "shasum": "" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" - }, - "time": "2015-02-18 17:17:01", - "type": "composer-installer", - "extra": { - "class": "Composer\\Installers\\Installer", - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Composer\\Installers\\": "src/" + "Goutte\\": "Goutte" } }, "notification-url": "https://packagist.org/downloads/", @@ -2086,58 +2538,14 @@ ], "authors": [ { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], - "description": "A multi-framework Composer library installer", - "homepage": "http://composer.github.com/installers/", + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", "keywords": [ - "Craft", - "Dolibarr", - "Hurad", - "MODX Evo", - "OXID", - "SMF", - "Thelia", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "bitrix", - "cakephp", - "chef", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "elgg", - "fuelphp", - "grav", - "installer", - "joomla", - "kohana", - "laravel", - "lithium", - "magento", - "mako", - "mediawiki", - "modulework", - "moodle", - "phpbb", - "piwik", - "ppi", - "puppet", - "roundcube", - "shopware", - "silverstripe", - "symfony", - "typo3", - "wordpress", - "zend", - "zikula" + "scraper" ] }, { @@ -2316,325 +2724,91 @@ ] }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "version_normalized": "2.3.8.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "time": "2015-10-02 06:51:40", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ] - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.8", - "version_normalized": "1.4.8.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "time": "2015-09-15 10:49:45", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ] - }, - { - "name": "symfony/class-loader", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/class-loader.git", - "reference": "d957ea6295d7016e20d7eff33a6c1deef819c0d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/d957ea6295d7016e20d7eff33a6c1deef819c0d4", - "reference": "d957ea6295d7016e20d7eff33a6c1deef819c0d4", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7" - }, - "time": "2015-08-26 17:56:37", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ClassLoader Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/console", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161", - "reference": "06cb17c013a82f94a3d840682b49425cd00a2161", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "time": "2015-09-25 08:32:23", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/dependency-injection", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "mikey179/vfsStream", + "version": "v1.6.0", + "version_normalized": "1.6.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "422c3819b110f610d79c6f1dc38af23787dc790e" + "url": "https://github.com/mikey179/vfsStream.git", + "reference": "73bcb605b741a7d5044b47592338c633788b0eb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/422c3819b110f610d79c6f1dc38af23787dc790e", - "reference": "422c3819b110f610d79c6f1dc38af23787dc790e", + "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/73bcb605b741a7d5044b47592338c633788b0eb7", + "reference": "73bcb605b741a7d5044b47592338c633788b0eb7", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/expression-language": "<2.6" + "php": ">=5.3.0" }, "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "phpunit/phpunit": "~4.5" }, - "time": "2015-09-15 08:30:42", + "time": "2015-10-06 16:59:57", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.6.x-dev" } }, "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" + "autoload": { + "psr-0": { + "org\\bovigo\\vfs\\": "src/main/php" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Frank Kleine", + "homepage": "http://frankkleine.de/", + "role": "Developer" } ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com" + "description": "Virtual file system to mock the real file system in unit tests.", + "homepage": "http://vfs.bovigo.org/" }, { - "name": "symfony/debug", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", + "version_normalized": "2.0.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "c79c361bca8e5ada6a47603875a3c964d03b67b1" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/c79c361bca8e5ada6a47603875a3c964d03b67b1", - "reference": "c79c361bca8e5ada6a47603875a3c964d03b67b1", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", "shasum": "" }, "require": { - "php": ">=5.3.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "php": ">=5.3.3" }, "require-dev": { - "symfony/class-loader": "~2.2", - "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2", - "symfony/phpunit-bridge": "~2.7" + "phpunit/phpunit": "~4.0" }, - "time": "2015-09-14 08:41:38", + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "time": "2015-02-03 12:10:50", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" + "psr-0": { + "phpDocumentor": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -2643,103 +2817,84 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com" + ] }, { - "name": "symfony/http-foundation", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "phpunit/php-token-stream", + "version": "1.4.8", + "version_normalized": "1.4.8.0", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "e1509119f164a0d0a940d7d924d693a7a28a5470" + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e1509119f164a0d0a940d7d924d693a7a28a5470", - "reference": "e1509119f164a0d0a940d7d924d693a7a28a5470", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { - "php": ">=5.3.9" + "ext-tokenizer": "*", + "php": ">=5.3.3" }, "require-dev": { - "symfony/expression-language": "~2.4", - "symfony/phpunit-bridge": "~2.7" + "phpunit/phpunit": "~4.2" }, - "time": "2015-09-22 13:49:29", + "time": "2015-09-15 10:49:45", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.4-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, "classmap": [ - "Resources/stubs" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com" + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ] }, { - "name": "symfony/event-dispatcher", + "name": "symfony/yaml", "version": "v2.7.5", "version_normalized": "2.7.5.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9" + "url": "https://github.com/symfony/yaml.git", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", - "reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9", + "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", "shasum": "" }, "require": { "php": ">=5.3.9" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-09-22 13:49:29", + "time": "2015-09-14 14:14:09", "type": "library", "extra": { "branch-alias": { @@ -2749,7 +2904,7 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" + "Symfony\\Component\\Yaml\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -2766,555 +2921,473 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "description": "Symfony Yaml Component", "homepage": "https://symfony.com" }, { - "name": "symfony/http-kernel", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "sebastian/version", + "version": "1.0.6", + "version_normalized": "1.0.6.0", "source": { "type": "git", - "url": "https://github.com/symfony/http-kernel.git", - "reference": "353aa457424262d7d4e4289ea483145921cffcb5" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/353aa457424262d7d4e4289ea483145921cffcb5", - "reference": "353aa457424262d7d4e4289ea483145921cffcb5", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, - "require": { - "php": ">=5.3.9", - "psr/log": "~1.0", - "symfony/debug": "~2.6,>=2.6.2", - "symfony/event-dispatcher": "~2.6,>=2.6.7", - "symfony/http-foundation": "~2.5,>=2.5.4" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "symfony/browser-kit": "~2.3", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.7", - "symfony/console": "~2.3", - "symfony/css-selector": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.2", - "symfony/dom-crawler": "~2.0,>=2.0.5", - "symfony/expression-language": "~2.4", - "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.0,>=2.0.5", - "symfony/routing": "~2.2", - "symfony/stopwatch": "~2.3", - "symfony/templating": "~2.2", - "symfony/translation": "~2.0,>=2.0.5", - "symfony/var-dumper": "~2.6" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/class-loader": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/finder": "", - "symfony/var-dumper": "" - }, - "time": "2015-09-25 11:16:52", + "time": "2015-06-21 13:59:46", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Symfony HttpKernel Component", - "homepage": "https://symfony.com" + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version" }, { - "name": "symfony/routing", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "sebastian/global-state", + "version": "1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "6c5fae83efa20baf166fcf4582f57094e9f60f16" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/6c5fae83efa20baf166fcf4582f57094e9f60f16", - "reference": "6c5fae83efa20baf166fcf4582f57094e9f60f16", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" + "php": ">=5.3.3" }, "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/expression-language": "~2.4", - "symfony/http-foundation": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.0,>=2.0.5" + "phpunit/phpunit": "~4.2" }, "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/yaml": "For using the YAML loader" + "ext-uopz": "*" }, - "time": "2015-09-14 14:14:09", + "time": "2014-10-06 09:23:50", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.0-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Symfony Routing Component", - "homepage": "https://symfony.com", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "router", - "routing", - "uri", - "url" + "global state" ] }, { - "name": "symfony/serializer", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "sebastian/recursion-context", + "version": "1.0.1", + "version_normalized": "1.0.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/serializer.git", - "reference": "baf24f86a8656eea9c80988f332e51461bfcb67f" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/baf24f86a8656eea9c80988f332e51461bfcb67f", - "reference": "baf24f86a8656eea9c80988f332e51461bfcb67f", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.3" }, "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "symfony/config": "~2.2", - "symfony/phpunit-bridge": "~2.7", - "symfony/property-access": "~2.3", - "symfony/yaml": "~2.0,>=2.0.5" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "symfony/config": "For using the XML mapping loader.", - "symfony/property-access": "For using the ObjectNormalizer.", - "symfony/yaml": "For using the default YAML mapping loader." + "phpunit/phpunit": "~4.4" }, - "time": "2015-08-31 16:44:53", + "time": "2015-06-21 08:04:50", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Serializer\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Symfony Serializer Component", - "homepage": "https://symfony.com" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context" }, { - "name": "symfony/translation", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "sebastian/exporter", + "version": "1.2.1", + "version_normalized": "1.2.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "485877661835e188cd78345c6d4eef1290d17571" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/485877661835e188cd78345c6d4eef1290d17571", - "reference": "485877661835e188cd78345c6d4eef1290d17571", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.4", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.2" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" + "phpunit/phpunit": "~4.4" }, - "time": "2015-09-06 08:36:38", + "time": "2015-06-21 07:55:53", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.2.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com" + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ] }, { - "name": "symfony/validator", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "sebastian/environment", + "version": "1.3.2", + "version_normalized": "1.3.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "b359dc71e253ce6eb69eefbd5088032241e7a66f" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/b359dc71e253ce6eb69eefbd5088032241e7a66f", - "reference": "b359dc71e253ce6eb69eefbd5088032241e7a66f", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/translation": "~2.4" + "php": ">=5.3.3" }, "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "~1.2,>=1.2.1", - "symfony/config": "~2.2", - "symfony/expression-language": "~2.4", - "symfony/http-foundation": "~2.1", - "symfony/intl": "~2.4", - "symfony/phpunit-bridge": "~2.7", - "symfony/property-access": "~2.3", - "symfony/yaml": "~2.0,>=2.0.5" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "egulias/email-validator": "Strict (RFC compliant) email validation", - "symfony/config": "", - "symfony/expression-language": "For using the 2.4 Expression validator", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For using the 2.4 Validator API", - "symfony/yaml": "" + "phpunit/phpunit": "~4.4" }, - "time": "2015-09-23 11:13:27", + "time": "2015-08-03 06:14:51", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.3.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Symfony Validator Component", - "homepage": "https://symfony.com" + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ] }, { - "name": "symfony/process", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "sebastian/diff", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b27c8e317922cd3cdd3600850273cf6b82b2e8e9", - "reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.3" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "phpunit/phpunit": "~4.2" }, - "time": "2015-09-19 19:59:23", + "time": "2015-02-22 15:13:53", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.3-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com" + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ] }, { - "name": "symfony/yaml", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "sebastian/comparator", + "version": "1.2.0", + "version_normalized": "1.2.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", - "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "phpunit/phpunit": "~4.4" }, - "time": "2015-09-14 14:14:09", + "time": "2015-07-26 15:48:44", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.2.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ] }, { - "name": "symfony/css-selector", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "phpunit/php-text-template", + "version": "1.2.1", + "version_normalized": "1.2.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "abe19cc0429a06be0c133056d1f9859854860970" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/abe19cc0429a06be0c133056d1f9859854860970", - "reference": "abe19cc0429a06be0c133056d1f9859854860970", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "php": ">=5.3.3" }, - "time": "2015-09-22 13:49:29", + "time": "2015-06-21 13:50:34", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com" + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ] }, { - "name": "symfony/dom-crawler", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "doctrine/instantiator", + "version": "1.0.5", + "version_normalized": "1.0.5.0", "source": { "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "2e185ca136399f902b948694987e62c80099c052" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2e185ca136399f902b948694987e62c80099c052", - "reference": "2e185ca136399f902b948694987e62c80099c052", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { - "symfony/css-selector": "~2.3", - "symfony/phpunit-bridge": "~2.7" - }, - "suggest": { - "symfony/css-selector": "" + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, - "time": "2015-09-20 21:13:58", + "time": "2015-06-14 21:17:01", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3323,170 +3396,149 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com" + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ] }, { - "name": "symfony/browser-kit", - "version": "v2.7.5", - "version_normalized": "2.7.5.0", + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "version_normalized": "2.3.8.0", "source": { "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "277a2457776d4cc25706fbdd9d1e4ab2dac884e4" + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/277a2457776d4cc25706fbdd9d1e4ab2dac884e4", - "reference": "277a2457776d4cc25706fbdd9d1e4ab2dac884e4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/dom-crawler": "~2.0,>=2.0.5" + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "symfony/css-selector": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.0,>=2.0.5" + "phpunit/phpunit": "~4.4" }, "suggest": { - "symfony/process": "" + "ext-soap": "*" }, - "time": "2015-09-06 08:36:38", + "time": "2015-10-02 06:51:40", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.3.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com" + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ] }, { - "name": "composer/semver", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "name": "phpunit/php-timer", + "version": "1.0.7", + "version_normalized": "1.0.7.0", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "d0e1ccc6d44ab318b758d709e19176037da6b1ba" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/d0e1ccc6d44ab318b758d709e19176037da6b1ba", - "reference": "d0e1ccc6d44ab318b758d709e19176037da6b1ba", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", "shasum": "" }, "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "~2.3" - }, - "time": "2015-09-21 09:42:36", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } + "php": ">=5.3.3" }, + "time": "2015-06-21 08:01:12", + "type": "library", "installation-source": "dist", "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Rob Bast", - "email": "rob.bast@gmail.com" - }, - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "semantic", - "semver", - "validation", - "versioning" + "timer" ] }, { - "name": "mikey179/vfsStream", - "version": "v1.6.0", - "version_normalized": "1.6.0.0", + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "version_normalized": "1.4.1.0", "source": { "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "73bcb605b741a7d5044b47592338c633788b0eb7" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/73bcb605b741a7d5044b47592338c633788b0eb7", - "reference": "73bcb605b741a7d5044b47592338c633788b0eb7", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.5" + "php": ">=5.3.3" }, - "time": "2015-10-06 16:59:57", + "time": "2015-06-21 13:08:43", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.4.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "org\\bovigo\\vfs\\": "src/main/php" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3494,13 +3546,17 @@ ], "authors": [ { - "name": "Frank Kleine", - "homepage": "http://frankkleine.de/", - "role": "Developer" + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "description": "Virtual file system to mock the real file system in unit tests.", - "homepage": "http://vfs.bovigo.org/" + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ] }, { "name": "phpunit/php-code-coverage", @@ -3567,6 +3623,68 @@ ] }, { + "name": "phpspec/prophecy", + "version": "v1.5.0", + "version_normalized": "1.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" + }, + "require-dev": { + "phpspec/phpspec": "~2.0" + }, + "time": "2015-08-13 10:07:40", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ] + }, + { "name": "phpunit/phpunit", "version": "4.8.11", "version_normalized": "4.8.11.0", @@ -3639,123 +3757,5 @@ "testing", "xunit" ] - }, - { - "name": "zendframework/zend-hydrator", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-hydrator.git", - "reference": "f3ed8b833355140350bbed98d8a7b8b66875903f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/f3ed8b833355140350bbed98d8a7b8b66875903f", - "reference": "f3ed8b833355140350bbed98d8a7b8b66875903f", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "zendframework/zend-stdlib": "^2.5.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.0@dev", - "zendframework/zend-eventmanager": "^2.5.1", - "zendframework/zend-filter": "^2.5.1", - "zendframework/zend-inputfilter": "^2.5.1", - "zendframework/zend-serializer": "^2.5.1", - "zendframework/zend-servicemanager": "^2.5.1" - }, - "suggest": { - "zendframework/zend-eventmanager": "^2.5.1, to support aggregate hydrator usage", - "zendframework/zend-filter": "^2.5.1, to support naming strategy hydrator usage", - "zendframework/zend-serializer": "^2.5.1, to use the SerializableStrategy", - "zendframework/zend-servicemanager": "^2.5.1, to support hydrator plugin manager usage" - }, - "time": "2015-09-17 14:06:43", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev", - "dev-develop": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Hydrator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-hydrator", - "keywords": [ - "hydrator", - "zf2" - ] - }, - { - "name": "zendframework/zend-stdlib", - "version": "2.7.3", - "version_normalized": "2.7.3.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "8ac0c77ff567fcf49b58689ee3bfa7595be102bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/8ac0c77ff567fcf49b58689ee3bfa7595be102bc", - "reference": "8ac0c77ff567fcf49b58689ee3bfa7595be102bc", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "zendframework/zend-hydrator": "~1.0" - }, - "require-dev": { - "athletic/athletic": "~0.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-inputfilter": "~2.5", - "zendframework/zend-serializer": "~2.5", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" - }, - "time": "2015-09-25 04:06:33", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Stdlib\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-stdlib", - "keywords": [ - "stdlib", - "zf2" - ] } ] diff --git a/vendor/composer/installers/src/Composer/Installers/Installer.php b/vendor/composer/installers/src/Composer/Installers/Installer.php index 8985149..63ba64c 100644 --- a/vendor/composer/installers/src/Composer/Installers/Installer.php +++ b/vendor/composer/installers/src/Composer/Installers/Installer.php @@ -80,7 +80,7 @@ public function getInstallPath(PackageInterface $package) if ($frameworkType === false) { throw new \InvalidArgumentException( - 'The package type of this package is not yet supported.' + 'Sorry the package type of this package is not yet supported.' ); } diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php deleted file mode 100644 index df81262..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of APC'); - } - } - - protected function _getCacheDriver() - { - return new ApcCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php deleted file mode 100644 index a6c3097..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php +++ /dev/null @@ -1,26 +0,0 @@ -_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats); - } - - protected function isSharedStorage() - { - return false; - } -} \ No newline at end of file diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php deleted file mode 100644 index eaedd99..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php +++ /dev/null @@ -1,40 +0,0 @@ -directory = sys_get_temp_dir() . '/doctrine_cache_'. uniqid(); - } while (file_exists($this->directory)); - } - - public function tearDown() - { - if ( ! is_dir($this->directory)) { - return; - } - - $iterator = new RecursiveDirectoryIterator($this->directory); - - foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) { - if ($file->isFile()) { - @unlink($file->getRealPath()); - } elseif ($file->isDir()) { - @rmdir($file->getRealPath()); - } - } - } - - protected function isSharedStorage() - { - return false; - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php deleted file mode 100644 index 3c7f619..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php +++ /dev/null @@ -1,373 +0,0 @@ -_getCacheDriver(); - - // Test saving a value, checking if it exists, and fetching it back - $this->assertTrue($cache->save('key', 'value')); - $this->assertTrue($cache->contains('key')); - $this->assertEquals('value', $cache->fetch('key')); - - // Test updating the value of a cache entry - $this->assertTrue($cache->save('key', 'value-changed')); - $this->assertTrue($cache->contains('key')); - $this->assertEquals('value-changed', $cache->fetch('key')); - - // Test deleting a value - $this->assertTrue($cache->delete('key')); - $this->assertFalse($cache->contains('key')); - } - - public function testFetchMulti() - { - $cache = $this->_getCacheDriver(); - - $cache->deleteAll(); - - // Test saving some values, checking if it exists, and fetching it back with multiGet - $this->assertTrue($cache->save('key1', 'value1')); - $this->assertTrue($cache->save('key2', 'value2')); - - $this->assertEquals( - array('key1' => 'value1', 'key2' => 'value2'), - $cache->fetchMultiple(array('key1', 'key2')) - ); - $this->assertEquals( - array('key1' => 'value1', 'key2' => 'value2'), - $cache->fetchMultiple(array('key1', 'key3', 'key2')) - ); - $this->assertEquals( - array('key1' => 'value1', 'key2' => 'value2'), - $cache->fetchMultiple(array('key1', 'key2', 'key3')) - ); - } - - public function testFetchMultiWillFilterNonRequestedKeys() - { - /* @var $cache \Doctrine\Common\Cache\CacheProvider|\PHPUnit_Framework_MockObject_MockObject */ - $cache = $this->getMockForAbstractClass( - 'Doctrine\Common\Cache\CacheProvider', - array(), - '', - true, - true, - true, - array('doFetchMultiple') - ); - - $cache - ->expects($this->once()) - ->method('doFetchMultiple') - ->will($this->returnValue(array( - '[foo][]' => 'bar', - '[bar][]' => 'baz', - '[baz][]' => 'tab', - ))); - - $this->assertEquals( - array('foo' => 'bar', 'bar' => 'baz'), - $cache->fetchMultiple(array('foo', 'bar')) - ); - } - - - public function provideCrudValues() - { - return array( - 'array' => array(array('one', 2, 3.0)), - 'string' => array('value'), - 'integer' => array(1), - 'float' => array(1.5), - 'object' => array(new ArrayObject()), - 'null' => array(null), - ); - } - - public function testDeleteAll() - { - $cache = $this->_getCacheDriver(); - - $this->assertTrue($cache->save('key1', 1)); - $this->assertTrue($cache->save('key2', 2)); - $this->assertTrue($cache->deleteAll()); - $this->assertFalse($cache->contains('key1')); - $this->assertFalse($cache->contains('key2')); - } - - public function testDeleteAllAndNamespaceVersioningBetweenCaches() - { - if ( ! $this->isSharedStorage()) { - $this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage'); - } - - $cache1 = $this->_getCacheDriver(); - $cache2 = $this->_getCacheDriver(); - - $this->assertTrue($cache1->save('key1', 1)); - $this->assertTrue($cache2->save('key2', 2)); - - /* Both providers are initialized with the same namespace version, so - * they can see entries set by each other. - */ - $this->assertTrue($cache1->contains('key1')); - $this->assertTrue($cache1->contains('key2')); - $this->assertTrue($cache2->contains('key1')); - $this->assertTrue($cache2->contains('key2')); - - /* Deleting all entries through one provider will only increment the - * namespace version on that object (and in the cache itself, which new - * instances will use to initialize). The second provider will retain - * its original version and still see stale data. - */ - $this->assertTrue($cache1->deleteAll()); - $this->assertFalse($cache1->contains('key1')); - $this->assertFalse($cache1->contains('key2')); - $this->assertTrue($cache2->contains('key1')); - $this->assertTrue($cache2->contains('key2')); - - /* A new cache provider should not see the deleted entries, since its - * namespace version will be initialized. - */ - $cache3 = $this->_getCacheDriver(); - $this->assertFalse($cache3->contains('key1')); - $this->assertFalse($cache3->contains('key2')); - } - - public function testFlushAll() - { - $cache = $this->_getCacheDriver(); - - $this->assertTrue($cache->save('key1', 1)); - $this->assertTrue($cache->save('key2', 2)); - $this->assertTrue($cache->flushAll()); - $this->assertFalse($cache->contains('key1')); - $this->assertFalse($cache->contains('key2')); - } - - public function testFlushAllAndNamespaceVersioningBetweenCaches() - { - if ( ! $this->isSharedStorage()) { - $this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage'); - } - - $cache1 = $this->_getCacheDriver(); - $cache2 = $this->_getCacheDriver(); - - /* Deleting all elements from the first provider should increment its - * namespace version before saving the first entry. - */ - $cache1->deleteAll(); - $this->assertTrue($cache1->save('key1', 1)); - - /* The second provider will be initialized with the same namespace - * version upon its first save operation. - */ - $this->assertTrue($cache2->save('key2', 2)); - - /* Both providers have the same namespace version and can see entires - * set by each other. - */ - $this->assertTrue($cache1->contains('key1')); - $this->assertTrue($cache1->contains('key2')); - $this->assertTrue($cache2->contains('key1')); - $this->assertTrue($cache2->contains('key2')); - - /* Flushing all entries through one cache will remove all entries from - * the cache but leave their namespace version as-is. - */ - $this->assertTrue($cache1->flushAll()); - $this->assertFalse($cache1->contains('key1')); - $this->assertFalse($cache1->contains('key2')); - $this->assertFalse($cache2->contains('key1')); - $this->assertFalse($cache2->contains('key2')); - - /* Inserting a new entry will use the same, incremented namespace - * version, and it will be visible to both providers. - */ - $this->assertTrue($cache1->save('key1', 1)); - $this->assertTrue($cache1->contains('key1')); - $this->assertTrue($cache2->contains('key1')); - - /* A new cache provider will be initialized with the original namespace - * version and not share any visibility with the first two providers. - */ - $cache3 = $this->_getCacheDriver(); - $this->assertFalse($cache3->contains('key1')); - $this->assertFalse($cache3->contains('key2')); - $this->assertTrue($cache3->save('key3', 3)); - $this->assertTrue($cache3->contains('key3')); - } - - public function testNamespace() - { - $cache = $this->_getCacheDriver(); - - $cache->setNamespace('ns1_'); - - $this->assertTrue($cache->save('key1', 1)); - $this->assertTrue($cache->contains('key1')); - - $cache->setNamespace('ns2_'); - - $this->assertFalse($cache->contains('key1')); - } - - public function testDeleteAllNamespace() - { - $cache = $this->_getCacheDriver(); - - $cache->setNamespace('ns1'); - $this->assertFalse($cache->contains('key1')); - $cache->save('key1', 'test'); - $this->assertTrue($cache->contains('key1')); - - $cache->setNamespace('ns2'); - $this->assertFalse($cache->contains('key1')); - $cache->save('key1', 'test'); - $this->assertTrue($cache->contains('key1')); - - $cache->setNamespace('ns1'); - $this->assertTrue($cache->contains('key1')); - $cache->deleteAll(); - $this->assertFalse($cache->contains('key1')); - - $cache->setNamespace('ns2'); - $this->assertTrue($cache->contains('key1')); - $cache->deleteAll(); - $this->assertFalse($cache->contains('key1')); - } - - /** - * @group DCOM-43 - */ - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertArrayHasKey(Cache::STATS_HITS, $stats); - $this->assertArrayHasKey(Cache::STATS_MISSES, $stats); - $this->assertArrayHasKey(Cache::STATS_UPTIME, $stats); - $this->assertArrayHasKey(Cache::STATS_MEMORY_USAGE, $stats); - $this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILABLE, $stats); - } - - public function testFetchMissShouldReturnFalse() - { - $cache = $this->_getCacheDriver(); - - /* Ensure that caches return boolean false instead of null on a fetch - * miss to be compatible with ORM integration. - */ - $result = $cache->fetch('nonexistent_key'); - - $this->assertFalse($result); - $this->assertNotNull($result); - } - - /** - * Check to see that, even if the user saves a value that can be interpreted as false, - * the cache adapter will still recognize its existence there. - * - * @dataProvider falseCastedValuesProvider - */ - public function testFalseCastedValues($value) - { - $cache = $this->_getCacheDriver(); - - $this->assertTrue($cache->save('key', $value)); - $this->assertTrue($cache->contains('key')); - $this->assertEquals($value, $cache->fetch('key')); - } - - /** - * The following values get converted to FALSE if you cast them to a boolean. - * @see http://php.net/manual/en/types.comparisons.php - */ - public function falseCastedValuesProvider() - { - return array( - array(false), - array(null), - array(array()), - array('0'), - array(0), - array(0.0), - array('') - ); - } - - /** - * Check to see that objects are correctly serialized and unserialized by the cache - * provider. - */ - public function testCachedObject() - { - $cache = $this->_getCacheDriver(); - $cache->deleteAll(); - $obj = new \stdClass(); - $obj->foo = "bar"; - $obj2 = new \stdClass(); - $obj2->bar = "foo"; - $obj2->obj = $obj; - $obj->obj2 = $obj2; - $cache->save("obj", $obj); - - $fetched = $cache->fetch("obj"); - - $this->assertInstanceOf("stdClass", $obj); - $this->assertInstanceOf("stdClass", $obj->obj2); - $this->assertInstanceOf("stdClass", $obj->obj2->obj); - $this->assertEquals("bar", $fetched->foo); - $this->assertEquals("foo", $fetched->obj2->bar); - } - - /** - * Check to see that objects fetched via fetchMultiple are properly unserialized - */ - public function testFetchMultipleObjects() - { - $cache = $this->_getCacheDriver(); - $cache->deleteAll(); - $obj1 = new \stdClass(); - $obj1->foo = "bar"; - $cache->save("obj1", $obj1); - $obj2 = new \stdClass(); - $obj2->bar = "baz"; - $cache->save("obj2", $obj2); - - $fetched = $cache->fetchMultiple(array("obj1", "obj2")); - $this->assertInstanceOf("stdClass", $fetched["obj1"]); - $this->assertInstanceOf("stdClass", $fetched["obj2"]); - $this->assertEquals("bar", $fetched["obj1"]->foo); - $this->assertEquals("baz", $fetched["obj2"]->bar); - } - - /** - * Return whether multiple cache providers share the same storage. - * - * This is used for skipping certain tests for shared storage behavior. - * - * @return boolean - */ - protected function isSharedStorage() - { - return true; - } - - /** - * @return \Doctrine\Common\Cache\CacheProvider - */ - abstract protected function _getCacheDriver(); -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php deleted file mode 100644 index 46d78c1..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php +++ /dev/null @@ -1,94 +0,0 @@ -_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertInternalType('array', $stats); - } - - public function testOnlyFetchFirstOne() - { - $cache1 = new ArrayCache(); - $cache2 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider'); - - $cache2->expects($this->never())->method('doFetch'); - - $chainCache = new ChainCache(array($cache1, $cache2)); - $chainCache->save('id', 'bar'); - - $this->assertEquals('bar', $chainCache->fetch('id')); - } - - public function testFetchPropagateToFastestCache() - { - $cache1 = new ArrayCache(); - $cache2 = new ArrayCache(); - - $cache2->save('bar', 'value'); - - $chainCache = new ChainCache(array($cache1, $cache2)); - - $this->assertFalse($cache1->contains('bar')); - - $result = $chainCache->fetch('bar'); - - $this->assertEquals('value', $result); - $this->assertTrue($cache2->contains('bar')); - } - - public function testNamespaceIsPropagatedToAllProviders() - { - $cache1 = new ArrayCache(); - $cache2 = new ArrayCache(); - - $chainCache = new ChainCache(array($cache1, $cache2)); - $chainCache->setNamespace('bar'); - - $this->assertEquals('bar', $cache1->getNamespace()); - $this->assertEquals('bar', $cache2->getNamespace()); - } - - public function testDeleteToAllProviders() - { - $cache1 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider'); - $cache2 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider'); - - $cache1->expects($this->once())->method('doDelete'); - $cache2->expects($this->once())->method('doDelete'); - - $chainCache = new ChainCache(array($cache1, $cache2)); - $chainCache->delete('bar'); - } - - public function testFlushToAllProviders() - { - $cache1 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider'); - $cache2 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider'); - - $cache1->expects($this->once())->method('doFlush'); - $cache2->expects($this->once())->method('doFlush'); - - $chainCache = new ChainCache(array($cache1, $cache2)); - $chainCache->flushAll(); - } - - protected function isSharedStorage() - { - return false; - } -} \ No newline at end of file diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php deleted file mode 100644 index 40d5a69..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php +++ /dev/null @@ -1,47 +0,0 @@ -couchbase = new Couchbase('127.0.0.1', 'Administrator', 'password', 'default'); - } catch(Exception $ex) { - $this->markTestSkipped('Could not instantiate the Couchbase cache because of: ' . $ex); - } - } else { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of the couchbase extension'); - } - } - - public function testNoExpire() - { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Couchbase provider should support no-expire'); - } - - public function testLongLifetime() - { - $cache = $this->_getCacheDriver(); - $cache->save('key', 'value', 30 * 24 * 3600 + 1); - - $this->assertTrue($cache->contains('key'), 'Couchbase provider should support TTL > 30 days'); - } - - protected function _getCacheDriver() - { - $driver = new CouchbaseCache(); - $driver->setCouchbase($this->couchbase); - return $driver; - } -} \ No newline at end of file diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php deleted file mode 100644 index 8868321..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php +++ /dev/null @@ -1,161 +0,0 @@ -driver = $this->getMock( - 'Doctrine\Common\Cache\FileCache', - array('doFetch', 'doContains', 'doSave'), - array(), '', false - ); - } - - public function getProviderFileName() - { - return array( - //The characters :\/<>"*?| are not valid in Windows filenames. - array('key:1', 'key-1'), - array('key\2', 'key-2'), - array('key/3', 'key-3'), - array('key<4', 'key-4'), - array('key>5', 'key-5'), - array('key"6', 'key-6'), - array('key*7', 'key-7'), - array('key?8', 'key-8'), - array('key|9', 'key-9'), - array('key[10]', 'key[10]'), - array('keyä11', 'key--11'), - array('../key12', '---key12'), - array('key-13', 'key__13'), - ); - } - - /** - * @dataProvider getProviderFileName - */ - public function testInvalidFilename($key, $expected) - { - $cache = $this->driver; - $method = new \ReflectionMethod($cache, 'getFilename'); - - $method->setAccessible(true); - - $value = $method->invoke($cache, $key); - $actual = pathinfo($value, PATHINFO_FILENAME); - - $this->assertEquals($expected, $actual); - } - - public function testFilenameCollision() - { - $data = array( - 'key:0' => 'key-0', - 'key\0' => 'key-0', - 'key/0' => 'key-0', - 'key<0' => 'key-0', - 'key>0' => 'key-0', - 'key"0' => 'key-0', - 'key*0' => 'key-0', - 'key?0' => 'key-0', - 'key|0' => 'key-0', - 'key-0' => 'key__0', - 'keyä0' => 'key--0', - ); - - $paths = array(); - $cache = $this->driver; - $method = new \ReflectionMethod($cache, 'getFilename'); - - $method->setAccessible(true); - - foreach ($data as $key => $expected) { - $path = $method->invoke($cache, $key); - $actual = pathinfo($path, PATHINFO_FILENAME); - - $this->assertNotContains($path, $paths); - $this->assertEquals($expected, $actual); - - $paths[] = $path; - } - } - - public function testFilenameShouldCreateThePathWithFourSubDirectories() - { - $cache = $this->driver; - $method = new \ReflectionMethod($cache, 'getFilename'); - $key = 'item-key'; - $expectedDir = array( - '84', 'e0', 'e2', 'e8', '93', 'fe', 'bb', '73', '7a', '0f', 'ee', - '0c', '89', 'd5', '3f', '4b', 'b7', 'fc', 'b4', '4c', '57', 'cd', - 'f3', 'd3', '2c', 'e7', '36', '3f', '5d', '59', '77', '60' - ); - $expectedDir = implode(DIRECTORY_SEPARATOR, $expectedDir); - - $method->setAccessible(true); - - $path = $method->invoke($cache, $key); - $filename = pathinfo($path, PATHINFO_FILENAME); - $dirname = pathinfo($path, PATHINFO_DIRNAME); - - $this->assertEquals('item__key', $filename); - $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir, $dirname); - $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir . DIRECTORY_SEPARATOR . 'item__key', $path); - } - - public function testFileExtensionCorrectlyEscaped() - { - $driver1 = $this->getMock( - 'Doctrine\Common\Cache\FileCache', - array('doFetch', 'doContains', 'doSave'), - array(__DIR__, '.*') - ); - $driver2 = $this->getMock( - 'Doctrine\Common\Cache\FileCache', - array('doFetch', 'doContains', 'doSave'), - array(__DIR__, '.php') - ); - - $doGetStats = new \ReflectionMethod($driver1, 'doGetStats'); - - $doGetStats->setAccessible(true); - - $stats1 = $doGetStats->invoke($driver1); - $stats2 = $doGetStats->invoke($driver2); - - $this->assertSame(0, $stats1[Cache::STATS_MEMORY_USAGE]); - $this->assertGreaterThan(0, $stats2[Cache::STATS_MEMORY_USAGE]); - } - - /** - * @group DCOM-266 - */ - public function testFileExtensionSlashCorrectlyEscaped() - { - $driver = $this->getMock( - 'Doctrine\Common\Cache\FileCache', - array('doFetch', 'doContains', 'doSave'), - array(__DIR__ . '/../', '/' . basename(__FILE__)) - ); - - $doGetStats = new \ReflectionMethod($driver, 'doGetStats'); - - $doGetStats->setAccessible(true); - - $stats = $doGetStats->invoke($driver); - - $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_USAGE]); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php deleted file mode 100644 index e3b74cd..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php +++ /dev/null @@ -1,75 +0,0 @@ -_getCacheDriver(); - - // Test save - $cache->save('test_key', 'testing this out', 10); - - // Test contains to test that save() worked - $this->assertTrue($cache->contains('test_key')); - - // Test fetch - $this->assertEquals('testing this out', $cache->fetch('test_key')); - - // access private methods - $getFilename = new \ReflectionMethod($cache, 'getFilename'); - $getNamespacedId = new \ReflectionMethod($cache, 'getNamespacedId'); - - $getFilename->setAccessible(true); - $getNamespacedId->setAccessible(true); - - $id = $getNamespacedId->invoke($cache, 'test_key'); - $filename = $getFilename->invoke($cache, $id); - - $data = ''; - $lifetime = 0; - $resource = fopen($filename, "r"); - - if (false !== ($line = fgets($resource))) { - $lifetime = (integer) $line; - } - - while (false !== ($line = fgets($resource))) { - $data .= $line; - } - - $this->assertNotEquals(0, $lifetime, "previous lifetime could not be loaded"); - - // update lifetime - $lifetime = $lifetime - 20; - file_put_contents($filename, $lifetime . PHP_EOL . $data); - - // test expired data - $this->assertFalse($cache->contains('test_key')); - $this->assertFalse($cache->fetch('test_key')); - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats[Cache::STATS_HITS]); - $this->assertNull($stats[Cache::STATS_MISSES]); - $this->assertNull($stats[Cache::STATS_UPTIME]); - $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]); - $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]); - } - - protected function _getCacheDriver() - { - return new FilesystemCache($this->directory); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php deleted file mode 100644 index b0da1b9..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php +++ /dev/null @@ -1,54 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of memcache'); - } - - $this->memcache = new Memcache(); - - if (@$this->memcache->connect('localhost', 11211) === false) { - unset($this->memcache); - $this->markTestSkipped('The ' . __CLASS__ .' cannot connect to memcache'); - } - } - - public function tearDown() - { - if ($this->memcache instanceof Memcache) { - $this->memcache->flush(); - } - } - - public function testNoExpire() - { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Memcache provider should support no-expire'); - } - - public function testLongLifetime() - { - $cache = $this->_getCacheDriver(); - $cache->save('key', 'value', 30 * 24 * 3600 + 1); - $this->assertTrue($cache->contains('key'), 'Memcache provider should support TTL > 30 days'); - } - - protected function _getCacheDriver() - { - $driver = new MemcacheCache(); - $driver->setMemcache($this->memcache); - return $driver; - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php deleted file mode 100644 index 2028acc..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php +++ /dev/null @@ -1,70 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of memcached'); - } - - $this->memcached = new Memcached(); - $this->memcached->setOption(Memcached::OPT_COMPRESSION, false); - $this->memcached->addServer('127.0.0.1', 11211); - - if (@fsockopen('127.0.0.1', 11211) === false) { - unset($this->memcached); - $this->markTestSkipped('The ' . __CLASS__ .' cannot connect to memcache'); - } - } - - public function tearDown() - { - if ($this->memcached instanceof Memcached) { - $this->memcached->flush(); - } - } - - public function testNoExpire() - { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Memcache provider should support no-expire'); - } - - public function testLongLifetime() - { - $cache = $this->_getCacheDriver(); - $cache->save('key', 'value', 30 * 24 * 3600 + 1); - $this->assertTrue($cache->contains('key'), 'Memcache provider should support TTL > 30 days'); - } - - protected function _getCacheDriver() - { - $driver = new MemcachedCache(); - $driver->setMemcached($this->memcached); - return $driver; - } - - /** - * {@inheritDoc} - * - * @dataProvider falseCastedValuesProvider - */ - public function testFalseCastedValues($value) - { - if (false === $value) { - $this->markTestIncomplete('Memcached currently doesn\'t support saving `false` values. '); - } - - parent::testFalseCastedValues($value); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php deleted file mode 100644 index 8c2f6e0..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php +++ /dev/null @@ -1,61 +0,0 @@ -=')) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of mongo >= 1.3.0'); - } - - $mongo = new MongoClient(); - $this->collection = $mongo->selectCollection('doctrine_common_cache', 'test'); - } - - public function tearDown() - { - if ($this->collection instanceof MongoCollection) { - $this->collection->drop(); - } - } - - public function testSaveWithNonUtf8String() - { - // Invalid 2-octet sequence - $data = "\xc3\x28"; - - $cache = $this->_getCacheDriver(); - - $this->assertTrue($cache->save('key', $data)); - $this->assertEquals($data, $cache->fetch('key')); - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats[Cache::STATS_HITS]); - $this->assertNull($stats[Cache::STATS_MISSES]); - $this->assertGreaterThan(0, $stats[Cache::STATS_UPTIME]); - $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]); - $this->assertNull($stats[Cache::STATS_MEMORY_AVAILABLE]); - } - - protected function _getCacheDriver() - { - return new MongoDBCache($this->collection); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php deleted file mode 100644 index f83a6e4..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php +++ /dev/null @@ -1,128 +0,0 @@ -_getCacheDriver(); - - // Test save - $cache->save('test_key', 'testing this out', 10); - - // Test contains to test that save() worked - $this->assertTrue($cache->contains('test_key')); - - // Test fetch - $this->assertEquals('testing this out', $cache->fetch('test_key')); - - // access private methods - $getFilename = new \ReflectionMethod($cache, 'getFilename'); - $getNamespacedId = new \ReflectionMethod($cache, 'getNamespacedId'); - - $getFilename->setAccessible(true); - $getNamespacedId->setAccessible(true); - - $id = $getNamespacedId->invoke($cache, 'test_key'); - $path = $getFilename->invoke($cache, $id); - $value = include $path; - - // update lifetime - $value['lifetime'] = $value['lifetime'] - 20; - file_put_contents($path, 'assertFalse($cache->contains('test_key')); - $this->assertFalse($cache->fetch('test_key')); - } - - public function testImplementsSetState() - { - $cache = $this->_getCacheDriver(); - - // Test save - $cache->save('test_set_state', new SetStateClass(array(1,2,3))); - - //Test __set_state call - $this->assertCount(0, SetStateClass::$values); - - // Test fetch - $value = $cache->fetch('test_set_state'); - $this->assertInstanceOf('Doctrine\Tests\Common\Cache\SetStateClass', $value); - $this->assertEquals(array(1,2,3), $value->getValue()); - - //Test __set_state call - $this->assertCount(1, SetStateClass::$values); - - // Test contains - $this->assertTrue($cache->contains('test_set_state')); - } - - public function testNotImplementsSetState() - { - $cache = $this->_getCacheDriver(); - - $this->setExpectedException('InvalidArgumentException'); - $cache->save('test_not_set_state', new NotSetStateClass(array(1,2,3))); - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats[Cache::STATS_HITS]); - $this->assertNull($stats[Cache::STATS_MISSES]); - $this->assertNull($stats[Cache::STATS_UPTIME]); - $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]); - $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]); - } - - public function testCachedObject() - { - $this->markTestSkipped("PhpFileCache cannot handle objects that don't implement __set_state."); - } - - public function testFetchMultipleObjects() - { - $this->markTestSkipped("PhpFileCache cannot handle objects that don't implement __set_state."); - } - - protected function _getCacheDriver() - { - return new PhpFileCache($this->directory); - } -} - -class NotSetStateClass -{ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - public function getValue() - { - return $this->value; - } -} - -class SetStateClass extends NotSetStateClass -{ - public static $values = array(); - - public static function __set_state($data) - { - self::$values = $data; - return new self($data['value']); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PredisCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PredisCacheTest.php deleted file mode 100644 index fecc92b..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PredisCacheTest.php +++ /dev/null @@ -1,62 +0,0 @@ -markTestSkipped('Predis\Client is missing. Make sure to "composer install" to have all dev dependencies.'); - } - - $this->client = new Client(); - - try { - $this->client->connect(); - } catch (ConnectionException $e) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of redis'); - } - } - - public function testHitMissesStatsAreProvided() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNotNull($stats[Cache::STATS_HITS]); - $this->assertNotNull($stats[Cache::STATS_MISSES]); - } - - /** - * @return PredisCache - */ - protected function _getCacheDriver() - { - return new PredisCache($this->client); - } - - /** - * {@inheritDoc} - * - * @dataProvider falseCastedValuesProvider - */ - public function testFalseCastedValues($value) - { - if (array() === $value) { - $this->markTestIncomplete( - 'Predis currently doesn\'t support saving empty array values. ' - . 'See https://github.com/nrk/predis/issues/241' - ); - } - - parent::testFalseCastedValues($value); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php deleted file mode 100644 index 35d9f5e..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php +++ /dev/null @@ -1,40 +0,0 @@ -_redis = new \Redis(); - $ok = @$this->_redis->connect('127.0.0.1'); - if (!$ok) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of redis'); - } - } else { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of redis'); - } - } - - public function testHitMissesStatsAreProvided() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNotNull($stats[Cache::STATS_HITS]); - $this->assertNotNull($stats[Cache::STATS_MISSES]); - } - - protected function _getCacheDriver() - { - $driver = new RedisCache(); - $driver->setRedis($this->_redis); - return $driver; - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php deleted file mode 100644 index dce8cc0..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php +++ /dev/null @@ -1,64 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Riak'); - } - - try { - $this->connection = new Connection('127.0.0.1', 8087); - $this->bucket = new Bucket($this->connection, 'test'); - } catch (Exception\RiakException $e) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of Riak'); - } - } - - /** - * {@inheritdoc} - */ - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats); - } - - /** - * Retrieve RiakCache instance. - * - * @return \Doctrine\Common\Cache\RiakCache - */ - protected function _getCacheDriver() - { - return new RiakCache($this->bucket); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/SQLite3CacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/SQLite3CacheTest.php deleted file mode 100644 index 44ccce9..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/SQLite3CacheTest.php +++ /dev/null @@ -1,48 +0,0 @@ -file = tempnam(null, 'doctrine-cache-test-'); - unlink($this->file); - $this->sqlite = new SQLite3($this->file); - } - - protected function tearDown() - { - $this->sqlite = null; // DB must be closed before - unlink($this->file); - } - - public function testGetStats() - { - $this->assertNull($this->_getCacheDriver()->getStats()); - } - - public function testFetchSingle() - { - $id = uniqid('sqlite3_id_'); - $data = "\0"; // produces null bytes in serialized format - - $this->_getCacheDriver()->save($id, $data, 30); - - $this->assertEquals($data, $this->_getCacheDriver()->fetch($id)); - } - - protected function _getCacheDriver() - { - return new SQLite3Cache($this->sqlite, 'test_table'); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/VoidCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/VoidCacheTest.php deleted file mode 100644 index ca87f16..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/VoidCacheTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertFalse($cache->contains('foo')); - $this->assertFalse($cache->contains('bar')); - } - - public function testShouldAlwaysReturnFalseOnFetch() - { - $cache = new VoidCache(); - - $this->assertFalse($cache->fetch('foo')); - $this->assertFalse($cache->fetch('bar')); - } - - public function testShouldAlwaysReturnTrueOnSaveButNotStoreAnything() - { - $cache = new VoidCache(); - - $this->assertTrue($cache->save('foo', 'fooVal')); - - $this->assertFalse($cache->contains('foo')); - $this->assertFalse($cache->fetch('foo')); - } - - public function testShouldAlwaysReturnTrueOnDelete() - { - $cache = new VoidCache(); - - $this->assertTrue($cache->delete('foo')); - } - - public function testShouldAlwaysReturnNullOnGetStatus() - { - $cache = new VoidCache(); - - $this->assertNull($cache->getStats()); - } -} diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php deleted file mode 100644 index cb363df..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Wincache'); - } - } - - protected function _getCacheDriver() - { - return new WincacheCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php deleted file mode 100644 index 6259848..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of xcache'); - } - } - - protected function _getCacheDriver() - { - return new XcacheCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php deleted file mode 100644 index cd66e15..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php +++ /dev/null @@ -1,28 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Zend Data Cache which only works in apache2handler SAPI'); - } - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats); - } - - protected function _getCacheDriver() - { - return new ZendDataCache(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -add('Doctrine\\Tests\\', __DIR__ . '/../../'); -unset($classLoader); diff --git a/vendor/doctrine/cache/tests/travis/php.ini b/vendor/doctrine/cache/tests/travis/php.ini deleted file mode 100644 index 105af36..0000000 --- a/vendor/doctrine/cache/tests/travis/php.ini +++ /dev/null @@ -1,7 +0,0 @@ -extension="mongo.so" -extension="memcache.so" -extension="memcached.so" -extension="redis.so" - -apc.enabled=1 -apc.enable_cli=1 diff --git a/vendor/doctrine/cache/tests/travis/phpunit.travis.xml b/vendor/doctrine/cache/tests/travis/phpunit.travis.xml deleted file mode 100644 index a01faa5..0000000 --- a/vendor/doctrine/cache/tests/travis/phpunit.travis.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - ../Doctrine/ - - - - - - ../../lib/Doctrine/ - - - - - - performance - - - diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php deleted file mode 100644 index 4de82cc..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertFalse($collection->isInitialized()); - $this->assertCount(3, $collection); - - $collection->add('bar'); - $this->assertTrue($collection->isInitialized()); - $this->assertCount(4, $collection); - } -} diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ArrayCollectionTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ArrayCollectionTest.php deleted file mode 100644 index 1b8a906..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ArrayCollectionTest.php +++ /dev/null @@ -1,296 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Collections; - -use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\Common\Collections\Criteria; - -/** - * Tests for {@see \Doctrine\Common\Collections\ArrayCollection} - * - * @covers \Doctrine\Common\Collections\ArrayCollection - */ -class ArrayCollectionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider provideDifferentElements - */ - public function testToArray($elements) - { - $collection = new ArrayCollection($elements); - - $this->assertSame($elements, $collection->toArray()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testFirst($elements) - { - $collection = new ArrayCollection($elements); - $this->assertSame(reset($elements), $collection->first()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testLast($elements) - { - $collection = new ArrayCollection($elements); - $this->assertSame(end($elements), $collection->last()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testKey($elements) - { - $collection = new ArrayCollection($elements); - - $this->assertSame(key($elements), $collection->key()); - - next($elements); - $collection->next(); - - $this->assertSame(key($elements), $collection->key()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testNext($elements) - { - $collection = new ArrayCollection($elements); - - while (true) { - $collectionNext = $collection->next(); - $arrayNext = next($elements); - - if(!$collectionNext || !$arrayNext) { - break; - } - - $this->assertSame($arrayNext, $collectionNext, "Returned value of ArrayCollection::next() and next() not match"); - $this->assertSame(key($elements), $collection->key(), "Keys not match"); - $this->assertSame(current($elements), $collection->current(), "Current values not match"); - } - } - - /** - * @dataProvider provideDifferentElements - */ - public function testCurrent($elements) - { - $collection = new ArrayCollection($elements); - - $this->assertSame(current($elements), $collection->current()); - - next($elements); - $collection->next(); - - $this->assertSame(current($elements), $collection->current()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testGetKeys($elements) - { - $collection = new ArrayCollection($elements); - - $this->assertSame(array_keys($elements), $collection->getKeys()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testGetValues($elements) - { - $collection = new ArrayCollection($elements); - - $this->assertSame(array_values($elements), $collection->getValues()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testCount($elements) - { - $collection = new ArrayCollection($elements); - - $this->assertSame(count($elements), $collection->count()); - } - - /** - * @dataProvider provideDifferentElements - */ - public function testIterator($elements) - { - $collection = new ArrayCollection($elements); - - $iterations = 0; - foreach($collection->getIterator() as $key => $item) { - $this->assertSame($elements[$key], $item, "Item {$key} not match"); - $iterations++; - } - - $this->assertEquals(count($elements), $iterations, "Number of iterations not match"); - } - - /** - * @return array - */ - public function provideDifferentElements() - { - return array( - 'indexed' => array(array(1, 2, 3, 4, 5)), - 'associative' => array(array('A' => 'a', 'B' => 'b', 'C' => 'c')), - 'mixed' => array(array('A' => 'a', 1, 'B' => 'b', 2, 3)), - ); - } - - public function testRemove() - { - $elements = array(1, 'A' => 'a', 2, 'B' => 'b', 3); - $collection = new ArrayCollection($elements); - - $this->assertEquals(1, $collection->remove(0)); - unset($elements[0]); - - $this->assertEquals(null, $collection->remove('non-existent')); - unset($elements['non-existent']); - - $this->assertEquals(2, $collection->remove(1)); - unset($elements[1]); - - $this->assertEquals('a', $collection->remove('A')); - unset($elements['A']); - - $this->assertEquals($elements, $collection->toArray()); - } - - public function testRemoveElement() - { - $elements = array(1, 'A' => 'a', 2, 'B' => 'b', 3, 'A2' => 'a', 'B2' => 'b'); - $collection = new ArrayCollection($elements); - - $this->assertTrue($collection->removeElement(1)); - unset($elements[0]); - - $this->assertFalse($collection->removeElement('non-existent')); - - $this->assertTrue($collection->removeElement('a')); - unset($elements['A']); - - $this->assertTrue($collection->removeElement('a')); - unset($elements['A2']); - - $this->assertEquals($elements, $collection->toArray()); - } - - public function testContainsKey() - { - $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'B2' => 'b'); - $collection = new ArrayCollection($elements); - - $this->assertTrue($collection->containsKey(0), "Contains index 0"); - $this->assertTrue($collection->containsKey('A'), "Contains key \"A\""); - $this->assertTrue($collection->containsKey('null'), "Contains key \"null\", with value null"); - $this->assertFalse($collection->containsKey('non-existent'), "Doesn't contain key"); - } - - public function testEmpty() - { - $collection = new ArrayCollection(); - $this->assertTrue($collection->isEmpty(), "Empty collection"); - - $collection->add(1); - $this->assertFalse($collection->isEmpty(), "Not empty collection"); - } - - public function testContains() - { - $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0); - $collection = new ArrayCollection($elements); - - $this->assertTrue($collection->contains(0), "Contains Zero"); - $this->assertTrue($collection->contains('a'), "Contains \"a\""); - $this->assertTrue($collection->contains(null), "Contains Null"); - $this->assertFalse($collection->contains('non-existent'), "Doesn't contain an element"); - } - - public function testExists() - { - $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0); - $collection = new ArrayCollection($elements); - - $this->assertTrue($collection->exists(function($key, $element) { - return $key == 'A' && $element == 'a'; - }), "Element exists"); - - $this->assertFalse($collection->exists(function($key, $element) { - return $key == 'non-existent' && $element == 'non-existent'; - }), "Element not exists"); - } - - public function testIndexOf() - { - $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0); - $collection = new ArrayCollection($elements); - - $this->assertSame(array_search(2, $elements, true), $collection->indexOf(2), 'Index of 2'); - $this->assertSame(array_search(null, $elements, true), $collection->indexOf(null), 'Index of null'); - $this->assertSame(array_search('non-existent', $elements, true), $collection->indexOf('non-existent'), 'Index of non existent'); - } - - public function testGet() - { - $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0); - $collection = new ArrayCollection($elements); - - $this->assertSame(2, $collection->get(1), 'Get element by index'); - $this->assertSame('a', $collection->get('A'), 'Get element by name'); - $this->assertSame(null, $collection->get('non-existent'), 'Get non existent element'); - } - - public function testMatchingWithSortingPreservesyKeys() - { - $object1 = new \stdClass(); - $object2 = new \stdClass(); - - $object1->sortField = 2; - $object2->sortField = 1; - - $collection = new ArrayCollection(array( - 'object1' => $object1, - 'object2' => $object2, - )); - - $this->assertSame( - array( - 'object2' => $object2, - 'object1' => $object1, - ), - $collection - ->matching(new Criteria(null, array('sortField' => Criteria::ASC))) - ->toArray() - ); - } -} diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php deleted file mode 100644 index 21c2e3d..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php +++ /dev/null @@ -1,250 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Collections; - -use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor; -use Doctrine\Common\Collections\ExpressionBuilder; - -/** - * @group DDC-1637 - */ -class ClosureExpressionVisitorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var ClosureExpressionVisitor - */ - private $visitor; - - /** - * @var ExpressionBuilder - */ - private $builder; - - protected function setUp() - { - $this->visitor = new ClosureExpressionVisitor(); - $this->builder = new ExpressionBuilder(); - } - - public function testGetObjectFieldValueIsAccessor() - { - $object = new TestObject(1, 2, true); - - $this->assertTrue($this->visitor->getObjectFieldValue($object, 'baz')); - } - - public function testGetObjectFieldValueMagicCallMethod() - { - $object = new TestObject(1, 2, true, 3); - - $this->assertEquals(3, $this->visitor->getObjectFieldValue($object, 'qux')); - } - - public function testWalkEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->eq("foo", 1)); - - $this->assertTrue($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(2))); - } - - public function testWalkNotEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->neq("foo", 1)); - - $this->assertFalse($closure(new TestObject(1))); - $this->assertTrue($closure(new TestObject(2))); - } - - public function testWalkLessThanComparison() - { - $closure = $this->visitor->walkComparison($this->builder->lt("foo", 1)); - - $this->assertFalse($closure(new TestObject(1))); - $this->assertTrue($closure(new TestObject(0))); - } - - public function testWalkLessThanEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->lte("foo", 1)); - - $this->assertFalse($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(1))); - $this->assertTrue($closure(new TestObject(0))); - } - - public function testWalkGreaterThanEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->gte("foo", 1)); - - $this->assertTrue($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(0))); - } - - public function testWalkGreaterThanComparison() - { - $closure = $this->visitor->walkComparison($this->builder->gt("foo", 1)); - - $this->assertTrue($closure(new TestObject(2))); - $this->assertFalse($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(0))); - } - - public function testWalkInComparison() - { - $closure = $this->visitor->walkComparison($this->builder->in("foo", array(1, 2, 3))); - - $this->assertTrue($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(0))); - } - - public function testWalkNotInComparison() - { - $closure = $this->visitor->walkComparison($this->builder->notIn("foo", array(1, 2, 3))); - - $this->assertFalse($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(0))); - $this->assertTrue($closure(new TestObject(4))); - } - - public function testWalkContainsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->contains('foo', 'hello')); - - $this->assertTrue($closure(new TestObject('hello world'))); - $this->assertFalse($closure(new TestObject('world'))); - } - - public function testWalkAndCompositeExpression() - { - $closure = $this->visitor->walkCompositeExpression( - $this->builder->andX( - $this->builder->eq("foo", 1), - $this->builder->eq("bar", 1) - ) - ); - - $this->assertTrue($closure(new TestObject(1, 1))); - $this->assertFalse($closure(new TestObject(1, 0))); - $this->assertFalse($closure(new TestObject(0, 1))); - $this->assertFalse($closure(new TestObject(0, 0))); - } - - public function testWalkOrCompositeExpression() - { - $closure = $this->visitor->walkCompositeExpression( - $this->builder->orX( - $this->builder->eq("foo", 1), - $this->builder->eq("bar", 1) - ) - ); - - $this->assertTrue($closure(new TestObject(1, 1))); - $this->assertTrue($closure(new TestObject(1, 0))); - $this->assertTrue($closure(new TestObject(0, 1))); - $this->assertFalse($closure(new TestObject(0, 0))); - } - - public function testSortByFieldAscending() - { - $objects = array(new TestObject("b"), new TestObject("a"), new TestObject("c")); - $sort = ClosureExpressionVisitor::sortByField("foo"); - - usort($objects, $sort); - - $this->assertEquals("a", $objects[0]->getFoo()); - $this->assertEquals("b", $objects[1]->getFoo()); - $this->assertEquals("c", $objects[2]->getFoo()); - } - - public function testSortByFieldDescending() - { - $objects = array(new TestObject("b"), new TestObject("a"), new TestObject("c")); - $sort = ClosureExpressionVisitor::sortByField("foo", -1); - - usort($objects, $sort); - - $this->assertEquals("c", $objects[0]->getFoo()); - $this->assertEquals("b", $objects[1]->getFoo()); - $this->assertEquals("a", $objects[2]->getFoo()); - } - - public function testSortDelegate() - { - $objects = array(new TestObject("a", "c"), new TestObject("a", "b"), new TestObject("a", "a")); - $sort = ClosureExpressionVisitor::sortByField("bar", 1); - $sort = ClosureExpressionVisitor::sortByField("foo", 1, $sort); - - usort($objects, $sort); - - $this->assertEquals("a", $objects[0]->getBar()); - $this->assertEquals("b", $objects[1]->getBar()); - $this->assertEquals("c", $objects[2]->getBar()); - } - - public function testArrayComparison() - { - $closure = $this->visitor->walkComparison($this->builder->eq("foo", 42)); - - $this->assertTrue($closure(array('foo' => 42))); - } -} - -class TestObject -{ - private $foo; - private $bar; - private $baz; - private $qux; - - public function __construct($foo = null, $bar = null, $baz = null, $qux = null) - { - $this->foo = $foo; - $this->bar = $bar; - $this->baz = $baz; - $this->qux = $qux; - } - - public function __call($name, $arguments) - { - if ('getqux' === $name) { - return $this->qux; - } - } - - public function getFoo() - { - return $this->foo; - } - - public function getBar() - { - return $this->bar; - } - - public function isBaz() - { - return $this->baz; - } -} - diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php deleted file mode 100644 index f3f91ad..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php +++ /dev/null @@ -1,265 +0,0 @@ -collection = new ArrayCollection(); - } - - public function testIssetAndUnset() - { - $this->assertFalse(isset($this->collection[0])); - $this->collection->add('testing'); - $this->assertTrue(isset($this->collection[0])); - unset($this->collection[0]); - $this->assertFalse(isset($this->collection[0])); - } - - public function testToString() - { - $this->collection->add('testing'); - $this->assertTrue(is_string((string) $this->collection)); - } - - public function testRemovingNonExistentEntryReturnsNull() - { - $this->assertEquals(null, $this->collection->remove('testing_does_not_exist')); - } - - public function testExists() - { - $this->collection->add("one"); - $this->collection->add("two"); - $exists = $this->collection->exists(function($k, $e) { return $e == "one"; }); - $this->assertTrue($exists); - $exists = $this->collection->exists(function($k, $e) { return $e == "other"; }); - $this->assertFalse($exists); - } - - public function testMap() - { - $this->collection->add(1); - $this->collection->add(2); - $res = $this->collection->map(function($e) { return $e * 2; }); - $this->assertEquals(array(2, 4), $res->toArray()); - } - - public function testFilter() - { - $this->collection->add(1); - $this->collection->add("foo"); - $this->collection->add(3); - $res = $this->collection->filter(function($e) { return is_numeric($e); }); - $this->assertEquals(array(0 => 1, 2 => 3), $res->toArray()); - } - - public function testFirstAndLast() - { - $this->collection->add('one'); - $this->collection->add('two'); - - $this->assertEquals($this->collection->first(), 'one'); - $this->assertEquals($this->collection->last(), 'two'); - } - - public function testArrayAccess() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - - $this->assertEquals($this->collection[0], 'one'); - $this->assertEquals($this->collection[1], 'two'); - - unset($this->collection[0]); - $this->assertEquals($this->collection->count(), 1); - } - - public function testContainsKey() - { - $this->collection[5] = 'five'; - $this->assertTrue($this->collection->containsKey(5)); - } - - public function testContains() - { - $this->collection[0] = 'test'; - $this->assertTrue($this->collection->contains('test')); - } - - public function testSearch() - { - $this->collection[0] = 'test'; - $this->assertEquals(0, $this->collection->indexOf('test')); - } - - public function testGet() - { - $this->collection[0] = 'test'; - $this->assertEquals('test', $this->collection->get(0)); - } - - public function testGetKeys() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - $this->assertEquals(array(0, 1), $this->collection->getKeys()); - } - - public function testGetValues() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - $this->assertEquals(array('one', 'two'), $this->collection->getValues()); - } - - public function testCount() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - $this->assertEquals($this->collection->count(), 2); - $this->assertEquals(count($this->collection), 2); - } - - public function testForAll() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - $this->assertEquals($this->collection->forAll(function($k, $e) { return is_string($e); }), true); - $this->assertEquals($this->collection->forAll(function($k, $e) { return is_array($e); }), false); - } - - public function testPartition() - { - $this->collection[] = true; - $this->collection[] = false; - $partition = $this->collection->partition(function($k, $e) { return $e == true; }); - $this->assertEquals($partition[0][0], true); - $this->assertEquals($partition[1][0], false); - } - - public function testClear() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - $this->collection->clear(); - $this->assertEquals($this->collection->isEmpty(), true); - } - - public function testRemove() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - $el = $this->collection->remove(0); - - $this->assertEquals('one', $el); - $this->assertEquals($this->collection->contains('one'), false); - $this->assertNull($this->collection->remove(0)); - } - - public function testRemoveElement() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - - $this->assertTrue($this->collection->removeElement('two')); - $this->assertFalse($this->collection->contains('two')); - $this->assertFalse($this->collection->removeElement('two')); - } - - public function testSlice() - { - $this->collection[] = 'one'; - $this->collection[] = 'two'; - $this->collection[] = 'three'; - - $slice = $this->collection->slice(0, 1); - $this->assertInternalType('array', $slice); - $this->assertEquals(array('one'), $slice); - - $slice = $this->collection->slice(1); - $this->assertEquals(array(1 => 'two', 2 => 'three'), $slice); - - $slice = $this->collection->slice(1, 1); - $this->assertEquals(array(1 => 'two'), $slice); - } - - public function fillMatchingFixture() - { - $std1 = new \stdClass(); - $std1->foo = "bar"; - $this->collection[] = $std1; - - $std2 = new \stdClass(); - $std2->foo = "baz"; - $this->collection[] = $std2; - } - - /** - * @group DDC-1637 - */ - public function testMatching() - { - $this->fillMatchingFixture(); - - $col = $this->collection->matching(new Criteria(Criteria::expr()->eq("foo", "bar"))); - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col); - $this->assertNotSame($col, $this->collection); - $this->assertEquals(1, count($col)); - } - - /** - * @group DDC-1637 - */ - public function testMatchingOrdering() - { - $this->fillMatchingFixture(); - - $col = $this->collection->matching(new Criteria(null, array('foo' => 'DESC'))); - - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col); - $this->assertNotSame($col, $this->collection); - $this->assertEquals(2, count($col)); - $this->assertEquals('baz', $col->first()->foo); - $this->assertEquals('bar', $col->last()->foo); - } - - /** - * @group DDC-1637 - */ - public function testMatchingSlice() - { - $this->fillMatchingFixture(); - - $col = $this->collection->matching(new Criteria(null, null, 1, 1)); - - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col); - $this->assertNotSame($col, $this->collection); - $this->assertEquals(1, count($col)); - $this->assertEquals('baz', $col[0]->foo); - } - - public function testCanRemoveNullValuesByKey() - { - $this->collection->add(null); - $this->collection->remove(0); - $this->assertTrue($this->collection->isEmpty()); - } - - public function testCanVerifyExistingKeysWithNullValues() - { - $this->collection->set('key', null); - $this->assertTrue($this->collection->containsKey('key')); - } -} diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php deleted file mode 100644 index 1ab058a..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php +++ /dev/null @@ -1,83 +0,0 @@ -assertInstanceOf('Doctrine\Common\Collections\Criteria', $criteria); - } - - public function testConstructor() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria($expr, array("foo" => "ASC"), 10, 20); - - $this->assertSame($expr, $criteria->getWhereExpression()); - $this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings()); - $this->assertEquals(10, $criteria->getFirstResult()); - $this->assertEquals(20, $criteria->getMaxResults()); - } - - public function testWhere() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria(); - - $criteria->where($expr); - - $this->assertSame($expr, $criteria->getWhereExpression()); - } - - public function testAndWhere() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria(); - - $criteria->where($expr); - $expr = $criteria->getWhereExpression(); - $criteria->andWhere($expr); - - $where = $criteria->getWhereExpression(); - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where); - - $this->assertEquals(CompositeExpression::TYPE_AND, $where->getType()); - $this->assertSame(array($expr, $expr), $where->getExpressionList()); - } - - public function testOrWhere() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria(); - - $criteria->where($expr); - $expr = $criteria->getWhereExpression(); - $criteria->orWhere($expr); - - $where = $criteria->getWhereExpression(); - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where); - - $this->assertEquals(CompositeExpression::TYPE_OR, $where->getType()); - $this->assertSame(array($expr, $expr), $where->getExpressionList()); - } - - public function testOrderings() - { - $criteria = Criteria::create() - ->orderBy(array("foo" => "ASC")); - - $this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings()); - } - - public function testExpr() - { - $this->assertInstanceOf('Doctrine\Common\Collections\ExpressionBuilder', Criteria::expr()); - } -} diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php deleted file mode 100644 index 5f6b4ce..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php +++ /dev/null @@ -1,125 +0,0 @@ -builder = new ExpressionBuilder(); - } - - public function testAndX() - { - $expr = $this->builder->andX($this->builder->eq("a", "b")); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $expr); - $this->assertEquals(CompositeExpression::TYPE_AND, $expr->getType()); - } - - public function testOrX() - { - $expr = $this->builder->orX($this->builder->eq("a", "b")); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $expr); - $this->assertEquals(CompositeExpression::TYPE_OR, $expr->getType()); - } - - public function testInvalidAndXArgument() - { - $this->setExpectedException("RuntimeException"); - $this->builder->andX("foo"); - } - - public function testEq() - { - $expr = $this->builder->eq("a", "b"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::EQ, $expr->getOperator()); - } - - public function testNeq() - { - $expr = $this->builder->neq("a", "b"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::NEQ, $expr->getOperator()); - } - - public function testLt() - { - $expr = $this->builder->lt("a", "b"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::LT, $expr->getOperator()); - } - - public function testGt() - { - $expr = $this->builder->gt("a", "b"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::GT, $expr->getOperator()); - } - - public function testGte() - { - $expr = $this->builder->gte("a", "b"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::GTE, $expr->getOperator()); - } - - public function testLte() - { - $expr = $this->builder->lte("a", "b"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::LTE, $expr->getOperator()); - } - - public function testIn() - { - $expr = $this->builder->in("a", array("b")); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::IN, $expr->getOperator()); - } - - public function testNotIn() - { - $expr = $this->builder->notIn("a", array("b")); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::NIN, $expr->getOperator()); - } - - public function testIsNull() - { - $expr = $this->builder->isNull("a"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::EQ, $expr->getOperator()); - } - - public function testContains() - { - $expr = $this->builder->contains("a", "b"); - - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr); - $this->assertEquals(Comparison::CONTAINS, $expr->getOperator()); - } -} diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/LazyArrayCollection.php b/vendor/doctrine/collections/tests/Doctrine/Tests/LazyArrayCollection.php deleted file mode 100644 index 56736b8..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/LazyArrayCollection.php +++ /dev/null @@ -1,22 +0,0 @@ -collection = new ArrayCollection(array('a', 'b', 'c')); - } -} diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php b/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php deleted file mode 100644 index 973b5fe..0000000 --- a/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php +++ /dev/null @@ -1,21 +0,0 @@ -setIncludePath(__DIR__); - $classLoader->setFileExtension('.class.php'); - $classLoader->setNamespaceSeparator('_'); - - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassA')); - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassB')); - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassC')); - $this->assertFalse($classLoader->canLoadClass('OtherClass')); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassA'), true); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassB'), true); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassC'), true); - } - - public function testClassExists() - { - $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\ClassD')); - $badLoader = function($className) { - require __DIR__ . '/ClassLoaderTest/ClassD.php'; - return true; - }; - spl_autoload_register($badLoader); - $this->assertTrue(ClassLoader::classExists('ClassLoaderTest\ClassD')); - spl_autoload_unregister($badLoader); - } - - public function testGetClassLoader() - { - $cl = new ClassLoader('ClassLoaderTest', __DIR__); - $cl->register(); - $this->assertTrue(ClassLoader::getClassLoader('ClassLoaderTest\ClassD') instanceof \Doctrine\Common\ClassLoader); - $this->assertNull(ClassLoader::getClassLoader('This\Class\Does\Not\Exist')); - $cl->unregister(); - } - - public function testClassExistsWithSilentAutoloader() - { - $test = $this; - $silentLoader = function ($className) use ($test) { - $test->assertSame('ClassLoaderTest\ClassE', $className); - require __DIR__ . '/ClassLoaderTest/ClassE.php'; - }; - $additionalLoader = function () use ($test) { - $test->fail('Should not call this loader, class was already loaded'); - }; - - $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\ClassE')); - spl_autoload_register($silentLoader); - spl_autoload_register($additionalLoader); - $this->assertTrue(ClassLoader::classExists('ClassLoaderTest\ClassE')); - spl_autoload_unregister($additionalLoader); - spl_autoload_unregister($silentLoader); - } - - public function testClassExistsWhenLoaderIsProtected() - { - require_once __DIR__ . '/ClassLoaderTest/ExternalLoader.php'; - - // Test static call - \ClassLoaderTest\ExternalLoader::registerStatic(); - $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\Class\That\Does\Not\Exist')); - \ClassLoaderTest\ExternalLoader::unregisterStatic(); - - // Test object - $loader = new \ClassLoaderTest\ExternalLoader(); - $loader->register(); - $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\Class\That\Does\Not\Exist')); - $loader->unregister(); - } - - public function testLoadNonExistingClass() - { - $classLoader = new ClassLoader('ClassLoaderTest', __DIR__); - - $this->assertFalse($classLoader->loadClass('ClassLoaderTest\Non\Existing\ClassName')); - } - - public function testLoadFileNotContainingClassClass() - { - $classLoader = new ClassLoader('ClassLoaderTest', __DIR__); - - $classLoader->setFileExtension('.class.php'); - - $this->assertFalse($classLoader->loadClass('ClassLoaderTest\EmptyFile')); - } - - public function testSupportsInterfaceAutoloading() - { - $classLoader = new ClassLoader(); - $classLoader->setIncludePath(__DIR__); - $classLoader->setFileExtension('.class.php'); - $classLoader->setNamespaceSeparator('_'); - - $this->assertTrue($classLoader->loadClass('ClassLoaderTest_InterfaceA')); - $this->assertTrue(interface_exists('ClassLoaderTest_InterfaceA', false)); - } - - public function testSupportsTraitAutoloading() - { - if (! function_exists('trait_exists')) { - $this->markTestSkipped('You need a PHP version that supports traits in order to run this test'); - } - - $classLoader = new ClassLoader(); - $classLoader->setIncludePath(__DIR__); - $classLoader->setFileExtension('.class.php'); - $classLoader->setNamespaceSeparator('_'); - - $this->assertTrue($classLoader->loadClass('ClassLoaderTest_TraitA')); - $this->assertTrue(trait_exists('ClassLoaderTest_TraitA', false)); - } - - public function testMultipleAutoloadRequestsWillProduceSameResult() - { - $classLoader = new ClassLoader(); - $classLoader->setIncludePath(__DIR__); - $classLoader->setFileExtension('.class.php'); - $classLoader->setNamespaceSeparator('_'); - - $this->assertTrue($classLoader->loadClass('ClassLoaderTest_ClassA')); - $this->assertTrue($classLoader->loadClass('ClassLoaderTest_ClassA')); - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php deleted file mode 100644 index 8554654..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php +++ /dev/null @@ -1,6 +0,0 @@ -_eventManager = new EventManager; - $this->_preFooInvoked = false; - $this->_postFooInvoked = false; - } - - public function testInitialState() - { - $this->assertEquals(array(), $this->_eventManager->getListeners()); - $this->assertFalse($this->_eventManager->hasListeners(self::preFoo)); - $this->assertFalse($this->_eventManager->hasListeners(self::postFoo)); - } - - public function testAddEventListener() - { - $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this); - $this->assertTrue($this->_eventManager->hasListeners(self::preFoo)); - $this->assertTrue($this->_eventManager->hasListeners(self::postFoo)); - $this->assertEquals(1, count($this->_eventManager->getListeners(self::preFoo))); - $this->assertEquals(1, count($this->_eventManager->getListeners(self::postFoo))); - $this->assertEquals(2, count($this->_eventManager->getListeners())); - } - - public function testDispatchEvent() - { - $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this); - $this->_eventManager->dispatchEvent(self::preFoo); - $this->assertTrue($this->_preFooInvoked); - $this->assertFalse($this->_postFooInvoked); - } - - public function testRemoveEventListener() - { - $this->_eventManager->addEventListener(array('preBar'), $this); - $this->assertTrue($this->_eventManager->hasListeners(self::preBar)); - $this->_eventManager->removeEventListener(array('preBar'), $this); - $this->assertFalse($this->_eventManager->hasListeners(self::preBar)); - } - - public function testAddEventSubscriber() - { - $eventSubscriber = new TestEventSubscriber(); - $this->_eventManager->addEventSubscriber($eventSubscriber); - $this->assertTrue($this->_eventManager->hasListeners(self::preFoo)); - $this->assertTrue($this->_eventManager->hasListeners(self::postFoo)); - } - - /* Listener methods */ - - public function preFoo(EventArgs $e) - { - $this->_preFooInvoked = true; - } - - public function postFoo(EventArgs $e) - { - $this->_postFooInvoked = true; - } -} - -class TestEventSubscriber implements \Doctrine\Common\EventSubscriber -{ - public function getSubscribedEvents() - { - return array('preFoo', 'postFoo'); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php deleted file mode 100644 index 7c93290..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php +++ /dev/null @@ -1,97 +0,0 @@ -mr = new TestManagerRegistry( - 'ORM', - array('default_connection'), - array('default_manager'), - 'default', - 'default', - 'Doctrine\Common\Persistence\ObjectManagerAware' - ); - } - - public function testGetManagerForClass() - { - $this->mr->getManagerForClass('Doctrine\Tests\Common\Persistence\TestObject'); - } - - public function testGetManagerForInvalidClass() - { - $this->setExpectedException( - 'ReflectionException', - 'Class Doctrine\Tests\Common\Persistence\TestObjectInexistent does not exist' - ); - - $this->mr->getManagerForClass('prefix:TestObjectInexistent'); - } - - public function testGetManagerForAliasedClass() - { - $this->mr->getManagerForClass('prefix:TestObject'); - } - - public function testGetManagerForInvalidAliasedClass() - { - $this->setExpectedException( - 'ReflectionException', - 'Class Doctrine\Tests\Common\Persistence\TestObject:Foo does not exist' - ); - - $this->mr->getManagerForClass('prefix:TestObject:Foo'); - } -} - -class TestManager extends PHPUnit_Framework_TestCase -{ - public function getMetadataFactory() - { - $driver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - return new TestClassMetadataFactory($driver, $metadata); - } -} - -class TestManagerRegistry extends AbstractManagerRegistry -{ - protected function getService($name) - { - return new TestManager(); - } - - /** - * {@inheritdoc} - */ - protected function resetService($name) - { - - } - - public function getAliasNamespace($alias) - { - return __NAMESPACE__; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php deleted file mode 100644 index ab6cc5c..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php +++ /dev/null @@ -1,29 +0,0 @@ -getAllClassNames(); - - $this->assertEquals(array('Doctrine\TestClass'), $classes); - } -} - -class SimpleAnnotationDriver extends AnnotationDriver -{ - protected $entityAnnotationClasses = array('Doctrine\Entity' => true); - - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php deleted file mode 100644 index f9edd10..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php +++ /dev/null @@ -1,152 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver1->expects($this->never()) - ->method('loadMetadataForClass'); - $driver1->expectS($this->never()) - ->method('isTransient'); - - $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver2->expects($this->at(0)) - ->method('loadMetadataForClass') - ->with($this->equalTo($className), $this->equalTo($classMetadata)); - $driver2->expects($this->at(1)) - ->method('isTransient') - ->with($this->equalTo($className)) - ->will($this->returnValue( true )); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\Common\Persistence\Mapping'); - - $chain->loadMetadataForClass($className, $classMetadata); - - $this->assertTrue( $chain->isTransient($className) ); - } - - public function testLoadMetadata_NoDelegatorFound_ThrowsMappingException() - { - $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity'; - $classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - $chain->loadMetadataForClass($className, $classMetadata); - } - - public function testGatherAllClassNames() - { - $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity'; - $classMetadata = $this->getMock('Doctrine\Common\Persistence\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver1->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo'))); - - $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver2->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', 'FooBarBaz'))); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\ORM\Mapping'); - - $this->assertEquals(array( - 'Doctrine\Tests\Models\Company\Foo', - 'Doctrine\Tests\ORM\Mapping\Bar', - 'Doctrine\Tests\ORM\Mapping\Baz' - ), $chain->getAllClassNames()); - } - - /** - * @group DDC-706 - */ - public function testIsTransient() - { - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $chain = new MappingDriverChain(); - $chain->addDriver($driver1, 'Doctrine\Tests\Models\CMS'); - - $this->assertTrue($chain->isTransient('stdClass'), "stdClass isTransient"); - } - - /** - * @group DDC-1412 - */ - public function testDefaultDriver() - { - $companyDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $defaultDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $entityClassName = 'Doctrine\Tests\ORM\Mapping\DriverChainEntity'; - $managerClassName = 'Doctrine\Tests\Models\Company\CompanyManager'; - $chain = new MappingDriverChain(); - - $companyDriver->expects($this->never()) - ->method('loadMetadataForClass'); - $companyDriver->expects($this->once()) - ->method('isTransient') - ->with($this->equalTo($managerClassName)) - ->will($this->returnValue(false)); - - $defaultDriver->expects($this->never()) - ->method('loadMetadataForClass'); - $defaultDriver->expects($this->once()) - ->method('isTransient') - ->with($this->equalTo($entityClassName)) - ->will($this->returnValue(true)); - - $this->assertNull($chain->getDefaultDriver()); - - $chain->setDefaultDriver($defaultDriver); - $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company'); - - $this->assertSame($defaultDriver, $chain->getDefaultDriver()); - - $this->assertTrue($chain->isTransient($entityClassName)); - $this->assertFalse($chain->isTransient($managerClassName)); - } - - public function testDefaultDriverGetAllClassNames() - { - $companyDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $defaultDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $chain = new MappingDriverChain(); - - $companyDriver->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo'))); - - $defaultDriver->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Other\Class'))); - - $chain->setDefaultDriver($defaultDriver); - $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company'); - - $classNames = $chain->getAllClassNames(); - - $this->assertEquals(array('Doctrine\Tests\Models\Company\Foo', 'Other\Class'), $classNames); - } -} - -class DriverChainEntity -{ - -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php deleted file mode 100644 index b3815de..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php +++ /dev/null @@ -1,209 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $this->cmf = new TestClassMetadataFactory($driver, $metadata); - } - - public function testGetCacheDriver() - { - $this->assertNull($this->cmf->getCacheDriver()); - $cache = new ArrayCache(); - $this->cmf->setCacheDriver($cache); - $this->assertSame($cache, $this->cmf->getCacheDriver()); - } - - public function testGetMetadataFor() - { - $metadata = $this->cmf->getMetadataFor('stdClass'); - - $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata); - $this->assertTrue($this->cmf->hasMetadataFor('stdClass')); - } - - public function testGetMetadataForAbsentClass() - { - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass'); - } - - public function testGetParentMetadata() - { - $metadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - - $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata); - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\RootEntity')); - } - - public function testGetCachedMetadata() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $cache = new ArrayCache(); - $cache->save(__NAMESPACE__. '\ChildEntity$CLASSMETADATA', $metadata); - - $this->cmf->setCacheDriver($cache); - - $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - $this->assertSame($loadedMetadata, $metadata); - } - - public function testCacheGetMetadataFor() - { - $cache = new ArrayCache(); - $this->cmf->setCacheDriver($cache); - - $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - - $this->assertSame($loadedMetadata, $cache->fetch(__NAMESPACE__. '\ChildEntity$CLASSMETADATA')); - } - - public function testGetAliasedMetadata() - { - $this->cmf->getMetadataFor('prefix:ChildEntity'); - - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); - $this->assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity')); - } - - /** - * @group DCOM-270 - */ - public function testGetInvalidAliasedMetadata() - { - $this->setExpectedException( - 'Doctrine\Common\Persistence\Mapping\MappingException', - 'Class \'Doctrine\Tests\Common\Persistence\Mapping\ChildEntity:Foo\' does not exist' - ); - - $this->cmf->getMetadataFor('prefix:ChildEntity:Foo'); - } - - /** - * @group DCOM-270 - */ - public function testClassIsTransient() - { - $this->assertTrue($this->cmf->isTransient('prefix:ChildEntity:Foo')); - } - - public function testWillFallbackOnNotLoadedMetadata() - { - $classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $this->cmf->fallbackCallback = function () use ($classMetadata) { - return $classMetadata; - }; - - $this->cmf->metadata = null; - - $this->assertSame($classMetadata, $this->cmf->getMetadataFor('Foo')); - } - - public function testWillFailOnFallbackFailureWithNotLoadedMetadata() - { - $this->cmf->fallbackCallback = function () { - return null; - }; - - $this->cmf->metadata = null; - - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - - $this->cmf->getMetadataFor('Foo'); - } -} - -class TestClassMetadataFactory extends AbstractClassMetadataFactory -{ - public $driver; - public $metadata; - - /** @var callable|null */ - public $fallbackCallback; - - public function __construct($driver, $metadata) - { - $this->driver = $driver; - $this->metadata = $metadata; - } - - protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents) - { - - } - - protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) - { - return __NAMESPACE__ . '\\' . $simpleClassName; - } - - protected function initialize() - { - - } - - protected function newClassMetadataInstance($className) - { - return $this->metadata; - } - - protected function getDriver() - { - return $this->driver; - } - protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService) - { - } - - protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService) - { - } - - protected function isEntity(ClassMetadata $class) - { - return true; - } - - protected function onNotFoundMetadata($className) - { - if (! $fallback = $this->fallbackCallback) { - return null; - } - - return $fallback(); - } - - public function isTransient($class) - { - return true; - } -} - -class RootEntity -{ - -} - -class ChildEntity extends RootEntity -{ - -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php deleted file mode 100644 index 37072de..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php +++ /dev/null @@ -1,90 +0,0 @@ -assertEquals(array($path), $locator->getPaths()); - - $locator = new DefaultFileLocator($path); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testGetFileExtension() - { - $locator = new DefaultFileLocator(array(), ".yml"); - $this->assertEquals(".yml", $locator->getFileExtension()); - $locator->setFileExtension(".xml"); - $this->assertEquals(".xml", $locator->getFileExtension()); - } - - public function testUniquePaths() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path, $path)); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testFindMappingFile() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->assertEquals(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass')); - } - - public function testFindMappingFileNotFound() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->setExpectedException( - 'Doctrine\Common\Persistence\Mapping\MappingException', - "No mapping file found named 'stdClass2.yml' for class 'stdClass2'" - ); - $locator->findMappingFile('stdClass2'); - } - - public function testGetAllClassNames() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - $classes = $locator->getAllClassNames(null); - sort($classes); - - $this->assertEquals(array('global', 'stdClass'), $classes); - $this->assertEquals(array('stdClass'), $locator->getAllClassNames("global")); - } - - public function testGetAllClassNamesNonMatchingFileExtension() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".xml"); - $this->assertEquals(array(), $locator->getAllClassNames("global")); - } - - public function testFileExists() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->assertTrue($locator->fileExists("stdClass")); - $this->assertFalse($locator->fileExists("stdClass2")); - $this->assertTrue($locator->fileExists("global")); - $this->assertFalse($locator->fileExists("global2")); - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php deleted file mode 100644 index 020c242..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php +++ /dev/null @@ -1,142 +0,0 @@ -assertNull($driver->getGlobalBasename()); - - $driver->setGlobalBasename("global"); - $this->assertEquals("global", $driver->getGlobalBasename()); - } - - public function testGetElementFromGlobalFile() - { - $driver = new TestFileDriver($this->newLocator()); - $driver->setGlobalBasename("global"); - - $element = $driver->getElement('stdGlobal'); - - $this->assertEquals('stdGlobal', $element); - } - - public function testGetElementFromFile() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('findMappingFile') - ->with($this->equalTo('stdClass')) - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); - - $driver = new TestFileDriver($locator); - - $this->assertEquals('stdClass', $driver->getElement('stdClass')); - } - - public function testGetAllClassNamesGlobalBasename() - { - $driver = new TestFileDriver($this->newLocator()); - $driver->setGlobalBasename("global"); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdGlobal', 'stdGlobal2'), $classNames); - } - - public function testGetAllClassNamesFromMappingFile() - { - $locator = $this->newLocator(); - $locator->expects($this->any()) - ->method('getAllClassNames') - ->with($this->equalTo(null)) - ->will($this->returnValue(array('stdClass'))); - $driver = new TestFileDriver($locator); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdClass'), $classNames); - } - - public function testGetAllClassNamesBothSources() - { - $locator = $this->newLocator(); - $locator->expects($this->any()) - ->method('getAllClassNames') - ->with($this->equalTo('global')) - ->will($this->returnValue(array('stdClass'))); - $driver = new TestFileDriver($locator); - $driver->setGlobalBasename("global"); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdGlobal', 'stdGlobal2', 'stdClass'), $classNames); - } - - public function testIsNotTransient() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('fileExists') - ->with($this->equalTo('stdClass')) - ->will($this->returnValue( true )); - - $driver = new TestFileDriver($locator); - $driver->setGlobalBasename("global"); - - $this->assertFalse($driver->isTransient('stdClass')); - $this->assertFalse($driver->isTransient('stdGlobal')); - $this->assertFalse($driver->isTransient('stdGlobal2')); - } - - public function testIsTransient() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('fileExists') - ->with($this->equalTo('stdClass2')) - ->will($this->returnValue( false )); - - $driver = new TestFileDriver($locator); - - $this->assertTrue($driver->isTransient('stdClass2')); - } - - public function testNonLocatorFallback() - { - $driver = new TestFileDriver(__DIR__ . '/_files', '.yml'); - $this->assertTrue($driver->isTransient('stdClass2')); - $this->assertFalse($driver->isTransient('stdClass')); - } - - private function newLocator() - { - $locator = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\FileLocator'); - $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml')); - $locator->expects($this->any())->method('getPaths')->will($this->returnValue(array(__DIR__ . "/_files"))); - return $locator; - } -} - -class TestFileDriver extends FileDriver -{ - protected function loadMappingFile($file) - { - if (strpos($file, "global.yml") !== false) { - return array('stdGlobal' => 'stdGlobal', 'stdGlobal2' => 'stdGlobal2'); - } - return array('stdClass' => 'stdClass'); - } - - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php deleted file mode 100644 index 8fc4d80..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $metadata->expects($this->once())->method('getFieldNames'); - - $driver = new PHPDriver(array(__DIR__ . "/_files")); - $driver->loadMetadataForClass('TestEntity', $metadata); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php deleted file mode 100644 index 767ccd6..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Persistence\Mapping; - -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; - -/** - * @group DCOM-93 - */ -class RuntimeReflectionServiceTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var RuntimeReflectionService - */ - private $reflectionService; - - public $unusedPublicProperty; - - public function setUp() - { - $this->reflectionService = new RuntimeReflectionService(); - } - - public function testShortname() - { - $this->assertEquals("RuntimeReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__)); - } - - public function testClassNamespaceName() - { - $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__)); - } - - public function testGetParentClasses() - { - $classes = $this->reflectionService->getParentClasses(__CLASS__); - $this->assertTrue(count($classes) >= 1, "The test class ".__CLASS__." should have at least one parent."); - } - - public function testGetParentClassesForAbsentClass() - { - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - $this->reflectionService->getParentClasses(__NAMESPACE__ . '\AbsentClass'); - } - - public function testGetReflectionClass() - { - $class = $this->reflectionService->getClass(__CLASS__); - $this->assertInstanceOf("ReflectionClass", $class); - } - - public function testGetMethods() - { - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods")); - $this->assertFalse($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2")); - } - - public function testGetAccessibleProperty() - { - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService"); - $this->assertInstanceOf("ReflectionProperty", $reflProp); - - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "unusedPublicProperty"); - $this->assertInstanceOf("Doctrine\Common\Reflection\RuntimePublicReflectionProperty", $reflProp); - } -} - diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php deleted file mode 100644 index 9f1c568..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php +++ /dev/null @@ -1,35 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $metadata->expects($this->once())->method('getFieldNames'); - - $driver = new StaticPHPDriver(array(__DIR__)); - $driver->loadMetadataForClass(__NAMESPACE__ . '\\TestEntity', $metadata); - } - - public function testGetAllClassNames() - { - $driver = new StaticPHPDriver(array(__DIR__)); - $classNames = $driver->getAllClassNames(); - - $this->assertContains( - 'Doctrine\Tests\Common\Persistence\Mapping\TestEntity', $classNames); - } -} - -class TestEntity -{ - static public function loadMetadata($metadata) - { - $metadata->getFieldNames(); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php deleted file mode 100644 index 9054b6c..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Persistence\Mapping; - -use Doctrine\Common\Persistence\Mapping\StaticReflectionService; - -/** - * @group DCOM-93 - */ -class StaticReflectionServiceTest extends \PHPUnit_Framework_TestCase -{ - private $reflectionService; - - public function setUp() - { - $this->reflectionService = new StaticReflectionService(); - } - - public function testShortname() - { - $this->assertEquals("StaticReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__)); - } - - public function testClassNamespaceName() - { - $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__)); - } - - public function testGetParentClasses() - { - $classes = $this->reflectionService->getParentClasses(__CLASS__); - $this->assertTrue(count($classes) == 0, "The test class ".__CLASS__." should have no parents according to static reflection."); - } - - public function testGetReflectionClass() - { - $class = $this->reflectionService->getClass(__CLASS__); - $this->assertNull($class); - } - - public function testGetMethods() - { - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods")); - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2")); - } - - public function testGetAccessibleProperty() - { - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService"); - $this->assertNull($reflProp); - } -} - diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php deleted file mode 100644 index e79b8f4..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php +++ /dev/null @@ -1,173 +0,0 @@ - $prefix)); - $this->assertEquals(array($path), $locator->getPaths()); - - $locator = new SymfonyFileLocator(array($path => $prefix)); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testGetPrefixes() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix)); - $this->assertEquals(array($path => $prefix), $locator->getNamespacePrefixes()); - } - - public function testGetFileExtension() - { - $locator = new SymfonyFileLocator(array(), ".yml"); - $this->assertEquals(".yml", $locator->getFileExtension()); - $locator->setFileExtension(".xml"); - $this->assertEquals(".xml", $locator->getFileExtension()); - } - - public function testFileExists() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->assertTrue($locator->fileExists("Foo\stdClass")); - $this->assertTrue($locator->fileExists("Foo\global")); - $this->assertFalse($locator->fileExists("Foo\stdClass2")); - $this->assertFalse($locator->fileExists("Foo\global2")); - } - - public function testGetAllClassNames() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - $classes = $locator->getAllClassNames(null); - sort($classes); - - $this->assertEquals(array("Foo\\global", "Foo\\stdClass"), $classes); - $this->assertEquals(array("Foo\\stdClass"), $locator->getAllClassNames("global")); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Namespace separator should not be empty - */ - public function testInvalidCustomNamespaceSeparator() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - new SymfonyFileLocator(array($path => $prefix), ".yml", null); - } - - public function customNamespaceSeparatorProvider() - { - return array( - 'directory separator' => array(DIRECTORY_SEPARATOR, "/_custom_ns/dir"), - 'default dot separator' => array('.', "/_custom_ns/dot"), - ); - } - - /** - * @dataProvider customNamespaceSeparatorProvider - * - * @param $separator string Directory separator to test against - * @param $dir string Path to load mapping data from - * - * @throws \Doctrine\Common\Persistence\Mapping\MappingException - */ - public function testGetClassNamesWithCustomNsSeparator($separator, $dir) - { - $path = __DIR__ . $dir; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml", $separator); - $classes = $locator->getAllClassNames(null); - sort($classes); - - $this->assertEquals(array("Foo\\stdClass", "Foo\\sub\\subClass", "Foo\\sub\\subsub\\subSubClass"), $classes); - } - - public function customNamespaceLookupQueryProvider() - { - return array( - 'directory separator' => array( - DIRECTORY_SEPARATOR, - "/_custom_ns/dir", - array( - "stdClass.yml" => "Foo\\stdClass", - "sub/subClass.yml" => "Foo\\sub\\subClass", - "sub/subsub/subSubClass.yml" => "Foo\\sub\\subsub\\subSubClass", - ) - ), - 'default dot separator' => array( - '.', - "/_custom_ns/dot", - array( - "stdClass.yml" => "Foo\\stdClass", - "sub.subClass.yml" => "Foo\\sub\\subClass", - "sub.subsub.subSubClass.yml" => "Foo\\sub\\subsub\\subSubClass", - ) - ), - ); - } - - /** @dataProvider customNamespaceLookupQueryProvider - * @param $separator string Directory separator to test against - * @param $dir string Path to load mapping data from - * @param $files array Files to lookup classnames - * - * @throws \Doctrine\Common\Persistence\Mapping\MappingException - */ - public function testFindMappingFileWithCustomNsSeparator($separator, $dir, $files) - { - $path = __DIR__ . $dir; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml", $separator); - - foreach ($files as $filePath => $className) { - $this->assertEquals(realpath($path .'/'. $filePath), realpath($locator->findMappingFile($className))); - } - - } - - - public function testFindMappingFile() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->assertEquals(__DIR__ . "/_files/stdClass.yml", $locator->findMappingFile("Foo\\stdClass")); - } - - public function testFindMappingFileNotFound() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->setExpectedException( - "Doctrine\Common\Persistence\Mapping\MappingException", - "No mapping file found named '".__DIR__."/_files/stdClass2.yml' for class 'Foo\stdClass2'." - ); - $locator->findMappingFile("Foo\\stdClass2"); - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/stdClass.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/stdClass.yml deleted file mode 100644 index 9daeafb..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/stdClass.yml +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/subClass.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/subClass.yml deleted file mode 100644 index 9daeafb..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/subClass.yml +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/subsub/subSubClass.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/subsub/subSubClass.yml deleted file mode 100644 index 9daeafb..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/subsub/subSubClass.yml +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/stdClass.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/stdClass.yml deleted file mode 100644 index 9daeafb..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/stdClass.yml +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/sub.subClass.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/sub.subClass.yml deleted file mode 100644 index 9daeafb..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/sub.subClass.yml +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/sub.subsub.subSubClass.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/sub.subsub.subSubClass.yml deleted file mode 100644 index 9daeafb..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/sub.subsub.subSubClass.yml +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php deleted file mode 100644 index d0e9976..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php +++ /dev/null @@ -1,3 +0,0 @@ -getFieldNames(); \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php deleted file mode 100644 index ff03568..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php +++ /dev/null @@ -1,17 +0,0 @@ -wrapped = $wrapped; - } -} - -class ObjectManagerDecoratorTest extends \PHPUnit_Framework_TestCase -{ - private $wrapped; - private $decorated; - - public function setUp() - { - $this->wrapped = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->decorated = new NullObjectManagerDecorator($this->wrapped); - } - - public function getMethodParameters() - { - $class = new \ReflectionClass('Doctrine\Common\Persistence\ObjectManager'); - - $methods = array(); - foreach ($class->getMethods() as $method) { - if ($method->getNumberOfRequiredParameters() === 0) { - $methods[] = array($method->getName(), array()); - } elseif ($method->getNumberOfRequiredParameters() > 0) { - $methods[] = array($method->getName(), array_fill(0, $method->getNumberOfRequiredParameters(), 'req') ?: array()); - } - if ($method->getNumberOfParameters() != $method->getNumberOfRequiredParameters()) { - $methods[] = array($method->getName(), array_fill(0, $method->getNumberOfParameters(), 'all') ?: array()); - } - } - - return $methods; - } - - /** - * @dataProvider getMethodParameters - */ - public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters) - { - $stub = $this->wrapped - ->expects($this->once()) - ->method($method) - ->will($this->returnValue('INNER VALUE FROM ' . $method)); - - call_user_func_array(array($stub, 'with'), $parameters); - - $this->assertSame('INNER VALUE FROM ' . $method, call_user_func_array(array($this->decorated, $method), $parameters)); - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php deleted file mode 100644 index 180d0f0..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php +++ /dev/null @@ -1,247 +0,0 @@ -cm = new TestObjectMetadata; - $this->om = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->om->expects($this->any())->method('getClassMetadata') - ->will($this->returnValue($this->cm)); - $this->object = new TestObject; - PersistentObject::setObjectManager($this->om); - $this->object->injectObjectManager($this->om, $this->cm); - } - - public function testGetObjectManager() - { - $this->assertSame($this->om, PersistentObject::getObjectManager()); - } - - public function testNonMatchingObjectManager() - { - $this->setExpectedException('RuntimeException'); - $om = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->object->injectObjectManager($om, $this->cm); - } - - public function testGetField() - { - $this->assertEquals('beberlei', $this->object->getName()); - } - - public function testSetField() - { - $this->object->setName("test"); - $this->assertEquals("test", $this->object->getName()); - } - - public function testGetIdentifier() - { - $this->assertEquals(1, $this->object->getId()); - } - - public function testSetIdentifier() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->setId(2); - } - - public function testSetUnknownField() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->setUnknown("test"); - } - - public function testGetUnknownField() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->getUnknown(); - } - - public function testGetToOneAssociation() - { - $this->assertNull($this->object->getParent()); - } - - public function testSetToOneAssociation() - { - $parent = new TestObject(); - $this->object->setParent($parent); - $this->assertSame($parent, $this->object->getParent($parent)); - } - - public function testSetInvalidToOneAssociation() - { - $parent = new \stdClass(); - - $this->setExpectedException('InvalidArgumentException'); - $this->object->setParent($parent); - } - - public function testSetToOneAssociationNull() - { - $parent = new TestObject(); - $this->object->setParent($parent); - $this->object->setParent(null); - $this->assertNull($this->object->getParent()); - } - - public function testAddToManyAssociation() - { - $child = new TestObject(); - $this->object->addChildren($child); - - $this->assertSame($this->object, $child->getParent()); - $this->assertEquals(1, count($this->object->getChildren())); - - $child = new TestObject(); - $this->object->addChildren($child); - - $this->assertEquals(2, count($this->object->getChildren())); - } - - public function testAddInvalidToManyAssociation() - { - $this->setExpectedException('InvalidArgumentException'); - $this->object->addChildren(new \stdClass()); - } - - public function testNoObjectManagerSet() - { - PersistentObject::setObjectManager(null); - $child = new TestObject(); - - $this->setExpectedException('RuntimeException'); - $child->setName("test"); - } - - public function testInvalidMethod() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->asdf(); - } - - public function testAddInvalidCollection() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->addAsdf(new \stdClass()); - } -} - -class TestObject extends PersistentObject -{ - protected $id = 1; - protected $name = 'beberlei'; - protected $parent; - protected $children; -} - -class TestObjectMetadata implements ClassMetadata -{ - - public function getAssociationMappedByTargetField($assocName) - { - $assoc = array('children' => 'parent'); - return $assoc[$assocName]; - } - - public function getAssociationNames() - { - return array('parent', 'children'); - } - - public function getAssociationTargetClass($assocName) - { - return __NAMESPACE__ . '\TestObject'; - } - - public function getFieldNames() - { - return array('id', 'name'); - } - - public function getIdentifier() - { - return array('id'); - } - - public function getName() - { - return __NAMESPACE__ . '\TestObject'; - } - - public function getReflectionClass() - { - return new \ReflectionClass($this->getName()); - } - - public function getTypeOfField($fieldName) - { - $types = array('id' => 'integer', 'name' => 'string'); - return $types[$fieldName]; - } - - public function hasAssociation($fieldName) - { - return in_array($fieldName, array('parent', 'children')); - } - - public function hasField($fieldName) - { - return in_array($fieldName, array('id', 'name')); - } - - public function isAssociationInverseSide($assocName) - { - return ($assocName === 'children'); - } - - public function isCollectionValuedAssociation($fieldName) - { - return ($fieldName === 'children'); - } - - public function isIdentifier($fieldName) - { - return $fieldName === 'id'; - } - - public function isSingleValuedAssociation($fieldName) - { - return $fieldName === 'parent'; - } - - public function getIdentifierValues($entity) - { - - } - - public function getIdentifierFieldNames() - { - - } - - public function initializeReflection(ReflectionService $reflService) - { - - } - - public function wakeupReflection(ReflectionService $reflService) - { - - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php deleted file mode 100644 index 6ae9316..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php +++ /dev/null @@ -1,146 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - - $proxyGenerator - ->expects($this->once()) - ->method('getProxyFileName'); - $proxyGenerator - ->expects($this->once()) - ->method('generateProxyClass'); - - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('skipClass') - ->will($this->returnValue(false)); - - $generated = $proxyFactory->generateProxyClasses(array($metadata), sys_get_temp_dir()); - - $this->assertEquals(1, $generated, 'One proxy was generated'); - } - - public function testGetProxy() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - $definition = new ProxyDefinition(get_class($proxy), array(), array(), null, null); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - - $metadataFactory - ->expects($this->once()) - ->method('getMetadataFor') - ->will($this->returnValue($metadata)); - - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('createProxyDefinition') - ->will($this->returnValue($definition)); - - $generatedProxy = $proxyFactory->getProxy('Class', array('id' => 1)); - - $this->assertInstanceOf(get_class($proxy), $generatedProxy); - } - - public function testResetUnitializedProxy() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - $definition = new ProxyDefinition(get_class($proxy), array(), array(), null, null); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - - $metadataFactory - ->expects($this->once()) - ->method('getMetadataFor') - ->will($this->returnValue($metadata)); - - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('createProxyDefinition') - ->will($this->returnValue($definition)); - - $proxy - ->expects($this->once()) - ->method('__isInitialized') - ->will($this->returnValue(false)); - $proxy - ->expects($this->once()) - ->method('__setInitializer'); - $proxy - ->expects($this->once()) - ->method('__setCloner'); - - $proxyFactory->resetUninitializedProxy($proxy); - } - - public function testDisallowsResettingInitializedProxy() - { - $proxyFactory = $this->getMockForAbstractClass('Doctrine\Common\Proxy\AbstractProxyFactory', array(), '', false); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - - $proxy - ->expects($this->any()) - ->method('__isInitialized') - ->will($this->returnValue(true)); - - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - - $proxyFactory->resetUninitializedProxy($proxy); - } - - public function testMissingPrimaryKeyValue() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - $definition = new ProxyDefinition(get_class($proxy), array('missingKey'), array(), null, null); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - - $metadataFactory - ->expects($this->once()) - ->method('getMetadataFor') - ->will($this->returnValue($metadata)); - - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('createProxyDefinition') - ->will($this->returnValue($definition)); - - $this->setExpectedException('\OutOfBoundsException'); - - $generatedProxy = $proxyFactory->getProxy('Class', array()); - } -} - diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php deleted file mode 100644 index be713fc..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php +++ /dev/null @@ -1,72 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use PHPUnit_Framework_TestCase; -use Doctrine\Common\Proxy\Autoloader; - -/** - * @group DDC-1698 - */ -class AutoloaderTest extends PHPUnit_Framework_TestCase -{ - public static function dataResolveFile() - { - return array( - array('/tmp', 'MyProxy', 'MyProxy\__CG__\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__RealClass.php'), - array('/tmp', 'MyProxy\Subdir', 'MyProxy\Subdir\__CG__\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__RealClass.php'), - array('/tmp', 'MyProxy', 'MyProxy\__CG__\Other\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__OtherRealClass.php'), - ); - } - - /** - * @dataProvider dataResolveFile - */ - public function testResolveFile($proxyDir, $proxyNamespace, $className, $expectedProxyFile) - { - $actualProxyFile = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className); - $this->assertEquals($expectedProxyFile, $actualProxyFile); - } - - public function testAutoload() - { - if (file_exists(sys_get_temp_dir() ."/AutoloaderTestClass.php")) { - unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php"); - } - - $autoloader = Autoloader::register(sys_get_temp_dir(), 'ProxyAutoloaderTest', function($proxyDir, $proxyNamespace, $className) { - file_put_contents(sys_get_temp_dir() . "/AutoloaderTestClass.php", "assertTrue(class_exists('ProxyAutoloaderTest\AutoloaderTestClass', true)); - unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php"); - } - - public function testRegisterWithInvalidCallback() - { - $this->setExpectedException( - 'Doctrine\Common\Proxy\Exception\InvalidArgumentException', - 'Invalid \$notFoundCallback given: must be a callable, "stdClass" given' - ); - - Autoloader::register('', '', new \stdClass()); - } -} - diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php deleted file mode 100644 index f5fccb0..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php +++ /dev/null @@ -1,16 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -/** - * Test asset representing a lazy loadable object - * - * @author Marco Pivetta - * @since 2.4 - */ -class LazyLoadableObject -{ - /** - * @var string - */ - public $publicIdentifierField; - - /** - * @var string - */ - protected $protectedIdentifierField; - - /** - * @var string - */ - public $publicTransientField = 'publicTransientFieldValue'; - - /** - * @var string - */ - protected $protectedTransientField = 'protectedTransientFieldValue'; - - /** - * @var string - */ - public $publicPersistentField = 'publicPersistentFieldValue'; - - /** - * @var string - */ - protected $protectedPersistentField = 'protectedPersistentFieldValue'; - - /** - * @var string - */ - public $publicAssociation = 'publicAssociationValue'; - - /** - * @var string - */ - protected $protectedAssociation = 'protectedAssociationValue'; - - /** - * @return string - */ - public function getProtectedIdentifierField() - { - return $this->protectedIdentifierField; - } - - /** - * @return string - */ - public function testInitializationTriggeringMethod() - { - return 'testInitializationTriggeringMethod'; - } - - /** - * @return string - */ - public function getProtectedAssociation() - { - return $this->protectedAssociation; - } - - /** - * @param \stdClass $param - */ - public function publicTypeHintedMethod(\stdClass $param) - { - } - - /** - * - */ - public function &byRefMethod() - { - } - - /** - * @param mixed $thisIsNotByRef - * @param &mixed $thisIsByRef - */ - public function byRefParamMethod($thisIsNotByRef, &$thisIsByRef) - { - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php deleted file mode 100644 index 167386e..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php +++ /dev/null @@ -1,195 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use ReflectionClass; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Class metadata test asset for @see LazyLoadableObject - * - * @author Marco Pivetta - * @since 2.4 - */ -class LazyLoadableObjectClassMetadata implements ClassMetadata -{ - /** - * @var ReflectionClass - */ - protected $reflectionClass; - - /** - * @var array - */ - protected $identifier = array( - 'publicIdentifierField' => true, - 'protectedIdentifierField' => true, - ); - - /** - * @var array - */ - protected $fields = array( - 'publicIdentifierField' => true, - 'protectedIdentifierField' => true, - 'publicPersistentField' => true, - 'protectedPersistentField' => true, - ); - - /** - * @var array - */ - protected $associations = array( - 'publicAssociation' => true, - 'protectedAssociation' => true, - ); - - /** - * {@inheritDoc} - */ - public function getName() - { - return $this->getReflectionClass()->getName(); - } - - /** - * {@inheritDoc} - */ - public function getIdentifier() - { - return array_keys($this->identifier); - } - - /** - * {@inheritDoc} - */ - public function getReflectionClass() - { - if (null === $this->reflectionClass) { - $this->reflectionClass = new \ReflectionClass(__NAMESPACE__ . '\LazyLoadableObject'); - } - - return $this->reflectionClass; - } - - /** - * {@inheritDoc} - */ - public function isIdentifier($fieldName) - { - return isset($this->identifier[$fieldName]); - } - - /** - * {@inheritDoc} - */ - public function hasField($fieldName) - { - return isset($this->fields[$fieldName]); - } - - /** - * {@inheritDoc} - */ - public function hasAssociation($fieldName) - { - return isset($this->associations[$fieldName]); - } - - /** - * {@inheritDoc} - */ - public function isSingleValuedAssociation($fieldName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isCollectionValuedAssociation($fieldName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getFieldNames() - { - return array_keys($this->fields); - } - - /** - * {@inheritDoc} - */ - public function getIdentifierFieldNames() - { - return $this->getIdentifier(); - } - - /** - * {@inheritDoc} - */ - public function getAssociationNames() - { - return array_keys($this->associations); - } - - /** - * {@inheritDoc} - */ - public function getTypeOfField($fieldName) - { - return 'string'; - } - - /** - * {@inheritDoc} - */ - public function getAssociationTargetClass($assocName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isAssociationInverseSide($assocName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getAssociationMappedByTargetField($assocName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getIdentifierValues($object) - { - throw new \BadMethodCallException('not implemented'); - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php deleted file mode 100644 index 33b983d..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php +++ /dev/null @@ -1,37 +0,0 @@ -clonedValue = 'newClonedValue'; - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php deleted file mode 100644 index 6adf1f5..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php +++ /dev/null @@ -1,51 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use InvalidArgumentException; - -/** - * Test asset class - * - * @since 2.4 - */ -class MagicGetByRefClass -{ - /** - * @var mixed - */ - public $valueField; - - /** - * @param string $name - * - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function & __get($name) - { - if ($name === 'value') { - return $this->valueField; - } - - throw new InvalidArgumentException(); - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php deleted file mode 100644 index 0cab36a..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php +++ /dev/null @@ -1,38 +0,0 @@ -testAttribute = $value; - } - - if ($name === 'publicField' || $name === 'id') { - throw new \BadMethodCallException('Should never be called for "publicField" or "id"'); - } - - $this->testAttribute = $value; - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php deleted file mode 100644 index 3934a05..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php +++ /dev/null @@ -1,37 +0,0 @@ -wakeupValue = 'newWakeupValue'; - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php deleted file mode 100644 index 5de83a1..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php +++ /dev/null @@ -1,249 +0,0 @@ -. - */ - - -namespace Doctrine\Tests\Common\Proxy; - -use Doctrine\Common\Proxy\ProxyGenerator; -use ReflectionClass; -use ReflectionMethod; -use PHPUnit_Framework_TestCase; - -/** - * Test the proxy generator. Its work is generating on-the-fly subclasses of a given model, which implement the Proxy - * pattern. - * - * @author Giorgio Sironi - * @author Marco Pivetta - */ -class ProxyClassGeneratorTest extends PHPUnit_Framework_TestCase -{ - /** - * @var string - */ - protected $proxyClass = 'Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\LazyLoadableObject'; - - /** - * @var LazyLoadableObjectClassMetadata - */ - protected $metadata; - - /** - * @var ProxyGenerator - */ - protected $proxyGenerator; - - /** - * {@inheritDoc} - */ - protected function setUp() - { - $this->metadata = new LazyLoadableObjectClassMetadata(); - $this->proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - if (class_exists($this->proxyClass, false)) { - return; - } - - $this->generateAndRequire($this->proxyGenerator, $this->metadata); - } - - public function testReferenceProxyRespectsMethodsParametersTypeHinting() - { - $method = new ReflectionMethod($this->proxyClass, 'publicTypeHintedMethod'); - $params = $method->getParameters(); - - $this->assertEquals(1, count($params)); - $this->assertEquals('stdClass', $params[0]->getClass()->getName()); - } - - public function testProxyRespectsMethodsWhichReturnValuesByReference() - { - $method = new ReflectionMethod($this->proxyClass, 'byRefMethod'); - - $this->assertTrue($method->returnsReference()); - } - - public function testProxyRespectsByRefMethodParameters() - { - $method = new ReflectionMethod($this->proxyClass, 'byRefParamMethod'); - $parameters = $method->getParameters(); - $this->assertSame('thisIsNotByRef', $parameters[0]->getName()); - $this->assertFalse($parameters[0]->isPassedByReference()); - $this->assertSame('thisIsByRef', $parameters[1]->getName()); - $this->assertTrue($parameters[1]->isPassedByReference()); - } - - public function testCreatesAssociationProxyAsSubclassOfTheOriginalOne() - { - $this->assertTrue(is_subclass_of($this->proxyClass, $this->metadata->getName())); - } - - public function testNonNamespacedProxyGeneration() - { - $classCode = file_get_contents($this->proxyGenerator->getProxyFileName($this->metadata->getName())); - - $this->assertNotContains("class LazyLoadableObject extends \\\\" . $this->metadata->getName(), $classCode); - $this->assertContains("class LazyLoadableObject extends \\" . $this->metadata->getName(), $classCode); - } - - public function testClassWithSleepProxyGeneration() - { - if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\SleepClass', false)) { - $className = 'Doctrine\Tests\Common\Proxy\SleepClass'; - $metadata = $this->createClassMetadata($className, array('id')); - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $this->generateAndRequire($proxyGenerator, $metadata); - } - - $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxySleepClass.php'); - $this->assertEquals(1, substr_count($classCode, 'function __sleep')); - $this->assertEquals(1, substr_count($classCode, 'parent::__sleep()')); - } - - /** - * Check that the proxy doesn't serialize static properties (in __sleep() method) - * @group DCOM-212 - */ - public function testClassWithStaticPropertyProxyGeneration() - { - if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\StaticPropertyClass', false)) { - $className = 'Doctrine\Tests\Common\Proxy\StaticPropertyClass'; - $metadata = $this->createClassMetadata($className, array()); - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $this->generateAndRequire($proxyGenerator, $metadata); - } - - $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyStaticPropertyClass.php'); - $this->assertEquals(1, substr_count($classCode, 'function __sleep')); - $this->assertNotContains('protectedStaticProperty', $classCode); - } - - private function generateAndRequire($proxyGenerator, $metadata) - { - $proxyGenerator->generateProxyClass($metadata, $proxyGenerator->getProxyFileName($metadata->getName())); - - require_once $proxyGenerator->getProxyFileName($metadata->getName()); - } - - public function testClassWithCallableTypeHintOnProxiedMethod() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('`callable` is only supported in PHP >=5.4.0'); - } - - if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\CallableTypeHintClass', false)) { - $className = 'Doctrine\Tests\Common\Proxy\CallableTypeHintClass'; - $metadata = $this->createClassMetadata($className, array('id')); - - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - $this->generateAndRequire($proxyGenerator, $metadata); - } - - $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyCallableTypeHintClass.php'); - - $this->assertEquals(1, substr_count($classCode, 'call(callable $foo)')); - } - - public function testClassWithVariadicArgumentOnProxiedMethod() - { - if (PHP_VERSION_ID < 50600) { - $this->markTestSkipped('`...` is only supported in PHP >=5.6.0'); - } - - if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\VariadicTypeHintClass', false)) { - $className = 'Doctrine\Tests\Common\Proxy\VariadicTypeHintClass'; - $metadata = $this->createClassMetadata($className, array('id')); - - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - $this->generateAndRequire($proxyGenerator, $metadata); - } - - $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyVariadicTypeHintClass.php'); - - $this->assertEquals(1, substr_count($classCode, 'function addType(...$types)')); - $this->assertEquals(1, substr_count($classCode, '__invoke($this, \'addType\', array($types))')); - $this->assertEquals(1, substr_count($classCode, 'parent::addType(...$types)')); - } - - public function testClassWithInvalidTypeHintOnProxiedMethod() - { - $className = 'Doctrine\Tests\Common\Proxy\InvalidTypeHintClass'; - $metadata = $this->createClassMetadata($className, array('id')); - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $this->setExpectedException( - 'Doctrine\Common\Proxy\Exception\UnexpectedValueException', - 'The type hint of parameter "foo" in method "invalidTypeHintMethod"' - .' in class "' . $className . '" is invalid.' - ); - $proxyGenerator->generateProxyClass($metadata); - } - - public function testNoConfigDirThrowsException() - { - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - new ProxyGenerator(null, null); - } - - public function testNoNamespaceThrowsException() - { - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - new ProxyGenerator(__DIR__ . '/generated', null); - } - - public function testInvalidPlaceholderThrowsException() - { - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - $generator = new ProxyGenerator(__DIR__ . '/generated', 'SomeNamespace'); - $generator->setPlaceholder('', array()); - } - - public function testUseEvalIfNoFilenameIsGiven() - { - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $className = __NAMESPACE__ . '\\EvalBase'; - - $metadata = $this->createClassMetadata($className, array('id')); - - $proxyGenerator->generateProxyClass($metadata); - - $reflClass = new ReflectionClass('Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\EvalBase'); - - $this->assertContains("eval()'d code", $reflClass->getFileName()); - } - - private function createClassMetadata($className, array $ids) - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $reflClass = new ReflectionClass($className); - $metadata->expects($this->any())->method('getReflectionClass')->will($this->returnValue($reflClass)); - $metadata->expects($this->any())->method('getIdentifierFieldNames')->will($this->returnValue($ids)); - $metadata->expects($this->any())->method('getName')->will($this->returnValue($className)); - - return $metadata; - } -} - -class EvalBase -{ -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php deleted file mode 100644 index c97ac79..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php +++ /dev/null @@ -1,752 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use Doctrine\Common\Proxy\ProxyGenerator; -use Doctrine\Common\Proxy\Proxy; -use Doctrine\Common\Proxy\Exception\UnexpectedValueException; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use PHPUnit_Framework_TestCase; - -/** - * Test the generated proxies behavior. These tests make assumptions about the structure of LazyLoadableObject - * - * @author Marco Pivetta - */ -class ProxyLogicTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $proxyLoader; - - /** - * @var ClassMetadata - */ - protected $lazyLoadableObjectMetadata; - - /** - * @var LazyLoadableObject|Proxy - */ - protected $lazyObject; - - protected $identifier = array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - ); - - /** - * @var \PHPUnit_Framework_MockObject_MockObject|Callable - */ - protected $initializerCallbackMock; - - /** - * {@inheritDoc} - */ - public function setUp() - { - $this->proxyLoader = $loader = $this->getMock('stdClass', array('load'), array(), '', false); - $this->initializerCallbackMock = $this->getMock('stdClass', array('__invoke')); - $identifier = $this->identifier; - $this->lazyLoadableObjectMetadata = $metadata = new LazyLoadableObjectClassMetadata(); - - // emulating what should happen in a proxy factory - $cloner = function (LazyLoadableObject $proxy) use ($loader, $identifier, $metadata) { - /* @var $proxy LazyLoadableObject|Proxy */ - if ($proxy->__isInitialized()) { - return; - } - - $proxy->__setInitialized(true); - $proxy->__setInitializer(null); - $original = $loader->load($identifier); - - if (null === $original) { - throw new UnexpectedValueException(); - } - - foreach ($metadata->getReflectionClass()->getProperties() as $reflProperty) { - $propertyName = $reflProperty->getName(); - - if ($metadata->hasField($propertyName) || $metadata->hasAssociation($propertyName)) { - $reflProperty->setAccessible(true); - $reflProperty->setValue($proxy, $reflProperty->getValue($original)); - } - } - }; - - $proxyClassName = 'Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\LazyLoadableObject'; - - // creating the proxy class - if (!class_exists($proxyClassName, false)) { - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - $proxyGenerator->generateProxyClass($metadata); - require_once $proxyGenerator->getProxyFileName($metadata->getName()); - } - - $this->lazyObject = new $proxyClassName($this->getClosure($this->initializerCallbackMock), $cloner); - - // setting identifiers in the proxy via reflection - foreach ($metadata->getIdentifierFieldNames() as $idField) { - $prop = $metadata->getReflectionClass()->getProperty($idField); - $prop->setAccessible(true); - $prop->setValue($this->lazyObject, $identifier[$idField]); - } - - $this->assertFalse($this->lazyObject->__isInitialized()); - } - - public function testFetchingPublicIdentifierDoesNotCauseLazyLoading() - { - $this->configureInitializerMock(0); - - $this->assertSame('publicIdentifierFieldValue', $this->lazyObject->publicIdentifierField); - } - - public function testFetchingIdentifiersViaPublicGetterDoesNotCauseLazyLoading() - { - $this->configureInitializerMock(0); - - $this->assertSame('protectedIdentifierFieldValue', $this->lazyObject->getProtectedIdentifierField()); - } - - public function testCallingMethodCausesLazyLoading() - { - $this->configureInitializerMock( - 1, - array($this->lazyObject, 'testInitializationTriggeringMethod', array()), - function (Proxy $proxy) { - $proxy->__setInitializer(null); - } - ); - - $this->lazyObject->testInitializationTriggeringMethod(); - $this->lazyObject->testInitializationTriggeringMethod(); - } - - public function testFetchingPublicFieldsCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__get', array('publicPersistentField')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'loadedValue'); - } - ); - - $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField); - $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField); - } - - public function testFetchingPublicAssociationCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__get', array('publicAssociation')), - function () use ($test) { - $test->setProxyValue('publicAssociation', 'loadedAssociation'); - } - ); - - $this->assertSame('loadedAssociation', $this->lazyObject->publicAssociation); - $this->assertSame('loadedAssociation', $this->lazyObject->publicAssociation); - } - - public function testFetchingProtectedAssociationViaPublicGetterCausesLazyLoading() - { - $this->configureInitializerMock( - 1, - array($this->lazyObject, 'getProtectedAssociation', array()), - function (Proxy $proxy) { - $proxy->__setInitializer(null); - } - ); - - $this->assertSame('protectedAssociationValue', $this->lazyObject->getProtectedAssociation()); - $this->assertSame('protectedAssociationValue', $this->lazyObject->getProtectedAssociation()); - } - - public function testLazyLoadingTriggeredOnlyAtFirstPublicPropertyRead() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__get', array('publicPersistentField')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'loadedValue'); - $test->setProxyValue('publicAssociation', 'publicAssociationValue'); - } - ); - - $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField); - $this->assertSame('publicAssociationValue', $this->lazyObject->publicAssociation); - } - - public function testNoticeWhenReadingNonExistentPublicProperties() - { - $this->configureInitializerMock(0); - - $class = get_class($this->lazyObject); - $this->setExpectedException( - 'PHPUnit_Framework_Error_Notice', - 'Undefined property: ' . $class . '::$non_existing_property' - ); - - $this->lazyObject->non_existing_property; - } - - public function testFalseWhenCheckingNonExistentProperty() - { - $this->configureInitializerMock(0); - - $this->assertFalse(isset($this->lazyObject->non_existing_property)); - } - - public function testNoErrorWhenSettingNonExistentProperty() - { - $this->configureInitializerMock(0); - - $this->lazyObject->non_existing_property = 'now has a value'; - $this->assertSame('now has a value', $this->lazyObject->non_existing_property); - } - - public function testCloningCallsClonerWithClonedObject() - { - $lazyObject = $this->lazyObject; - $test = $this; - $cb = $this->getMock('stdClass', array('cb')); - $cb - ->expects($this->once()) - ->method('cb') - ->will($this->returnCallback(function (LazyLoadableObject $proxy) use ($lazyObject, $test) { - /* @var $proxy LazyLoadableObject|Proxy */ - $test->assertNotSame($proxy, $lazyObject); - $proxy->__setInitializer(null); - $proxy->publicAssociation = 'clonedAssociation'; - })); - - $this->lazyObject->__setCloner($this->getClosure(array($cb, 'cb'))); - - $cloned = clone $this->lazyObject; - $this->assertSame('clonedAssociation', $cloned->publicAssociation); - $this->assertNotSame($cloned, $lazyObject, 'a clone of the lazy object is retrieved'); - } - - public function testFetchingTransientPropertiesWillNotTriggerLazyLoading() - { - $this->configureInitializerMock(0); - - $this->assertSame( - 'publicTransientFieldValue', - $this->lazyObject->publicTransientField, - 'fetching public transient field won\'t trigger lazy loading' - ); - $property = $this - ->lazyLoadableObjectMetadata - ->getReflectionClass() - ->getProperty('protectedTransientField'); - $property->setAccessible(true); - $this->assertSame( - 'protectedTransientFieldValue', - $property->getValue($this->lazyObject), - 'fetching protected transient field via reflection won\'t trigger lazy loading' - ); - } - - /** - * Provided to guarantee backwards compatibility - */ - public function testLoadProxyMethod() - { - $this->configureInitializerMock(2, array($this->lazyObject, '__load', array())); - - $this->lazyObject->__load(); - $this->lazyObject->__load(); - } - - public function testLoadingWithPersisterWillBeTriggeredOnlyOnce() - { - $this - ->proxyLoader - ->expects($this->once()) - ->method('load') - ->with( - array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - ), - $this->lazyObject - ) - ->will($this->returnCallback(function ($id, LazyLoadableObject $lazyObject) { - // setting a value to verify that the persister can actually set something in the object - $lazyObject->publicAssociation = $id['publicIdentifierField'] . '-test'; - return true; - })); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - - $this->lazyObject->__load(); - $this->lazyObject->__load(); - $this->assertSame('publicIdentifierFieldValue-test', $this->lazyObject->publicAssociation); - } - - public function testFailedLoadingWillThrowException() - { - $this->proxyLoader->expects($this->any())->method('load')->will($this->returnValue(null)); - $this->setExpectedException('UnexpectedValueException'); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - - $this->lazyObject->__load(); - } - - public function testCloningWithPersister() - { - $this->lazyObject->publicTransientField = 'should-not-change'; - $this - ->proxyLoader - ->expects($this->exactly(2)) - ->method('load') - ->with(array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - )) - ->will($this->returnCallback(function () { - $blueprint = new LazyLoadableObject(); - $blueprint->publicPersistentField = 'checked-persistent-field'; - $blueprint->publicAssociation = 'checked-association-field'; - $blueprint->publicTransientField = 'checked-transient-field'; - - return $blueprint; - })); - - $firstClone = clone $this->lazyObject; - $this->assertSame( - 'checked-persistent-field', - $firstClone->publicPersistentField, - 'Persistent fields are cloned correctly' - ); - $this->assertSame( - 'checked-association-field', - $firstClone->publicAssociation, - 'Associations are cloned correctly' - ); - $this->assertSame( - 'should-not-change', - $firstClone->publicTransientField, - 'Transient fields are not overwritten' - ); - - $secondClone = clone $this->lazyObject; - $this->assertSame( - 'checked-persistent-field', - $secondClone->publicPersistentField, - 'Persistent fields are cloned correctly' - ); - $this->assertSame( - 'checked-association-field', - $secondClone->publicAssociation, - 'Associations are cloned correctly' - ); - $this->assertSame( - 'should-not-change', - $secondClone->publicTransientField, - 'Transient fields are not overwritten' - ); - - // those should not trigger lazy loading - $firstClone->__load(); - $secondClone->__load(); - } - - public function testNotInitializedProxyUnserialization() - { - $this->configureInitializerMock(); - - $serialized = serialize($this->lazyObject); - /* @var $unserialized LazyLoadableObject|Proxy */ - $unserialized = unserialize($serialized); - $reflClass = $this->lazyLoadableObjectMetadata->getReflectionClass(); - - $this->assertFalse($unserialized->__isInitialized(), 'serialization didn\'t cause intialization'); - - // Checking identifiers - $this->assertSame('publicIdentifierFieldValue', $unserialized->publicIdentifierField, 'identifiers are kept'); - $protectedIdentifierField = $reflClass->getProperty('protectedIdentifierField'); - $protectedIdentifierField->setAccessible(true); - $this->assertSame( - 'protectedIdentifierFieldValue', - $protectedIdentifierField->getValue($unserialized), - 'identifiers are kept' - ); - - // Checking transient fields - $this->assertSame( - 'publicTransientFieldValue', - $unserialized->publicTransientField, - 'transient fields are kept' - ); - $protectedTransientField = $reflClass->getProperty('protectedTransientField'); - $protectedTransientField->setAccessible(true); - $this->assertSame( - 'protectedTransientFieldValue', - $protectedTransientField->getValue($unserialized), - 'transient fields are kept' - ); - - // Checking persistent fields - $this->assertSame( - 'publicPersistentFieldValue', - $unserialized->publicPersistentField, - 'persistent fields are kept' - ); - $protectedPersistentField = $reflClass->getProperty('protectedPersistentField'); - $protectedPersistentField->setAccessible(true); - $this->assertSame( - 'protectedPersistentFieldValue', - $protectedPersistentField->getValue($unserialized), - 'persistent fields are kept' - ); - - // Checking associations - $this->assertSame('publicAssociationValue', $unserialized->publicAssociation, 'associations are kept'); - $protectedAssociationField = $reflClass->getProperty('protectedAssociation'); - $protectedAssociationField->setAccessible(true); - $this->assertSame( - 'protectedAssociationValue', - $protectedAssociationField->getValue($unserialized), - 'associations are kept' - ); - } - - public function testInitializedProxyUnserialization() - { - // persister will retrieve the lazy object itself, so that we don't have to re-define all field values - $this->proxyLoader->expects($this->once())->method('load')->will($this->returnValue($this->lazyObject)); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - $this->lazyObject->__load(); - - $serialized = serialize($this->lazyObject); - $reflClass = $this->lazyLoadableObjectMetadata->getReflectionClass(); - /* @var $unserialized LazyLoadableObject|Proxy */ - $unserialized = unserialize($serialized); - - $this->assertTrue($unserialized->__isInitialized(), 'serialization didn\'t cause intialization'); - - // Checking transient fields - $this->assertSame( - 'publicTransientFieldValue', - $unserialized->publicTransientField, - 'transient fields are kept' - ); - $protectedTransientField = $reflClass->getProperty('protectedTransientField'); - $protectedTransientField->setAccessible(true); - $this->assertSame( - 'protectedTransientFieldValue', - $protectedTransientField->getValue($unserialized), - 'transient fields are kept' - ); - - // Checking persistent fields - $this->assertSame( - 'publicPersistentFieldValue', - $unserialized->publicPersistentField, - 'persistent fields are kept' - ); - $protectedPersistentField = $reflClass->getProperty('protectedPersistentField'); - $protectedPersistentField->setAccessible(true); - $this->assertSame( - 'protectedPersistentFieldValue', - $protectedPersistentField->getValue($unserialized), - 'persistent fields are kept' - ); - - // Checking identifiers - $this->assertSame( - 'publicIdentifierFieldValue', - $unserialized->publicIdentifierField, - 'identifiers are kept' - ); - $protectedIdentifierField = $reflClass->getProperty('protectedIdentifierField'); - $protectedIdentifierField->setAccessible(true); - $this->assertSame( - 'protectedIdentifierFieldValue', - $protectedIdentifierField->getValue($unserialized), - 'identifiers are kept' - ); - - // Checking associations - $this->assertSame('publicAssociationValue', $unserialized->publicAssociation, 'associations are kept'); - $protectedAssociationField = $reflClass->getProperty('protectedAssociation'); - $protectedAssociationField->setAccessible(true); - $this->assertSame( - 'protectedAssociationValue', - $protectedAssociationField->getValue($unserialized), - 'associations are kept' - ); - } - - public function testInitializationRestoresDefaultPublicLazyLoadedFieldValues() - { - // setting noop persister - $this->proxyLoader->expects($this->once())->method('load')->will($this->returnValue($this->lazyObject)); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - - $this->assertSame( - 'publicPersistentFieldValue', - $this->lazyObject->publicPersistentField, - 'Persistent field is restored to default value' - ); - $this->assertSame( - 'publicAssociationValue', - $this->lazyObject->publicAssociation, - 'Association is restored to default value' - ); - } - - public function testSettingPublicFieldsCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__set', array('publicPersistentField', 'newPublicPersistentFieldValue')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'overrideValue'); - $test->setProxyValue('publicAssociation', 'newAssociationValue'); - } - ); - - $this->lazyObject->publicPersistentField = 'newPublicPersistentFieldValue'; - $this->assertSame('newPublicPersistentFieldValue', $this->lazyObject->publicPersistentField); - $this->assertSame('newAssociationValue', $this->lazyObject->publicAssociation); - } - - public function testSettingPublicAssociationCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__set', array('publicAssociation', 'newPublicAssociationValue')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'newPublicPersistentFieldValue'); - $test->setProxyValue('publicAssociation', 'overrideValue'); - } - ); - - $this->lazyObject->publicAssociation = 'newPublicAssociationValue'; - $this->assertSame('newPublicAssociationValue', $this->lazyObject->publicAssociation); - $this->assertSame('newPublicPersistentFieldValue', $this->lazyObject->publicPersistentField); - } - - public function testCheckingPublicFieldsCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__isset', array('publicPersistentField')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', null); - $test->setProxyValue('publicAssociation', 'setPublicAssociation'); - } - ); - - $this->assertFalse(isset($this->lazyObject->publicPersistentField)); - $this->assertNull($this->lazyObject->publicPersistentField); - $this->assertTrue(isset($this->lazyObject->publicAssociation)); - $this->assertSame('setPublicAssociation', $this->lazyObject->publicAssociation); - } - - public function testCheckingPublicAssociationCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__isset', array('publicAssociation')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'newPersistentFieldValue'); - $test->setProxyValue('publicAssociation', 'setPublicAssociation'); - } - ); - - $this->assertTrue(isset($this->lazyObject->publicAssociation)); - $this->assertSame('setPublicAssociation', $this->lazyObject->publicAssociation); - $this->assertTrue(isset($this->lazyObject->publicPersistentField)); - $this->assertSame('newPersistentFieldValue', $this->lazyObject->publicPersistentField); - } - - public function testCallingVariadicMethodCausesLazyLoading() - { - if (PHP_VERSION_ID < 50600) { - $this->markTestSkipped('Test applies only to PHP 5.6+'); - } - - $proxyClassName = 'Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\VariadicTypeHintClass'; - - /* @var $metadata \Doctrine\Common\Persistence\Mapping\ClassMetadata|\PHPUnit_Framework_MockObject_MockObject */ - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $metadata - ->expects($this->any()) - ->method('getName') - ->will($this->returnValue('Doctrine\Tests\Common\Proxy\VariadicTypeHintClass')); - $metadata - ->expects($this->any()) - ->method('getReflectionClass') - ->will($this->returnValue(new \ReflectionClass('Doctrine\Tests\Common\Proxy\VariadicTypeHintClass'))); - - // creating the proxy class - if (!class_exists($proxyClassName, false)) { - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - $proxyGenerator->generateProxyClass($metadata); - require_once $proxyGenerator->getProxyFileName($metadata->getName()); - } - - /* @var $invocationMock callable|\PHPUnit_Framework_MockObject_MockObject */ - $invocationMock = $this->getMock('stdClass', array('__invoke')); - - /* @var $lazyObject \Doctrine\Tests\Common\Proxy\VariadicTypeHintClass */ - $lazyObject = new $proxyClassName( - function ($proxy, $method, $parameters) use ($invocationMock) { - $invocationMock($proxy, $method, $parameters); - }, - function () {} - ); - - $invocationMock - ->expects($this->at(0)) - ->method('__invoke') - ->with($lazyObject, 'addType', array(array('type1', 'type2'))); - $invocationMock - ->expects($this->at(1)) - ->method('__invoke') - ->with($lazyObject, 'addTypeWithMultipleParameters', array('foo', 'bar', array('baz1', 'baz2'))); - - $lazyObject->addType('type1', 'type2'); - $this->assertSame(array('type1', 'type2'), $lazyObject->types); - - $lazyObject->addTypeWithMultipleParameters('foo', 'bar', 'baz1', 'baz2'); - $this->assertSame('foo', $lazyObject->foo); - $this->assertSame('bar', $lazyObject->bar); - $this->assertSame(array('baz1', 'baz2'), $lazyObject->baz); - } - - /** - * Converts a given callable into a closure - * - * @param callable $callable - * @return \Closure - */ - public function getClosure($callable) { - return function () use ($callable) { - call_user_func_array($callable, func_get_args()); - }; - } - - /** - * Configures the current initializer callback mock with provided matcher params - * - * @param int $expectedCallCount the number of invocations to be expected. If a value< 0 is provided, `any` is used - * @param array $callParamsMatch an ordered array of parameters to be expected - * @param callable $callbackClosure a return callback closure - * - * @return \PHPUnit_Framework_MockObject_MockObject| - */ - protected function configureInitializerMock( - $expectedCallCount = 0, - array $callParamsMatch = null, - \Closure $callbackClosure = null - ) { - if (!$expectedCallCount) { - $invocationCountMatcher = $this->exactly((int) $expectedCallCount); - } else { - $invocationCountMatcher = $expectedCallCount < 0 ? $this->any() : $this->exactly($expectedCallCount); - } - - $invocationMocker = $this->initializerCallbackMock->expects($invocationCountMatcher)->method('__invoke'); - - if (null !== $callParamsMatch) { - call_user_func_array(array($invocationMocker, 'with'), $callParamsMatch); - } - - if ($callbackClosure) { - $invocationMocker->will($this->returnCallback($callbackClosure)); - } - } - - /** - * Sets a value in the current proxy object without triggering lazy loading through `__set` - * - * @link https://bugs.php.net/bug.php?id=63463 - * - * @param string $property - * @param mixed $value - */ - public function setProxyValue($property, $value) - { - $reflectionProperty = new \ReflectionProperty($this->lazyObject, $property); - $initializer = $this->lazyObject->__getInitializer(); - - // disabling initializer since setting `publicPersistentField` triggers `__set`/`__get` - $this->lazyObject->__setInitializer(null); - $reflectionProperty->setValue($this->lazyObject, $value); - $this->lazyObject->__setInitializer($initializer); - } - - /** - * Retrieves the suggested implementation of an initializer that proxy factories in O*M - * are currently following, and that should be used to initialize the current proxy object - * - * @return \Closure - */ - protected function getSuggestedInitializerImplementation() - { - $loader = $this->proxyLoader; - $identifier = $this->identifier; - - return function (LazyLoadableObject $proxy) use ($loader, $identifier) { - /* @var $proxy LazyLoadableObject|Proxy */ - $proxy->__setInitializer(null); - $proxy->__setCloner(null); - - - if ($proxy->__isInitialized()) { - return; - } - - $properties = $proxy->__getLazyProperties(); - - foreach ($properties as $propertyName => $property) { - if (!isset($proxy->$propertyName)) { - $proxy->$propertyName = $properties[$propertyName]; - } - } - - $proxy->__setInitialized(true); - - if (method_exists($proxy, '__wakeup')) { - $proxy->__wakeup(); - } - - if (null === $loader->load($identifier, $proxy)) { - throw new \UnexpectedValueException('Couldn\'t load'); - } - }; - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php deleted file mode 100644 index 1ed9d92..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php +++ /dev/null @@ -1,327 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use Doctrine\Common\Proxy\ProxyGenerator; -use Doctrine\Common\Proxy\Proxy; -use Doctrine\Common\Proxy\Exception\UnexpectedValueException; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Test for behavior of proxies with inherited magic methods - * - * @author Marco Pivetta - */ -class ProxyMagicMethodsTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \Doctrine\Common\Proxy\ProxyGenerator - */ - protected $proxyGenerator; - - /** - * @var LazyLoadableObject|Proxy - */ - protected $lazyObject; - - protected $identifier = array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - ); - - /** - * @var \PHPUnit_Framework_MockObject_MockObject|Callable - */ - protected $initializerCallbackMock; - - /** - * {@inheritDoc} - */ - public function setUp() - { - $this->proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . '\\MagicMethodProxy'); - } - - public static function tearDownAfterClass() - { - - } - - public function testInheritedMagicGet() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicGetClass'); - $proxy = new $proxyClassName( - function (Proxy $proxy, $method, $params) use (&$counter) { - if ( ! in_array($params[0], array('publicField', 'test', 'notDefined'))) { - throw new \InvalidArgumentException('Unexpected access to field "' . $params[0] . '"'); - } - - $initializer = $proxy->__getInitializer(); - - $proxy->__setInitializer(null); - - $proxy->publicField = 'modifiedPublicField'; - $counter += 1; - - $proxy->__setInitializer($initializer); - - } - ); - - $this->assertSame('id', $proxy->id); - $this->assertSame('modifiedPublicField', $proxy->publicField); - $this->assertSame('test', $proxy->test); - $this->assertSame('not defined', $proxy->notDefined); - - $this->assertSame(3, $counter); - } - - /** - * @group DCOM-194 - */ - public function testInheritedMagicGetByRef() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicGetByRefClass'); - /* @var $proxy \Doctrine\Tests\Common\Proxy\MagicGetByRefClass */ - $proxy = new $proxyClassName(); - $proxy->valueField = 123; - $value = & $proxy->__get('value'); - - $this->assertSame(123, $value); - - $value = 456; - - $this->assertSame(456, $proxy->__get('value'), 'Value was fetched by reference'); - - $this->setExpectedException('InvalidArgumentException'); - - $undefined = $proxy->nonExisting; - } - - public function testInheritedMagicSet() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicSetClass'); - $proxy = new $proxyClassName( - function (Proxy $proxy, $method, $params) use (&$counter) { - if ( ! in_array($params[0], array('publicField', 'test', 'notDefined'))) { - throw new \InvalidArgumentException('Unexpected access to field "' . $params[0] . '"'); - } - - $counter += 1; - } - ); - - $this->assertSame('id', $proxy->id); - - $proxy->publicField = 'publicFieldValue'; - - $this->assertSame('publicFieldValue', $proxy->publicField); - - $proxy->test = 'testValue'; - - $this->assertSame('testValue', $proxy->testAttribute); - - $proxy->notDefined = 'not defined'; - - $this->assertSame('not defined', $proxy->testAttribute); - $this->assertSame(3, $counter); - } - - public function testInheritedMagicSleep() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicSleepClass'); - $proxy = new $proxyClassName(); - - $this->assertSame('defaultValue', $proxy->serializedField); - $this->assertSame('defaultValue', $proxy->nonSerializedField); - - $proxy->serializedField = 'changedValue'; - $proxy->nonSerializedField = 'changedValue'; - - $unserialized = unserialize(serialize($proxy)); - - $this->assertSame('changedValue', $unserialized->serializedField); - $this->assertSame('defaultValue', $unserialized->nonSerializedField, 'Field was not returned by "__sleep"'); - } - - public function testInheritedMagicWakeup() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicWakeupClass'); - $proxy = new $proxyClassName(); - - $this->assertSame('defaultValue', $proxy->wakeupValue); - - $proxy->wakeupValue = 'changedValue'; - $unserialized = unserialize(serialize($proxy)); - - $this->assertSame('newWakeupValue', $unserialized->wakeupValue, '"__wakeup" was called'); - - $unserialized->__setInitializer(function (Proxy $proxy) { - $proxy->__setInitializer(null); - - $proxy->publicField = 'newPublicFieldValue'; - }); - - $this->assertSame('newPublicFieldValue', $unserialized->publicField, 'Proxy can still be initialized'); - } - - public function testInheritedMagicIsset() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicIssetClass'); - $proxy = new $proxyClassName(function (Proxy $proxy, $method, $params) use (&$counter) { - if (in_array($params[0], array('publicField', 'test', 'nonExisting'))) { - $initializer = $proxy->__getInitializer(); - - $proxy->__setInitializer(null); - - $proxy->publicField = 'modifiedPublicField'; - $counter += 1; - - $proxy->__setInitializer($initializer); - - return; - } - - throw new \InvalidArgumentException( - sprintf('Should not be initialized when checking isset("%s")', $params[0]) - ); - }); - - $this->assertTrue(isset($proxy->id)); - $this->assertTrue(isset($proxy->publicField)); - $this->assertTrue(isset($proxy->test)); - $this->assertFalse(isset($proxy->nonExisting)); - - $this->assertSame(3, $counter); - } - - public function testInheritedMagicClone() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicCloneClass'); - $proxy = new $proxyClassName( - null, - function ($proxy) { - $proxy->cloned = true; - } - ); - - $cloned = clone $proxy; - - $this->assertSame('newClonedValue', $cloned->clonedValue); - $this->assertFalse($proxy->cloned); - $this->assertTrue($cloned->cloned); - } - - /** - * @group DCOM-175 - */ - public function testClonesPrivateProperties() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\SerializedClass'); - /* @var $proxy SerializedClass */ - $proxy = new $proxyClassName(); - - $proxy->setFoo(1); - $proxy->setBar(2); - $proxy->setBaz(3); - - $unserialized = unserialize(serialize($proxy)); - - $this->assertSame(1, $unserialized->getFoo()); - $this->assertSame(2, $unserialized->getBar()); - $this->assertSame(3, $unserialized->getBaz()); - } - - /** - * @param $className - * - * @return string - */ - private function generateProxyClass($className) - { - $proxyClassName = 'Doctrine\\Tests\\Common\\Proxy\\MagicMethodProxy\\__CG__\\' . $className; - - if (class_exists($proxyClassName, false)) { - return $proxyClassName; - } - - $metadata = $this->getMock('Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata'); - - $metadata - ->expects($this->any()) - ->method('getName') - ->will($this->returnValue($className)); - - $metadata - ->expects($this->any()) - ->method('getIdentifier') - ->will($this->returnValue(array('id'))); - - $metadata - ->expects($this->any()) - ->method('getReflectionClass') - ->will($this->returnValue(new ReflectionClass($className))); - - $metadata - ->expects($this->any()) - ->method('isIdentifier') - ->will($this->returnCallback(function ($fieldName) { - return 'id' === $fieldName; - })); - - $metadata - ->expects($this->any()) - ->method('hasField') - ->will($this->returnCallback(function ($fieldName) { - return in_array($fieldName, array('id', 'publicField')); - })); - - $metadata - ->expects($this->any()) - ->method('hasAssociation') - ->will($this->returnValue(false)); - - $metadata - ->expects($this->any()) - ->method('getFieldNames') - ->will($this->returnValue(array('id', 'publicField'))); - - $metadata - ->expects($this->any()) - ->method('getIdentifierFieldNames') - ->will($this->returnValue(array('id'))); - - $metadata - ->expects($this->any()) - ->method('getAssociationNames') - ->will($this->returnValue(array())); - - $metadata - ->expects($this->any()) - ->method('getTypeOfField') - ->will($this->returnValue('string')); - - $this->proxyGenerator->generateProxyClass($metadata, $this->proxyGenerator->getProxyFileName($className)); - require_once $this->proxyGenerator->getProxyFileName($className); - - return $proxyClassName; - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php deleted file mode 100644 index a36c3bb..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php +++ /dev/null @@ -1,72 +0,0 @@ -foo = $foo; - } - - /** - * @return mixed|string - */ - public function getFoo() - { - return $this->foo; - } - - /** - * @param $bar - */ - public function setBar($bar) - { - $this->bar = $bar; - } - - /** - * @return mixed|string - */ - public function getBar() - { - return $this->bar; - } - - /** - * @param $baz - */ - public function setBaz($baz) - { - $this->baz = $baz; - } - - /** - * @return mixed|string - */ - public function getBaz() - { - return $this->baz; - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php deleted file mode 100644 index 3c6ffcd..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php +++ /dev/null @@ -1,19 +0,0 @@ -types = $types; - } - - public function addTypeWithMultipleParameters($foo, $bar, ...$baz) - { - $this->foo = $foo; - $this->bar = $bar; - $this->baz = $baz; - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/DeeperNamespaceParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/DeeperNamespaceParent.php deleted file mode 100644 index 11b3fc8..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/DeeperNamespaceParent.php +++ /dev/null @@ -1,7 +0,0 @@ -getMock('stdClass', array('callGet')); - $getCheckMock->expects($this->never())->method('callGet'); - $initializer = function () use ($getCheckMock) { - call_user_func($getCheckMock); - }; - - $mockProxy = new RuntimePublicReflectionPropertyTestProxyMock(); - $mockProxy->__setInitializer($initializer); - - $reflProperty = new RuntimePublicReflectionProperty( - __NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock', - 'checkedProperty' - ); - - $this->assertSame('testValue', $reflProperty->getValue($mockProxy)); - unset($mockProxy->checkedProperty); - $this->assertNull($reflProperty->getValue($mockProxy)); - } - - public function testSetValueOnProxyPublicProperty() - { - $setCheckMock = $this->getMock('stdClass', array('neverCallSet')); - $setCheckMock->expects($this->never())->method('neverCallSet'); - $initializer = function () use ($setCheckMock) { - call_user_func(array($setCheckMock, 'neverCallSet')); - }; - - $mockProxy = new RuntimePublicReflectionPropertyTestProxyMock(); - $mockProxy->__setInitializer($initializer); - - $reflProperty = new RuntimePublicReflectionProperty( - __NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock', - 'checkedProperty' - ); - - $reflProperty->setValue($mockProxy, 'newValue'); - $this->assertSame('newValue', $mockProxy->checkedProperty); - - unset($mockProxy->checkedProperty); - $reflProperty->setValue($mockProxy, 'otherNewValue'); - $this->assertSame('otherNewValue', $mockProxy->checkedProperty); - - $setCheckMock = $this->getMock('stdClass', array('callSet')); - $setCheckMock->expects($this->once())->method('callSet'); - $initializer = function () use ($setCheckMock) { - call_user_func(array($setCheckMock, 'callSet')); - }; - - $mockProxy->__setInitializer($initializer); - $mockProxy->__setInitialized(true); - - unset($mockProxy->checkedProperty); - $reflProperty->setValue($mockProxy, 'againNewValue'); - $this->assertSame('againNewValue', $mockProxy->checkedProperty); - } -} - -/** - * Mock that simulates proxy public property lazy loading - */ -class RuntimePublicReflectionPropertyTestProxyMock implements Proxy -{ - /** - * @var \Closure|null - */ - private $initializer = null; - - /** - * @var \Closure|null - */ - private $initialized = false; - - /** - * @var string - */ - public $checkedProperty = 'testValue'; - - /** - * {@inheritDoc} - */ - public function __getInitializer() - { - return $this->initializer; - } - - /** - * {@inheritDoc} - */ - public function __setInitializer(\Closure $initializer = null) - { - $this->initializer = $initializer; - } - - /** - * {@inheritDoc} - */ - public function __getLazyProperties() - { - } - - /** - * {@inheritDoc} - */ - public function __load() - { - } - - /** - * {@inheritDoc} - */ - public function __isInitialized() - { - return $this->initialized; - } - - /** - * {@inheritDoc} - */ - public function __setInitialized($initialized) - { - $this->initialized = (bool) $initialized; - } - - /** - * @param string $name - */ - public function __get($name) - { - if ($this->initializer) { - $cb = $this->initializer; - $cb(); - } - - return $this->checkedProperty; - } - - /** - * @param string $name - * @param mixed $value - */ - public function __set($name, $value) - { - if ($this->initializer) { - $cb = $this->initializer; - $cb(); - } - - // triggers notices if `$name` is used: see https://bugs.php.net/bug.php?id=63463 - $this->checkedProperty = $value; - } - - /** - * @param string $name - * - * @return integer - */ - public function __isset($name) - { - if ($this->initializer) { - $cb = $this->initializer; - $cb(); - } - - return isset($this->checkedProperty); - } - - /** - * {@inheritDoc} - */ - public function __setCloner(\Closure $cloner = null) - { - } - - /** - * {@inheritDoc} - */ - public function __getCloner() - { - } -} \ No newline at end of file diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php deleted file mode 100644 index 844d4a5..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php +++ /dev/null @@ -1,7 +0,0 @@ -setExpectedException('ReflectionException'); - } - - $testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1); - $paths = array( - 'Doctrine\\Tests' => array($testsRoot), - ); - $staticReflectionParser = new StaticReflectionParser($parsedClassName, new Psr0FindFile($paths), $classAnnotationOptimize); - $declaringClassName = $staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', 'test')->getClassName(); - $this->assertEquals($expectedClassName, $declaringClassName); - - } - - /** - * @return array - */ - public function parentClassData() - { - $data = array(); - $noParentClassName = 'Doctrine\\Tests\\Common\\Reflection\\NoParent'; - $dummyParentClassName = 'Doctrine\\Tests\\Common\\Reflection\\Dummies\\NoParent'; - foreach (array(false, true) as $classAnnotationOptimize) { - $data[] = array( - $classAnnotationOptimize, $noParentClassName, $noParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\FullyClassifiedParent', $noParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\SameNamespaceParent', $noParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\DeeperNamespaceParent', $dummyParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\UseParent', $dummyParentClassName, - ); - } - return $data; - } - - /** - * @dataProvider classAnnotationOptimize - */ - public function testClassAnnotationOptimizedParsing($classAnnotationOptimize) { - $testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1); - $paths = array( - 'Doctrine\\Tests' => array($testsRoot), - ); - $staticReflectionParser = new StaticReflectionParser('Doctrine\\Tests\\Common\\Reflection\\ExampleAnnotationClass', new Psr0FindFile($paths), $classAnnotationOptimize); - $expectedDocComment = '/** - * @Annotation( - * key = "value" - * ) - */'; - $this->assertEquals($expectedDocComment, $staticReflectionParser->getDocComment('class')); - } - - /** - * @return array - */ - public function classAnnotationOptimize() - { - return array( - array(false), - array(true) - ); - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php deleted file mode 100644 index dd512d4..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php +++ /dev/null @@ -1,9 +0,0 @@ -assertEquals($expectedClassName, ClassUtils::getRealClass($className)); - } - - /** - * @dataProvider dataGetClass - */ - public function testGetClass( $className, $expectedClassName ) - { - $object = new $className(); - $this->assertEquals($expectedClassName, ClassUtils::getClass($object)); - } - - public function testGetParentClass() - { - $parentClass = ClassUtils::getParentClass( 'MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject' ); - $this->assertEquals('stdClass', $parentClass); - } - - public function testGenerateProxyClassName() - { - $this->assertEquals( 'Proxies\__CG__\stdClass', ClassUtils::generateProxyClassName( 'stdClass', 'Proxies' ) ); - } - - /** - * @dataProvider dataGetClass - */ - public function testNewReflectionClass( $className, $expectedClassName ) - { - $reflClass = ClassUtils::newReflectionClass( $className ); - $this->assertEquals( $expectedClassName, $reflClass->getName() ); - } - - /** - * @dataProvider dataGetClass - */ - public function testNewReflectionObject( $className, $expectedClassName ) - { - $object = new $className; - $reflClass = ClassUtils::newReflectionObject( $object ); - $this->assertEquals( $expectedClassName, $reflClass->getName() ); - } - } - - class ChildObject extends \stdClass - { - } -} - -namespace MyProject\Proxies\__CG__ -{ - class stdClass extends \stdClass - { - } -} - -namespace MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util -{ - class ChildObject extends \Doctrine\Tests\Common\Util\ChildObject - { - } -} - -namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__ -{ - class stdClass extends \MyProject\Proxies\__CG__\stdClass - { - } -} - -namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util -{ - class ChildObject extends \MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject - { - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php deleted file mode 100644 index 66e8337..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php +++ /dev/null @@ -1,65 +0,0 @@ -foo = "bar"; - $obj->bar = 1234; - - $var = Debug::export($obj, 2); - $this->assertEquals( "stdClass", $var->__CLASS__ ); - } - - public function testExportDateTime() - { - $obj = new \DateTime( "2010-10-10 10:10:10" ); - - $var = Debug::export( $obj, 2 ); - $this->assertEquals( "DateTime", $var->__CLASS__ ); - } - - public function testExportArrayTraversable() - { - $obj = new \ArrayObject(array('foobar')); - - $var = Debug::export($obj, 2); - $this->assertContains('foobar', $var->__STORAGE__); - - $it = new \ArrayIterator(array('foobar')); - - $var = Debug::export($it, 5); - $this->assertContains('foobar', $var->__STORAGE__); - } - - public function testReturnsOutput() - { - ob_start(); - - $dump = Debug::dump('foo'); - $outputValue = ob_get_contents(); - - ob_end_clean(); - - $this->assertSame($outputValue, $dump); - } - - public function testDisablesOutput() - { - ob_start(); - - $dump = Debug::dump('foo', 2, true, false); - $outputValue = ob_get_contents(); - - ob_end_clean(); - - $this->assertEmpty($outputValue); - $this->assertNotSame($outputValue, $dump); - } -} diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ - Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php - -This can run considerable time, because it is using sleep() to test for the timing ranges of locks. \ No newline at end of file diff --git a/vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php b/vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php deleted file mode 100644 index a8a075d..0000000 --- a/vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php +++ /dev/null @@ -1,210 +0,0 @@ -assertEquals( - $singular, - Inflector::singularize($plural), - "'$plural' should be singularized to '$singular'" - ); - } - - /** - * testInflectingPlurals method - * - * @dataProvider dataSampleWords - * @return void - */ - public function testInflectingPlurals($singular, $plural) - { - $this->assertEquals( - $plural, - Inflector::pluralize($singular), - "'$singular' should be pluralized to '$plural'" - ); - } - - /** - * testCustomPluralRule method - * - * @return void - */ - public function testCustomPluralRule() - { - Inflector::reset(); - Inflector::rules('plural', array('/^(custom)$/i' => '\1izables')); - - $this->assertEquals(Inflector::pluralize('custom'), 'customizables'); - - Inflector::rules('plural', array('uninflected' => array('uninflectable'))); - - $this->assertEquals(Inflector::pluralize('uninflectable'), 'uninflectable'); - - Inflector::rules('plural', array( - 'rules' => array('/^(alert)$/i' => '\1ables'), - 'uninflected' => array('noflect', 'abtuse'), - 'irregular' => array('amaze' => 'amazable', 'phone' => 'phonezes') - )); - - $this->assertEquals(Inflector::pluralize('noflect'), 'noflect'); - $this->assertEquals(Inflector::pluralize('abtuse'), 'abtuse'); - $this->assertEquals(Inflector::pluralize('alert'), 'alertables'); - $this->assertEquals(Inflector::pluralize('amaze'), 'amazable'); - $this->assertEquals(Inflector::pluralize('phone'), 'phonezes'); - } - - /** - * testCustomSingularRule method - * - * @return void - */ - public function testCustomSingularRule() - { - Inflector::reset(); - Inflector::rules('singular', array('/(eple)r$/i' => '\1', '/(jente)r$/i' => '\1')); - - $this->assertEquals(Inflector::singularize('epler'), 'eple'); - $this->assertEquals(Inflector::singularize('jenter'), 'jente'); - - Inflector::rules('singular', array( - 'rules' => array('/^(bil)er$/i' => '\1', '/^(inflec|contribu)tors$/i' => '\1ta'), - 'uninflected' => array('singulars'), - 'irregular' => array('spins' => 'spinor') - )); - - $this->assertEquals(Inflector::singularize('inflectors'), 'inflecta'); - $this->assertEquals(Inflector::singularize('contributors'), 'contributa'); - $this->assertEquals(Inflector::singularize('spins'), 'spinor'); - $this->assertEquals(Inflector::singularize('singulars'), 'singulars'); - } - - /** - * test that setting new rules clears the inflector caches. - * - * @return void - */ - public function testRulesClearsCaches() - { - Inflector::reset(); - - $this->assertEquals(Inflector::singularize('Bananas'), 'Banana'); - $this->assertEquals(Inflector::pluralize('Banana'), 'Bananas'); - - Inflector::rules('singular', array( - 'rules' => array('/(.*)nas$/i' => '\1zzz') - )); - - $this->assertEquals('Banazzz', Inflector::singularize('Bananas'), 'Was inflected with old rules.'); - - Inflector::rules('plural', array( - 'rules' => array('/(.*)na$/i' => '\1zzz'), - 'irregular' => array('corpus' => 'corpora') - )); - - $this->assertEquals(Inflector::pluralize('Banana'), 'Banazzz', 'Was inflected with old rules.'); - $this->assertEquals(Inflector::pluralize('corpus'), 'corpora', 'Was inflected with old irregular form.'); - } - - /** - * Test resetting inflection rules. - * - * @return void - */ - public function testCustomRuleWithReset() - { - Inflector::reset(); - - $uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x'); - $pluralIrregular = array('as' => 'ases'); - - Inflector::rules('singular', array( - 'rules' => array('/^(.*)(a|e|o|u)is$/i' => '\1\2l'), - 'uninflected' => $uninflected, - ), true); - - Inflector::rules('plural', array( - 'rules' => array( - '/^(.*)(a|e|o|u)l$/i' => '\1\2is', - ), - 'uninflected' => $uninflected, - 'irregular' => $pluralIrregular - ), true); - - $this->assertEquals(Inflector::pluralize('Alcool'), 'Alcoois'); - $this->assertEquals(Inflector::pluralize('Atlas'), 'Atlas'); - $this->assertEquals(Inflector::singularize('Alcoois'), 'Alcool'); - $this->assertEquals(Inflector::singularize('Atlas'), 'Atlas'); - } -} - diff --git a/vendor/doctrine/inflector/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/inflector/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/vendor/doctrine/inflector/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorPerformance; - -use Athletic\AthleticEvent; -use Doctrine\Instantiator\Instantiator; - -/** - * Performance tests for {@see \Doctrine\Instantiator\Instantiator} - * - * @author Marco Pivetta - */ -class InstantiatorPerformanceEvent extends AthleticEvent -{ - /** - * @var \Doctrine\Instantiator\Instantiator - */ - private $instantiator; - - /** - * {@inheritDoc} - */ - protected function setUp() - { - $this->instantiator = new Instantiator(); - - $this->instantiator->instantiate(__CLASS__); - $this->instantiator->instantiate('ArrayObject'); - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'); - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'); - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'); - } - - /** - * @iterations 20000 - * @baseline - * @group instantiation - */ - public function testInstantiateSelf() - { - $this->instantiator->instantiate(__CLASS__); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateInternalClass() - { - $this->instantiator->instantiate('ArrayObject'); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateSimpleSerializableAssetClass() - { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateSerializableArrayObjectAsset() - { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateUnCloneableAsset() - { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php deleted file mode 100644 index 39d9b94..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php +++ /dev/null @@ -1,83 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTest\Exception; - -use Doctrine\Instantiator\Exception\InvalidArgumentException; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Tests for {@see \Doctrine\Instantiator\Exception\InvalidArgumentException} - * - * @author Marco Pivetta - * - * @covers \Doctrine\Instantiator\Exception\InvalidArgumentException - */ -class InvalidArgumentExceptionTest extends PHPUnit_Framework_TestCase -{ - public function testFromNonExistingTypeWithNonExistingClass() - { - $className = __CLASS__ . uniqid(); - $exception = InvalidArgumentException::fromNonExistingClass($className); - - $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\InvalidArgumentException', $exception); - $this->assertSame('The provided class "' . $className . '" does not exist', $exception->getMessage()); - } - - public function testFromNonExistingTypeWithTrait() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Need at least PHP 5.4.0, as this test requires traits support to run'); - } - - $exception = InvalidArgumentException::fromNonExistingClass( - 'DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset' - ); - - $this->assertSame( - 'The provided type "DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset" is a trait, ' - . 'and can not be instantiated', - $exception->getMessage() - ); - } - - public function testFromNonExistingTypeWithInterface() - { - $exception = InvalidArgumentException::fromNonExistingClass('Doctrine\\Instantiator\\InstantiatorInterface'); - - $this->assertSame( - 'The provided type "Doctrine\\Instantiator\\InstantiatorInterface" is an interface, ' - . 'and can not be instantiated', - $exception->getMessage() - ); - } - - public function testFromAbstractClass() - { - $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'); - $exception = InvalidArgumentException::fromAbstractClass($reflection); - - $this->assertSame( - 'The provided class "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" is abstract, ' - . 'and can not be instantiated', - $exception->getMessage() - ); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php deleted file mode 100644 index 84154e7..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php +++ /dev/null @@ -1,69 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTest\Exception; - -use Doctrine\Instantiator\Exception\UnexpectedValueException; -use Exception; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Tests for {@see \Doctrine\Instantiator\Exception\UnexpectedValueException} - * - * @author Marco Pivetta - * - * @covers \Doctrine\Instantiator\Exception\UnexpectedValueException - */ -class UnexpectedValueExceptionTest extends PHPUnit_Framework_TestCase -{ - public function testFromSerializationTriggeredException() - { - $reflectionClass = new ReflectionClass($this); - $previous = new Exception(); - $exception = UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $previous); - - $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception); - $this->assertSame($previous, $exception->getPrevious()); - $this->assertSame( - 'An exception was raised while trying to instantiate an instance of "' - . __CLASS__ . '" via un-serialization', - $exception->getMessage() - ); - } - - public function testFromUncleanUnSerialization() - { - $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'); - $exception = UnexpectedValueException::fromUncleanUnSerialization($reflection, 'foo', 123, 'bar', 456); - - $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception); - $this->assertSame( - 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" ' - . 'via un-serialization, since an error was triggered in file "bar" at line "456"', - $exception->getMessage() - ); - - $previous = $exception->getPrevious(); - - $this->assertInstanceOf('Exception', $previous); - $this->assertSame('foo', $previous->getMessage()); - $this->assertSame(123, $previous->getCode()); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php deleted file mode 100644 index 0a2cb93..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php +++ /dev/null @@ -1,219 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTest; - -use Doctrine\Instantiator\Exception\UnexpectedValueException; -use Doctrine\Instantiator\Instantiator; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Tests for {@see \Doctrine\Instantiator\Instantiator} - * - * @author Marco Pivetta - * - * @covers \Doctrine\Instantiator\Instantiator - */ -class InstantiatorTest extends PHPUnit_Framework_TestCase -{ - /** - * @var Instantiator - */ - private $instantiator; - - /** - * {@inheritDoc} - */ - protected function setUp() - { - $this->instantiator = new Instantiator(); - } - - /** - * @param string $className - * - * @dataProvider getInstantiableClasses - */ - public function testCanInstantiate($className) - { - $this->assertInstanceOf($className, $this->instantiator->instantiate($className)); - } - - /** - * @param string $className - * - * @dataProvider getInstantiableClasses - */ - public function testInstantiatesSeparateInstances($className) - { - $instance1 = $this->instantiator->instantiate($className); - $instance2 = $this->instantiator->instantiate($className); - - $this->assertEquals($instance1, $instance2); - $this->assertNotSame($instance1, $instance2); - } - - public function testExceptionOnUnSerializationException() - { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped( - 'As of facebook/hhvm#3432, HHVM has no PDORow, and therefore ' - . ' no internal final classes that cannot be instantiated' - ); - } - - $className = 'DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset'; - - if (\PHP_VERSION_ID >= 50600) { - $className = 'PDORow'; - } - - if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) { - $className = 'DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'; - } - - $this->setExpectedException('Doctrine\\Instantiator\\Exception\\UnexpectedValueException'); - - $this->instantiator->instantiate($className); - } - - public function testNoticeOnUnSerializationException() - { - if (\PHP_VERSION_ID >= 50600) { - $this->markTestSkipped( - 'PHP 5.6 supports `ReflectionClass#newInstanceWithoutConstructor()` for some internal classes' - ); - } - - try { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset'); - - $this->fail('No exception was raised'); - } catch (UnexpectedValueException $exception) { - $wakeUpNoticesReflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset'); - $previous = $exception->getPrevious(); - - $this->assertInstanceOf('Exception', $previous); - - // in PHP 5.4.29 and PHP 5.5.13, this case is not a notice, but an exception being thrown - if (! (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) { - $this->assertSame( - 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\WakeUpNoticesAsset" ' - . 'via un-serialization, since an error was triggered in file "' - . $wakeUpNoticesReflection->getFileName() . '" at line "36"', - $exception->getMessage() - ); - - $this->assertSame('Something went bananas while un-serializing this instance', $previous->getMessage()); - $this->assertSame(\E_USER_NOTICE, $previous->getCode()); - } - } - } - - /** - * @param string $invalidClassName - * - * @dataProvider getInvalidClassNames - */ - public function testInstantiationFromNonExistingClass($invalidClassName) - { - $this->setExpectedException('Doctrine\\Instantiator\\Exception\\InvalidArgumentException'); - - $this->instantiator->instantiate($invalidClassName); - } - - public function testInstancesAreNotCloned() - { - $className = 'TemporaryClass' . uniqid(); - - eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}'); - - $instance = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); - - $instance->foo = 'bar'; - - $instance2 = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); - - $this->assertObjectNotHasAttribute('foo', $instance2); - } - - /** - * Provides a list of instantiable classes (existing) - * - * @return string[][] - */ - public function getInstantiableClasses() - { - $classes = array( - array('stdClass'), - array(__CLASS__), - array('Doctrine\\Instantiator\\Instantiator'), - array('Exception'), - array('PharException'), - array('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\ExceptionAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\FinalExceptionAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\PharExceptionAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\XMLReaderAsset'), - ); - - if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) { - return $classes; - } - - $classes = array_merge( - $classes, - array( - array('PharException'), - array('ArrayObject'), - array('DoctrineTest\\InstantiatorTestAsset\\ArrayObjectAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'), - ) - ); - - if (\PHP_VERSION_ID >= 50600) { - $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset'); - $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset'); - } - - return $classes; - } - - /** - * Provides a list of instantiable classes (existing) - * - * @return string[][] - */ - public function getInvalidClassNames() - { - $classNames = array( - array(__CLASS__ . uniqid()), - array('Doctrine\\Instantiator\\InstantiatorInterface'), - array('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'), - ); - - if (\PHP_VERSION_ID >= 50400) { - $classNames[] = array('DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset'); - } - - return $classNames; - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php deleted file mode 100644 index fbe28dd..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -/** - * A simple asset for an abstract class - * - * @author Marco Pivetta - */ -abstract class AbstractClassAsset -{ -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php deleted file mode 100644 index 56146d7..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; -use BadMethodCallException; - -/** - * Test asset that extends an internal PHP class - * - * @author Marco Pivetta - */ -class ArrayObjectAsset extends ArrayObject -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php deleted file mode 100644 index 43bbe46..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use Exception; - -/** - * Test asset that extends an internal PHP base exception - * - * @author Marco Pivetta - */ -class ExceptionAsset extends Exception -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php deleted file mode 100644 index 7d268f5..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use Exception; - -/** - * Test asset that extends an internal PHP base exception - * - * @author Marco Pivetta - */ -final class FinalExceptionAsset extends Exception -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php deleted file mode 100644 index 553fd56..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use Phar; - -/** - * Test asset that extends an internal PHP class - * - * @author Marco Pivetta - */ -class PharAsset extends Phar -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php deleted file mode 100644 index 42bf73e..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php +++ /dev/null @@ -1,44 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use PharException; - -/** - * Test asset that extends an internal PHP class - * This class should be serializable without problems - * and without getting the "Erroneous data format for unserializing" - * error - * - * @author Marco Pivetta - */ -class PharExceptionAsset extends PharException -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php deleted file mode 100644 index ba19aaf..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; -use BadMethodCallException; -use Serializable; - -/** - * Serializable test asset that also extends an internal class - * - * @author Marco Pivetta - */ -class SerializableArrayObjectAsset extends ArrayObject implements Serializable -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } - - /** - * {@inheritDoc} - */ - public function serialize() - { - return ''; - } - - /** - * {@inheritDoc} - * - * Should not be called - * - * @throws BadMethodCallException - */ - public function unserialize($serialized) - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php deleted file mode 100644 index 39f84a6..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php +++ /dev/null @@ -1,61 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use Serializable; - -/** - * Base serializable test asset - * - * @author Marco Pivetta - */ -class SimpleSerializableAsset implements Serializable -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } - - /** - * {@inheritDoc} - */ - public function serialize() - { - return ''; - } - - /** - * {@inheritDoc} - * - * Should not be called - * - * @throws BadMethodCallException - */ - public function unserialize($serialized) - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php deleted file mode 100644 index 04e7806..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -/** - * A simple trait with no attached logic - * - * @author Marco Pivetta - */ -trait SimpleTraitAsset -{ -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php deleted file mode 100644 index 7d03bda..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; - -/** - * Base un-cloneable asset - * - * @author Marco Pivetta - */ -class UnCloneableAsset -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } - - /** - * Magic `__clone` - should not be invoked - * - * @throws BadMethodCallException - */ - public function __clone() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php deleted file mode 100644 index b348a40..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php +++ /dev/null @@ -1,39 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; -use BadMethodCallException; - -/** - * A simple asset for an abstract class - * - * @author Marco Pivetta - */ -class UnserializeExceptionArrayObjectAsset extends ArrayObject -{ - /** - * {@inheritDoc} - */ - public function __wakeup() - { - throw new BadMethodCallException(); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php deleted file mode 100644 index 18dc671..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php +++ /dev/null @@ -1,38 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; - -/** - * A simple asset for an abstract class - * - * @author Marco Pivetta - */ -class WakeUpNoticesAsset extends ArrayObject -{ - /** - * Wakeup method called after un-serialization - */ - public function __wakeup() - { - trigger_error('Something went bananas while un-serializing this instance'); - } -} diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php deleted file mode 100644 index 39ee699..0000000 --- a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use XMLReader; - -/** - * Test asset that extends an internal PHP class - * - * @author Dave Marshall - */ -class XMLReaderAsset extends XMLReader -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/vendor/egulias/email-validator/documentation/Other.md b/vendor/egulias/email-validator/documentation/Other.md deleted file mode 100644 index 9ec4bd9..0000000 --- a/vendor/egulias/email-validator/documentation/Other.md +++ /dev/null @@ -1,69 +0,0 @@ -Email length ------------- -http://tools.ietf.org/html/rfc5321#section-4.1.2 - Forward-path = Path - - Path = "<" [ A-d-l ":" ] Mailbox ">" - -http://tools.ietf.org/html/rfc5321#section-4.5.3.1.3 -http://tools.ietf.org/html/rfc1035#section-2.3.4 - -DNS ---- - -http://tools.ietf.org/html/rfc5321#section-2.3.5 - Names that can - be resolved to MX RRs or address (i.e., A or AAAA) RRs (as discussed - in Section 5) are permitted, as are CNAME RRs whose targets can be - resolved, in turn, to MX or address RRs. - -http://tools.ietf.org/html/rfc5321#section-5.1 - The lookup first attempts to locate an MX record associated with the - name. If a CNAME record is found, the resulting name is processed as - if it were the initial name. ... If an empty list of MXs is returned, - the address is treated as if it was associated with an implicit MX - RR, with a preference of 0, pointing to that host. - -is_email() author's note: We will regard the existence of a CNAME to be -sufficient evidence of the domain's existence. For performance reasons -we will not repeat the DNS lookup for the CNAME's target, but we will -raise a warning because we didn't immediately find an MX record. - -Check for TLD addresses ------------------------ -TLD addresses are specifically allowed in RFC 5321 but they are -unusual to say the least. We will allocate a separate -status to these addresses on the basis that they are more likely -to be typos than genuine addresses (unless we've already -established that the domain does have an MX record) - -http://tools.ietf.org/html/rfc5321#section-2.3.5 - In the case - of a top-level domain used by itself in an email address, a single - string is used without any dots. This makes the requirement, - described in more detail below, that only fully-qualified domain - names appear in SMTP transactions on the public Internet, - particularly important where top-level domains are involved. - -TLD format ----------- -The format of TLDs has changed a number of times. The standards -used by IANA have been largely ignored by ICANN, leading to -confusion over the standards being followed. These are not defined -anywhere, except as a general component of a DNS host name (a label). -However, this could potentially lead to 123.123.123.123 being a -valid DNS name (rather than an IP address) and thereby creating -an ambiguity. The most authoritative statement on TLD formats that -the author can find is in a (rejected!) erratum to RFC 1123 -submitted by John Klensin, the author of RFC 5321: - -http://www.rfc-editor.org/errata_search.php?rfc=1123&eid=1353 - However, a valid host name can never have the dotted-decimal - form #.#.#.#, since this change does not permit the highest-level - component label to start with a digit even if it is not all-numeric. - -Comments --------- -Comments at the start of the domain are deprecated in the text -Comments at the start of a subdomain are obs-domain -(http://tools.ietf.org/html/rfc5322#section-3.4.1) diff --git a/vendor/egulias/email-validator/documentation/RFC5321BNF.html b/vendor/egulias/email-validator/documentation/RFC5321BNF.html deleted file mode 100644 index 2313f01..0000000 --- a/vendor/egulias/email-validator/documentation/RFC5321BNF.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - -The BNF from RFC 5321 defining parts of a valid SMTP address - - - -
-   Mailbox        = Local-part "@" ( Domain / address-literal )
-
-   Local-part     = Dot-string / Quoted-string
-                  ; MAY be case-sensitive
-
-
-   Dot-string     = Atom *("."  Atom)
-
-   Atom           = 1*atext
-
-   Quoted-string  = DQUOTE *QcontentSMTP DQUOTE
-
-   QcontentSMTP   = qtextSMTP / quoted-pairSMTP
-
-   quoted-pairSMTP  = %d92 %d32-126
-                    ; i.e., backslash followed by any ASCII
-                    ; graphic (including itself) or SPace
-
-   qtextSMTP      = %d32-33 / %d35-91 / %d93-126
-                  ; i.e., within a quoted string, any
-                  ; ASCII graphic or space is permitted
-                  ; without blackslash-quoting except
-                  ; double-quote and the backslash itself.
-
-   Domain         = sub-domain *("." sub-domain)
-
-   sub-domain     = Let-dig [Ldh-str]
-
-   Let-dig        = ALPHA / DIGIT
-
-   Ldh-str        = *( ALPHA / DIGIT / "-" ) Let-dig
-
-   address-literal  = "[" ( IPv4-address-literal /
-                    IPv6-address-literal /
-                    General-address-literal ) "]"
-                    ; See Section 4.1.3
-
-   IPv4-address-literal  = Snum 3("."  Snum)
-
-   IPv6-address-literal  = "IPv6:" IPv6-addr
-
-   General-address-literal  = Standardized-tag ":" 1*dcontent
-
-   Standardized-tag  = Ldh-str
-                     ; Standardized-tag MUST be specified in a
-                     ; Standards-Track RFC and registered with IANA
-
-   dcontent       = %d33-90 / ; Printable US-ASCII
-                  %d94-126 ; excl. "[", "\", "]"
-
-   Snum           = 1*3DIGIT
-                  ; representing a decimal integer
-                  ; value in the range 0 through 255
-
-   IPv6-addr      = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
-
-   IPv6-hex       = 1*4HEXDIG
-
-   IPv6-full      = IPv6-hex 7(":" IPv6-hex)
-
-   IPv6-comp      = [IPv6-hex *5(":" IPv6-hex)] "::"
-                  [IPv6-hex *5(":" IPv6-hex)]
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 6 groups in addition to the
-                  ; "::" may be present.
-
-   IPv6v4-full    = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
-
-   IPv6v4-comp    = [IPv6-hex *3(":" IPv6-hex)] "::"
-                  [IPv6-hex *3(":" IPv6-hex) ":"]
-                  IPv4-address-literal
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 4 groups in addition to the
-                  ; "::" and IPv4-address-literal may be present.
-
-
- - - diff --git a/vendor/egulias/email-validator/documentation/RFC5322BNF.html b/vendor/egulias/email-validator/documentation/RFC5322BNF.html deleted file mode 100644 index e2f8fd7..0000000 --- a/vendor/egulias/email-validator/documentation/RFC5322BNF.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - -The BNF from RFC 5322 defining parts of a valid internet message address - - - -
-   addr-spec       =   local-part "@" domain
-
-   local-part      =   dot-atom / quoted-string / obs-local-part
-
-   dot-atom        =   [CFWS] dot-atom-text [CFWS]
-
-   CFWS            =   (1*([FWS] comment) [FWS]) / FWS
-
-   FWS             =   ([*WSP CRLF] 1*WSP) /  obs-FWS
-                                          ; Folding white space
-
-   WSP             =   SP / HTAB          ; white space
-
-   obs-FWS         =   1*([CRLF] WSP)     ; As amended in erratum #1908
-
-   ctext           =   %d33-39 /          ; Printable US-ASCII
-                       %d42-91 /          ;  characters not including
-                       %d93-126 /         ;  "(", ")", or "\"
-                       obs-ctext
-
-   obs-ctext       =   obs-NO-WS-CTL
-   ccontent        =   ctext / quoted-pair / comment
-
-   comment         =   "(" *([FWS] ccontent) [FWS] ")"
-
-   dot-atom-text   =   1*atext *("." 1*atext)
-
-   atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
-                       "!" / "#" /        ;  characters not including
-                       "$" / "%" /        ;  specials.  Used for atoms.
-                       "&" / "'" /
-                       "*" / "+" /
-                       "-" / "/" /
-                       "=" / "?" /
-                       "^" / "_" /
-                       "`" / "{" /
-                       "|" / "}" /
-                       "~"
-
-   specials        =   "(" / ")" /        ; Special characters that do
-                       "<" / ">" /        ;  not appear in atext
-                       "[" / "]" /
-                       ":" / ";" /
-                       "@" / "\" /
-                       "," / "." /
-                       DQUOTE
-
-   quoted-string   =   [CFWS]
-                       DQUOTE *([FWS] qcontent) [FWS] DQUOTE
-                       [CFWS]
-
-   qcontent        =   qtext / quoted-pair
-
-   qtext           =   %d33 /             ; Printable US-ASCII
-                       %d35-91 /          ;  characters not including
-                       %d93-126 /         ;  "\" or the quote character
-                       obs-qtext
-
-   obs-qtext       =   obs-NO-WS-CTL
-
-   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
-                       %d11 /             ;  characters that do not
-                       %d12 /             ;  include the carriage
-                       %d14-31 /          ;  return, line feed, and
-                       %d127              ;  white space characters
-
-   quoted-pair     =   ("\" (VCHAR / WSP)) / obs-qp
-
-   VCHAR           =   %x21-7E            ; visible (printing) characters
-
-   obs-qp          =   "\" (%d0 / obs-NO-WS-CTL / LF / CR)
-
-   obs-local-part  =   word *("." word)
-
-   word            =   atom / quoted-string
-
-   atom            =   [CFWS] 1*atext [CFWS]
-
-   domain          =   dot-atom / domain-literal / obs-domain
-
-   domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
-
-   dtext           =   %d33-90 /          ; Printable US-ASCII
-                       %d94-126 /         ;  characters not including
-                       obs-dtext          ;  "[", "]", or "\"
-
-   obs-dtext       =   obs-NO-WS-CTL / quoted-pair
-
-   obs-domain      =   atom *("." atom)
-
-NB For SMTP mail, the domain-literal is restricted by RFC5321 as follows:
-
-   Mailbox        = Local-part "@" ( Domain / address-literal )
-
-   address-literal  = "[" ( IPv4-address-literal /
-                    IPv6-address-literal /
-                    General-address-literal ) "]"
-
-   IPv4-address-literal  = Snum 3("."  Snum)
-
-   IPv6-address-literal  = "IPv6:" IPv6-addr
-
-   Snum           = 1*3DIGIT
-                  ; representing a decimal integer
-                  ; value in the range 0 through 255
-
-   IPv6-addr      = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
-
-   IPv6-hex       = 1*4HEXDIG
-
-   IPv6-full      = IPv6-hex 7(":" IPv6-hex)
-
-   IPv6-comp      = [IPv6-hex *5(":" IPv6-hex)] "::"
-                  [IPv6-hex *5(":" IPv6-hex)]
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 6 groups in addition to the
-                  ; "::" may be present.
-
-   IPv6v4-full    = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
-
-   IPv6v4-comp    = [IPv6-hex *3(":" IPv6-hex)] "::"
-                  [IPv6-hex *3(":" IPv6-hex) ":"]
-                  IPv4-address-literal
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 4 groups in addition to the
-                  ; "::" and IPv4-address-literal may be present.
-
-
- - - diff --git a/vendor/egulias/email-validator/tests/bootstrap.php b/vendor/egulias/email-validator/tests/bootstrap.php deleted file mode 100644 index 676c4b1..0000000 --- a/vendor/egulias/email-validator/tests/bootstrap.php +++ /dev/null @@ -1,8 +0,0 @@ -isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator + instantiation' . PHP_EOL; - -$a = microtime(true); -$validator = new EmailValidator(); -for ($i = 0; $i < $iterations; $i++) { - $isValid = $validator->isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator once instanced' . PHP_EOL; diff --git a/vendor/egulias/email-validator/tests/egulias/Performance/AgainstOldIsemail.php b/vendor/egulias/email-validator/tests/egulias/Performance/AgainstOldIsemail.php deleted file mode 100644 index 99476c1..0000000 --- a/vendor/egulias/email-validator/tests/egulias/Performance/AgainstOldIsemail.php +++ /dev/null @@ -1,34 +0,0 @@ -isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator + instantiation' . PHP_EOL; - -$a = microtime(true); -$validator = new EmailValidator(); -for ($i = 0; $i < $iterations; $i++) { - $isValid = $validator->isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator once instanced' . PHP_EOL; diff --git a/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailLexerTest.php b/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailLexerTest.php deleted file mode 100644 index d5389ef..0000000 --- a/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailLexerTest.php +++ /dev/null @@ -1,161 +0,0 @@ -assertInstanceOf('Doctrine\Common\Lexer\AbstractLexer', $lexer); - } - - /** - * @dataProvider getTokens - * - */ - public function testLexerTokens($str, $token) - { - $lexer = new EmailLexer(); - $lexer->setInput($str); - $lexer->moveNext(); - $lexer->moveNext(); - $this->assertEquals($token, $lexer->token['type']); - } - - public function testLexerParsesMultipleSpaces() - { - $lexer = new EmailLexer(); - $lexer->setInput(' '); - $lexer->moveNext(); - $lexer->moveNext(); - $this->assertEquals(EmailLexer::S_SP, $lexer->token['type']); - $lexer->moveNext(); - $this->assertEquals(EmailLexer::S_SP, $lexer->token['type']); - } - - /** - * @dataProvider invalidUTF8CharsProvider - */ - public function testLexerParsesInvalidUTF8($char) - { - $lexer = new EmailLexer(); - $lexer->setInput($char); - $lexer->moveNext(); - $lexer->moveNext(); - - $this->assertEquals(EmailLexer::INVALID, $lexer->token['type']); - } - - public function invalidUTF8CharsProvider() - { - $chars = array(); - for ($i = 0; $i < 0x100; ++$i) { - $c = $this->utf8Chr($i); - if (preg_match('/(?=\p{Cc})(?=[^\t\n\n\r])/u', $c) && !preg_match('/\x{0000}/u', $c)) { - $chars[] = array($c); - } - } - - return $chars; - } - - protected function utf8Chr($code_point) - { - - if ($code_point < 0 || 0x10FFFF < $code_point || (0xD800 <= $code_point && $code_point <= 0xDFFF)) { - return ''; - } - - if ($code_point < 0x80) { - $hex[0] = $code_point; - $ret = chr($hex[0]); - } elseif ($code_point < 0x800) { - $hex[0] = 0x1C0 | $code_point >> 6; - $hex[1] = 0x80 | $code_point & 0x3F; - $ret = chr($hex[0]).chr($hex[1]); - } elseif ($code_point < 0x10000) { - $hex[0] = 0xE0 | $code_point >> 12; - $hex[1] = 0x80 | $code_point >> 6 & 0x3F; - $hex[2] = 0x80 | $code_point & 0x3F; - $ret = chr($hex[0]).chr($hex[1]).chr($hex[2]); - } else { - $hex[0] = 0xF0 | $code_point >> 18; - $hex[1] = 0x80 | $code_point >> 12 & 0x3F; - $hex[2] = 0x80 | $code_point >> 6 & 0x3F; - $hex[3] = 0x80 | $code_point & 0x3F; - $ret = chr($hex[0]).chr($hex[1]).chr($hex[2]).chr($hex[3]); - } - - return $ret; - } - - public function testLexerForTab() - { - $lexer = new EmailLexer(); - $lexer->setInput("foo\tbar"); - $lexer->moveNext(); - $lexer->skipUntil(EmailLexer::S_HTAB); - $lexer->moveNext(); - $this->assertEquals(EmailLexer::S_HTAB, $lexer->token['type']); - } - - public function testLexerForUTF8() - { - $lexer = new EmailLexer(); - $lexer->setInput("áÇ@bar.com"); - $lexer->moveNext(); - $lexer->moveNext(); - $this->assertEquals(EmailLexer::GENERIC, $lexer->token['type']); - $lexer->moveNext(); - $this->assertEquals(EmailLexer::GENERIC, $lexer->token['type']); - } - - public function testLexerSearchToken() - { - $lexer = new EmailLexer(); - $lexer->setInput("foo\tbar"); - $lexer->moveNext(); - $this->assertTrue($lexer->find(EmailLexer::S_HTAB)); - } - - public function getTokens() - { - return array( - array("foo", EmailLexer::GENERIC), - array("\r", EmailLexer::S_CR), - array("\t", EmailLexer::S_HTAB), - array("\r\n", EmailLexer::CRLF), - array("\n", EmailLexer::S_LF), - array(" ", EmailLexer::S_SP), - array("@", EmailLexer::S_AT), - array("IPv6", EmailLexer::S_IPV6TAG), - array("::", EmailLexer::S_DOUBLECOLON), - array(":", EmailLexer::S_COLON), - array(".", EmailLexer::S_DOT), - array("\"", EmailLexer::S_DQUOTE), - array("-", EmailLexer::S_HYPHEN), - array("\\", EmailLexer::S_BACKSLASH), - array("/", EmailLexer::S_SLASH), - array("(", EmailLexer::S_OPENPARENTHESIS), - array(")", EmailLexer::S_CLOSEPARENTHESIS), - array('<', EmailLexer::S_LOWERTHAN), - array('>', EmailLexer::S_GREATERTHAN), - array('[', EmailLexer::S_OPENBRACKET), - array(']', EmailLexer::S_CLOSEBRACKET), - array(';', EmailLexer::S_SEMICOLON), - array(',', EmailLexer::S_COMMA), - array('<', EmailLexer::S_LOWERTHAN), - array('>', EmailLexer::S_GREATERTHAN), - array('{', EmailLexer::S_OPENQBRACKET), - array('}', EmailLexer::S_CLOSEQBRACKET), - array('', EmailLexer::S_EMPTY), - array(chr(31), EmailLexer::INVALID), - array(chr(226), EmailLexer::GENERIC), - array(chr(0), EmailLexer::C_NUL) - ); - } -} diff --git a/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php b/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php deleted file mode 100644 index 1491df7..0000000 --- a/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php +++ /dev/null @@ -1,375 +0,0 @@ -validator = new EmailValidator(); - } - - protected function tearDown() - { - $this->validator = null; - } - - /** - * @dataProvider getValidEmails - */ - public function testValidEmails($email) - { - $this->assertTrue($this->validator->isValid($email)); - } - - public function testInvalidUTF8Email() - { - $validator = new EmailValidator; - $email = "\x80\x81\x82@\x83\x84\x85.\x86\x87\x88"; - - $this->assertFalse($validator->isValid($email)); - } - - public function getValidEmails() - { - return array( - array('â@iana.org'), - array('fabien@symfony.com'), - array('example@example.co.uk'), - array('fabien_potencier@example.fr'), - array('example@localhost'), - array('fab\'ien@symfony.com'), - array('fab\ ien@symfony.com'), - array('example((example))@fakedfake.co.uk'), - array('example@faked(fake).co.uk'), - array('fabien+@symfony.com'), - array('инфо@письмо.рф'), - array('"username"@example.com'), - array('"user,name"@example.com'), - array('"user name"@example.com'), - array('"user@name"@example.com'), - array('"\a"@iana.org'), - array('"test\ test"@iana.org'), - array('""@iana.org'), - array('"\""@iana.org'), - array('müller@möller.de'), - array('test@email*'), - array('test@email!'), - array('test@email&'), - array('test@email^'), - array('test@email%'), - array('test@email$'), - ); - } - - /** - * @dataProvider getInvalidEmails - */ - public function testInvalidEmails($email) - { - $this->assertFalse($this->validator->isValid($email)); - } - - public function getInvalidEmails() - { - return array( - array('test@example.com test'), - array('user name@example.com'), - array('user name@example.com'), - array('example.@example.co.uk'), - array('example@example@example.co.uk'), - array('(test_exampel@example.fr)'), - array('example(example)example@example.co.uk'), - array('.example@localhost'), - array('ex\ample@localhost'), - array('example@local\host'), - array('example@localhost.'), - array('user name@example.com'), - array('username@ example . com'), - array('example@(fake).com'), - array('example@(fake.com'), - array('username@example,com'), - array('usern,ame@example.com'), - array('user[na]me@example.com'), - array('"""@iana.org'), - array('"\"@iana.org'), - array('"test"test@iana.org'), - array('"test""test"@iana.org'), - array('"test"."test"@iana.org'), - array('"test".test@iana.org'), - array('"test"' . chr(0) . '@iana.org'), - array('"test\"@iana.org'), - array(chr(226) . '@iana.org'), - array('test@' . chr(226) . '.org'), - array('\r\ntest@iana.org'), - array('\r\n test@iana.org'), - array('\r\n \r\ntest@iana.org'), - array('\r\n \r\ntest@iana.org'), - array('\r\n \r\n test@iana.org'), - array('test@iana.org \r\n'), - array('test@iana.org \r\n '), - array('test@iana.org \r\n \r\n'), - array('test@iana.org \r\n\r\n'), - array('test@iana.org \r\n\r\n '), - array('test@iana/icann.org'), - array('test@foo;bar.com'), - array('test;123@foobar.com'), - array('test@example..com'), - array('email.email@email."'), - array('test@email>'), - array('test@email<'), - array('test@email{'), - ); - } - - /** - * @dataProvider getInvalidEmailsWithErrors - */ - public function testInvalidEmailsWithErrorsCheck($errors, $email) - { - $this->assertFalse($this->validator->isValid($email)); - - $this->assertEquals($errors, $this->validator->getError()); - } - - public function getInvalidEmailsWithErrors() - { - return array( - array(EmailValidator::ERR_NOLOCALPART, '@example.co.uk'), - array(EmailValidator::ERR_NODOMAIN, 'example@'), - array(EmailValidator::ERR_DOMAINHYPHENEND, 'example@example-.co.uk'), - array(EmailValidator::ERR_DOMAINHYPHENEND, 'example@example-'), - array(EmailValidator::ERR_CONSECUTIVEATS, 'example@@example.co.uk'), - array(EmailValidator::ERR_CONSECUTIVEDOTS, 'example..example@example.co.uk'), - array(EmailValidator::ERR_CONSECUTIVEDOTS, 'example@example..co.uk'), - array(EmailValidator::ERR_EXPECTING_ATEXT, '@example.fr'), - array(EmailValidator::ERR_DOT_START, '.example@localhost'), - array(EmailValidator::ERR_DOT_START, 'example@.localhost'), - array(EmailValidator::ERR_DOT_END, 'example@localhost.'), - array(EmailValidator::ERR_DOT_END, 'example.@example.co.uk'), - array(EmailValidator::ERR_UNCLOSEDCOMMENT, '(example@localhost'), - array(EmailValidator::ERR_UNCLOSEDQUOTEDSTR, '"example@localhost'), - array(EmailValidator::ERR_EXPECTING_ATEXT, 'exa"mple@localhost'), - //This was the original. But atext is not allowed after \n - //array(EmailValidator::ERR_EXPECTING_ATEXT, "exampl\ne@example.co.uk"), - array(EmailValidator::ERR_ATEXT_AFTER_CFWS, "exampl\ne@example.co.uk"), - array(EmailValidator::ERR_EXPECTING_DTEXT, "example@[[]"), - array(EmailValidator::ERR_ATEXT_AFTER_CFWS, "exampl\te@example.co.uk"), - array(EmailValidator::ERR_CR_NO_LF, "example@exa\rmple.co.uk"), - array(EmailValidator::ERR_CR_NO_LF, "example@[\r]"), - array(EmailValidator::ERR_CR_NO_LF, "exam\rple@example.co.uk"), - ); - } - - /** - * @dataProvider getInvalidEmailsWithWarnings - */ - public function testValidEmailsWithWarningsCheck($warnings, $email) - { - $this->assertTrue($this->validator->isValid($email, true)); - - $this->assertEquals($warnings, $this->validator->getWarnings()); - } - - /** - * @dataProvider getInvalidEmailsWithWarnings - */ - public function testInvalidEmailsWithDnsCheckAndStrictMode($warnings, $email) - { - $this->assertFalse($this->validator->isValid($email, true, true)); - - $this->assertEquals($warnings, $this->validator->getWarnings()); - } - - public function getInvalidEmailsWithWarnings() - { - return array( - array( - array( - EmailValidator::DEPREC_CFWS_NEAR_AT, - EmailValidator::DNSWARN_NO_RECORD - ), - 'example @example.co.uk' - ), - array( - array( - EmailValidator::DEPREC_CFWS_NEAR_AT, - EmailValidator::DNSWARN_NO_RECORD - ), - 'example@ example.co.uk' - ), - array( - array( - EmailValidator::CFWS_COMMENT, - EmailValidator::DNSWARN_NO_RECORD - ), - 'example@example(examplecomment).co.uk' - ), - array( - array( - EmailValidator::CFWS_COMMENT, - EmailValidator::DEPREC_CFWS_NEAR_AT, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example(examplecomment)@example.co.uk' - ), - array( - array( - EmailValidator::RFC5321_QUOTEDSTRING, - EmailValidator::CFWS_FWS, - EmailValidator::DNSWARN_NO_RECORD, - ), - "\"\t\"@example.co.uk" - ), - array( - array( - EmailValidator::RFC5321_QUOTEDSTRING, - EmailValidator::CFWS_FWS, - EmailValidator::DNSWARN_NO_RECORD - ), - "\"\r\"@example.co.uk" - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[127.0.0.1]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5321_IPV6DEPRECATED, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370::]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_MAXGRPS, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334::]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_2X2XCOLON, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:1::1::1]' - ), - array( - array( - EmailValidator::RFC5322_DOMLIT_OBSDTEXT, - EmailValidator::RFC5322_DOMAINLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - "example@[\n]" - ), - array( - array( - EmailValidator::RFC5322_DOMAINLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[::1]' - ), - array( - array( - EmailValidator::RFC5322_DOMAINLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[::123.45.67.178]' - ), - array( - array( - EmailValidator::RFC5322_IPV6_COLONSTRT, - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_GRPCOUNT, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6::2001:0db8:85a3:0000:0000:8a2e:0370:7334]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_BADCHAR, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:z001:0db8:85a3:0000:0000:8a2e:0370:7334]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_COLONEND, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:]' - ), - array( - array( - EmailValidator::RFC5321_QUOTEDSTRING, - EmailValidator::DNSWARN_NO_RECORD - ), - '"example"@example.co.uk' - ), - array( - array( - EmailValidator::RFC5322_LOCAL_TOOLONG, - EmailValidator::DNSWARN_NO_RECORD - ), - 'too_long_localpart_too_long_localpart_too_long_localpart_too_long_localpart@example.co.uk' - ), - array( - array( - EmailValidator::RFC5322_LABEL_TOOLONG, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart.co.uk' - ), - array( - array( - EmailValidator::RFC5322_DOMAIN_TOOLONG, - EmailValidator::RFC5322_TOOLONG, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocal'. - 'parttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart'. - 'toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart' - ), - array( - array( - EmailValidator::RFC5322_DOMAIN_TOOLONG, - EmailValidator::RFC5322_TOOLONG, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocal'. - 'parttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart'. - 'toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpar' - ), - array( - array( - EmailValidator::DNSWARN_NO_RECORD, - ), - 'test@test' - ), - ); - } - - public function testInvalidEmailsWithStrict() - { - $this->assertFalse($this->validator->isValid('"test"@test', false, true)); - } -} diff --git a/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php b/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php deleted file mode 100644 index 8c2b0a5..0000000 --- a/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php +++ /dev/null @@ -1,375 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Goutte\Tests; - -use Goutte\Client; -use GuzzleHttp\Client as GuzzleClient; -use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Handler\MockHandler; -use GuzzleHttp\HandlerStack; -use GuzzleHttp\Psr7\Response as GuzzleResponse; -use GuzzleHttp\Middleware; -use Symfony\Component\BrowserKit\Cookie; - -/** - * Goutte Client Test. - * - * @author Michael Dowling - * @author Charles Sarrazin - */ -class ClientTest extends \PHPUnit_Framework_TestCase -{ - protected $history; - /** @var MockHandler */ - protected $mock; - - protected function getGuzzle(array $responses = []) - { - if (empty($responses)) { - $responses = [new GuzzleResponse(200, [], '

Hi

')]; - } - $this->mock = new MockHandler($responses); - $handlerStack = HandlerStack::create($this->mock); - $this->history = []; - $handlerStack->push(Middleware::history($this->history)); - $guzzle = new GuzzleClient(array('redirect.disable' => true, 'base_uri' => '', 'handler' => $handlerStack)); - - return $guzzle; - } - - public function testCreatesDefaultClient() - { - $client = new Client(); - $this->assertInstanceOf('GuzzleHttp\\ClientInterface', $client->getClient()); - } - - public function testUsesCustomClient() - { - $guzzle = new GuzzleClient(); - $client = new Client(); - $this->assertSame($client, $client->setClient($guzzle)); - $this->assertSame($guzzle, $client->getClient()); - } - - public function testUsesCustomHeaders() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setHeader('X-Test', 'test'); - $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('test', end($this->history)['request']->getHeaderLine('X-Test')); - } - - public function testCustomUserAgent() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setHeader('User-Agent', 'foo'); - $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('Symfony2 BrowserKit, foo', end($this->history)['request']->getHeaderLine('User-Agent')); - } - - public function testUsesAuth() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setAuth('me', '**'); - $client->request('GET', 'http://www.example.com/'); - $request = end($this->history)['request']; - $this->assertEquals('Basic bWU6Kio=', $request->getHeaderLine('Authorization')); - } - - public function testResetsAuth() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setAuth('me', '**'); - $client->resetAuth(); - $client->request('GET', 'http://www.example.com/'); - $request = end($this->history)['request']; - $this->assertEquals('', $request->getHeaderLine('authorization')); - } - - public function testUsesCookies() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->getCookieJar()->set(new Cookie('test', '123')); - $client->request('GET', 'http://www.example.com/'); - $request = end($this->history)['request']; - $this->assertEquals('test=123', $request->getHeaderLine('Cookie')); - } - - public function testUsesCookiesWithCustomPort() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->getCookieJar()->set(new Cookie('test', '123')); - $client->request('GET', 'http://www.example.com:8000/'); - $request = end($this->history)['request']; - $this->assertEquals('test=123', $request->getHeaderLine('Cookie')); - } - - public function testUsesPostFiles() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => array( - 'name' => 'test.txt', - 'tmp_name' => __DIR__.'/fixtures.txt', - ), - ); - - $client->request('POST', 'http://www.example.com/', array(), $files); - $request = end($this->history)['request']; - - $stream = $request->getBody(); - $boundary = $stream->getBoundary(); - $this->assertEquals( - "--$boundary\r\nContent-Disposition: form-data; name=\"test\"; filename=\"test.txt\"\r\nContent-Length: 4\r\n" - ."Content-Type: text/plain\r\n\r\nfoo\n\r\n--$boundary--\r\n", - $stream->getContents() - ); - } - - public function testUsesPostNamedFiles() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => __DIR__.'/fixtures.txt', - ); - - $client->request('POST', 'http://www.example.com/', array(), $files); - $request = end($this->history)['request']; - - $stream = $request->getBody(); - $boundary = $stream->getBoundary(); - $this->assertEquals( - "--$boundary\r\nContent-Disposition: form-data; name=\"test\"; filename=\"fixtures.txt\"\r\nContent-Length: 4\r\n" - ."Content-Type: text/plain\r\n\r\nfoo\n\r\n--$boundary--\r\n", - $stream->getContents() - ); - } - - public function testUsesPostFilesNestedFields() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'form' => array( - 'test' => array( - 'name' => 'test.txt', - 'tmp_name' => __DIR__.'/fixtures.txt', - ), - ), - ); - - $client->request('POST', 'http://www.example.com/', array(), $files); - $request = end($this->history)['request']; - - $stream = $request->getBody(); - $boundary = $stream->getBoundary(); - $this->assertEquals( - "--$boundary\r\nContent-Disposition: form-data; name=\"form[test]\"; filename=\"test.txt\"\r\nContent-Length: 4\r\n" - ."Content-Type: text/plain\r\n\r\nfoo\n\r\n--$boundary--\r\n", - $stream->getContents() - ); - } - - public function testPostFormWithFiles() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => __DIR__.'/fixtures.txt', - ); - $params = array( - 'foo' => 'bar', - ); - - $client->request('POST', 'http://www.example.com/', $params, $files); - $request = end($this->history)['request']; - - $stream = $request->getBody(); - $boundary = $stream->getBoundary(); - $this->assertEquals( - "--$boundary\r\nContent-Disposition: form-data; name=\"foo\"\r\nContent-Length: 3\r\n" - ."\r\nbar\r\n" - ."--$boundary\r\nContent-Disposition: form-data; name=\"test\"; filename=\"fixtures.txt\"\r\nContent-Length: 4\r\n" - ."Content-Type: text/plain\r\n\r\nfoo\n\r\n--$boundary--\r\n", - $stream->getContents()); - } - - public function testPostEmbeddedFormWithFiles() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => __DIR__.'/fixtures.txt', - ); - $params = array( - 'foo' => array( - 'bar' => 'baz', - ), - ); - - $client->request('POST', 'http://www.example.com/', $params, $files); - $request = end($this->history)['request']; - - $stream = $request->getBody(); - $boundary = $stream->getBoundary(); - $this->assertEquals( - "--$boundary\r\nContent-Disposition: form-data; name=\"foo[bar]\"\r\nContent-Length: 3\r\n" - ."\r\nbaz\r\n" - ."--$boundary\r\nContent-Disposition: form-data; name=\"test\"; filename=\"fixtures.txt\"\r\nContent-Length: 4\r\n" - ."Content-Type: text/plain\r\n\r\nfoo\n\r\n--$boundary--\r\n", - $stream->getContents()); - } - - public function testUsesPostFilesOnClientSide() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => __DIR__.'/fixtures.txt', - ); - - $client->request('POST', 'http://www.example.com/', array(), $files); - $request = end($this->history)['request']; - - $stream = $request->getBody(); - $boundary = $stream->getBoundary(); - $this->assertEquals( - "--$boundary\r\nContent-Disposition: form-data; name=\"test\"; filename=\"fixtures.txt\"\r\nContent-Length: 4\r\n" - ."Content-Type: text/plain\r\n\r\nfoo\n\r\n--$boundary--\r\n", - $stream->getContents() - ); - } - - public function testUsesPostFilesUploadError() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => array( - 'name' => '', - 'type' => '', - 'tmp_name' => '', - 'error' => 4, - 'size' => 0, - ), - ); - - $client->request('POST', 'http://www.example.com/', array(), $files); - $request = end($this->history)['request']; - $stream = $request->getBody(); - $boundary = $stream->getBoundary(); - - $this->assertEquals("--$boundary--\r\n", $stream->getContents()); - } - - public function testCreatesResponse() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $crawler = $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('Hi', $crawler->filter('p')->text()); - } - - public function testHandlesRedirectsCorrectly() - { - $guzzle = $this->getGuzzle([ - new GuzzleResponse(301, array( - 'Location' => 'http://www.example.com/', - )), - new GuzzleResponse(200, [], '

Test

'), - ]); - - $client = new Client(); - $client->setClient($guzzle); - - $crawler = $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('Test', $crawler->filter('p')->text()); - - // Ensure that two requests were sent - $this->assertEquals(2, count($this->history)); - } - - public function testConvertsGuzzleHeadersToArrays() - { - $guzzle = $this->getGuzzle([ - new GuzzleResponse(200, array( - 'Date' => 'Tue, 04 Jun 2013 13:22:41 GMT', - )), - ]); - - $client = new Client(); - $client->setClient($guzzle); - $client->request('GET', 'http://www.example.com/'); - $response = $client->getResponse(); - $headers = $response->getHeaders(); - - $this->assertInternalType('array', array_shift($headers), 'Header not converted from Guzzle\Http\Message\Header to array'); - } - - public function testNullResponseException() - { - $this->setExpectedException('GuzzleHttp\Exception\RequestException'); - $guzzle = $this->getGuzzle([ - new RequestException('', $this->getMock('Psr\Http\Message\RequestInterface')), - ]); - $client = new Client(); - $client->setClient($guzzle); - $client->request('GET', 'http://www.example.com/'); - $client->getResponse(); - } - - public function testHttps() - { - $guzzle = $this->getGuzzle([ - new GuzzleResponse(200, [], '

Test

'), - ]); - - $client = new Client(); - $client->setClient($guzzle); - $crawler = $client->request('GET', 'https://www.example.com/'); - $this->assertEquals('Test', $crawler->filter('p')->text()); - } - - public function testCustomUserAgentConstructor() - { - $guzzle = $this->getGuzzle(); - $client = new Client([ - 'HTTP_HOST' => '1.2.3.4', - 'HTTP_USER_AGENT' => 'SomeHost', - ]); - $client->setClient($guzzle); - $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('SomeHost', end($this->history)['request']->getHeaderLine('User-Agent')); - } -} diff --git a/vendor/fabpot/goutte/Goutte/Tests/fixtures.txt b/vendor/fabpot/goutte/Goutte/Tests/fixtures.txt deleted file mode 100644 index 257cc56..0000000 --- a/vendor/fabpot/goutte/Goutte/Tests/fixtures.txt +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/vendor/guzzlehttp/promises/tests/AggregateExceptionTest.php b/vendor/guzzlehttp/promises/tests/AggregateExceptionTest.php deleted file mode 100644 index eaa7703..0000000 --- a/vendor/guzzlehttp/promises/tests/AggregateExceptionTest.php +++ /dev/null @@ -1,14 +0,0 @@ -assertContains('foo', $e->getMessage()); - $this->assertEquals(['baz', 'bar'], $e->getReason()); - } -} diff --git a/vendor/guzzlehttp/promises/tests/EachPromiseTest.php b/vendor/guzzlehttp/promises/tests/EachPromiseTest.php deleted file mode 100644 index b913b3a..0000000 --- a/vendor/guzzlehttp/promises/tests/EachPromiseTest.php +++ /dev/null @@ -1,288 +0,0 @@ - 100]); - $this->assertSame($each->promise(), $each->promise()); - } - - public function testInvokesAllPromises() - { - $promises = [new Promise(), new Promise(), new Promise()]; - $called = []; - $each = new EachPromise($promises, [ - 'fulfilled' => function ($value) use (&$called) { - $called[] = $value; - } - ]); - $p = $each->promise(); - $promises[0]->resolve('a'); - $promises[1]->resolve('c'); - $promises[2]->resolve('b'); - P\queue()->run(); - $this->assertEquals(['a', 'c', 'b'], $called); - $this->assertEquals(PromiseInterface::FULFILLED, $p->getState()); - } - - public function testIsWaitable() - { - $a = new Promise(function () use (&$a) { $a->resolve('a'); }); - $b = new Promise(function () use (&$b) { $b->resolve('b'); }); - $called = []; - $each = new EachPromise([$a, $b], [ - 'fulfilled' => function ($value) use (&$called) { $called[] = $value; } - ]); - $p = $each->promise(); - $this->assertNull($p->wait()); - $this->assertEquals(PromiseInterface::FULFILLED, $p->getState()); - $this->assertEquals(['a', 'b'], $called); - } - - public function testCanResolveBeforeConsumingAll() - { - $called = 0; - $a = new Promise(function () use (&$a) { $a->resolve('a'); }); - $b = new Promise(function () { $this->fail(); }); - $each = new EachPromise([$a, $b], [ - 'fulfilled' => function ($value, $idx, Promise $aggregate) use (&$called) { - $this->assertSame($idx, 0); - $this->assertEquals('a', $value); - $aggregate->resolve(null); - $called++; - }, - 'rejected' => function (\Exception $reason) { - $this->fail($reason->getMessage()); - } - ]); - $p = $each->promise(); - $p->wait(); - $this->assertNull($p->wait()); - $this->assertEquals(1, $called); - $this->assertEquals(PromiseInterface::FULFILLED, $a->getState()); - $this->assertEquals(PromiseInterface::PENDING, $b->getState()); - // Resolving $b has no effect on the aggregate promise. - $b->resolve('foo'); - $this->assertEquals(1, $called); - } - - public function testLimitsPendingPromises() - { - $pending = [new Promise(), new Promise(), new Promise(), new Promise()]; - $promises = new \ArrayIterator($pending); - $each = new EachPromise($promises, ['concurrency' => 2]); - $p = $each->promise(); - $this->assertCount(2, $this->readAttribute($each, 'pending')); - $pending[0]->resolve('a'); - $this->assertCount(2, $this->readAttribute($each, 'pending')); - $this->assertTrue($promises->valid()); - $pending[1]->resolve('b'); - P\queue()->run(); - $this->assertCount(2, $this->readAttribute($each, 'pending')); - $this->assertTrue($promises->valid()); - $promises[2]->resolve('c'); - P\queue()->run(); - $this->assertCount(1, $this->readAttribute($each, 'pending')); - $this->assertEquals(PromiseInterface::PENDING, $p->getState()); - $promises[3]->resolve('d'); - P\queue()->run(); - $this->assertNull($this->readAttribute($each, 'pending')); - $this->assertEquals(PromiseInterface::FULFILLED, $p->getState()); - $this->assertFalse($promises->valid()); - } - - public function testDynamicallyLimitsPendingPromises() - { - $calls = []; - $pendingFn = function ($count) use (&$calls) { - $calls[] = $count; - return 2; - }; - $pending = [new Promise(), new Promise(), new Promise(), new Promise()]; - $promises = new \ArrayIterator($pending); - $each = new EachPromise($promises, ['concurrency' => $pendingFn]); - $p = $each->promise(); - $this->assertCount(2, $this->readAttribute($each, 'pending')); - $pending[0]->resolve('a'); - $this->assertCount(2, $this->readAttribute($each, 'pending')); - $this->assertTrue($promises->valid()); - $pending[1]->resolve('b'); - $this->assertCount(2, $this->readAttribute($each, 'pending')); - P\queue()->run(); - $this->assertTrue($promises->valid()); - $promises[2]->resolve('c'); - P\queue()->run(); - $this->assertCount(1, $this->readAttribute($each, 'pending')); - $this->assertEquals(PromiseInterface::PENDING, $p->getState()); - $promises[3]->resolve('d'); - P\queue()->run(); - $this->assertNull($this->readAttribute($each, 'pending')); - $this->assertEquals(PromiseInterface::FULFILLED, $p->getState()); - $this->assertEquals([0, 1, 1, 1], $calls); - $this->assertFalse($promises->valid()); - } - - public function testClearsReferencesWhenResolved() - { - $called = false; - $a = new Promise(function () use (&$a, &$called) { - $a->resolve('a'); - $called = true; - }); - $each = new EachPromise([$a], [ - 'concurrency' => function () { return 1; }, - 'fulfilled' => function () {}, - 'rejected' => function () {} - ]); - $each->promise()->wait(); - $this->assertNull($this->readAttribute($each, 'onFulfilled')); - $this->assertNull($this->readAttribute($each, 'onRejected')); - $this->assertNull($this->readAttribute($each, 'iterable')); - $this->assertNull($this->readAttribute($each, 'pending')); - $this->assertNull($this->readAttribute($each, 'concurrency')); - $this->assertTrue($called); - } - - public function testCanBeCancelled() - { - $this->markTestIncomplete(); - } - - public function testDoesNotBlowStackWithFulfilledPromises() - { - $pending = []; - for ($i = 0; $i < 100; $i++) { - $pending[] = new FulfilledPromise($i); - } - $values = []; - $each = new EachPromise($pending, [ - 'fulfilled' => function ($value) use (&$values) { - $values[] = $value; - } - ]); - $called = false; - $each->promise()->then(function () use (&$called) { - $called = true; - }); - $this->assertFalse($called); - P\queue()->run(); - $this->assertTrue($called); - $this->assertEquals(range(0, 99), $values); - } - - public function testDoesNotBlowStackWithRejectedPromises() - { - $pending = []; - for ($i = 0; $i < 100; $i++) { - $pending[] = new RejectedPromise($i); - } - $values = []; - $each = new EachPromise($pending, [ - 'rejected' => function ($value) use (&$values) { - $values[] = $value; - } - ]); - $called = false; - $each->promise()->then( - function () use (&$called) { $called = true; }, - function () { $this->fail('Should not have rejected.'); } - ); - $this->assertFalse($called); - P\queue()->run(); - $this->assertTrue($called); - $this->assertEquals(range(0, 99), $values); - } - - public function testReturnsPromiseForWhatever() - { - $called = []; - $arr = ['a', 'b']; - $each = new EachPromise($arr, [ - 'fulfilled' => function ($v) use (&$called) { $called[] = $v; } - ]); - $p = $each->promise(); - $this->assertNull($p->wait()); - $this->assertEquals(['a', 'b'], $called); - } - - public function testRejectsAggregateWhenNextThrows() - { - $iter = function () { - yield 'a'; - throw new \Exception('Failure'); - }; - $each = new EachPromise($iter()); - $p = $each->promise(); - $e = null; - $received = null; - $p->then(null, function ($reason) use (&$e) { $e = $reason; }); - P\queue()->run(); - $this->assertInstanceOf('Exception', $e); - $this->assertEquals('Failure', $e->getMessage()); - } - - public function testDoesNotCallNextOnIteratorUntilNeededWhenWaiting() - { - $results = []; - $values = [10]; - $remaining = 9; - $iter = function () use (&$values) { - while ($value = array_pop($values)) { - yield $value; - } - }; - $each = new EachPromise($iter(), [ - 'concurrency' => 1, - 'fulfilled' => function ($r) use (&$results, &$values, &$remaining) { - $results[] = $r; - if ($remaining > 0) { - $values[] = $remaining--; - } - } - ]); - $each->promise()->wait(); - $this->assertEquals(range(10, 1), $results); - } - - public function testDoesNotCallNextOnIteratorUntilNeededWhenAsync() - { - $firstPromise = new Promise(); - $pending = [$firstPromise]; - $values = [$firstPromise]; - $results = []; - $remaining = 9; - $iter = function () use (&$values) { - while ($value = array_pop($values)) { - yield $value; - } - }; - $each = new EachPromise($iter(), [ - 'concurrency' => 1, - 'fulfilled' => function ($r) use (&$results, &$values, &$remaining, &$pending) { - $results[] = $r; - if ($remaining-- > 0) { - $pending[] = $values[] = new Promise(); - } - } - ]); - $i = 0; - $each->promise(); - while ($promise = array_pop($pending)) { - $promise->resolve($i++); - P\queue()->run(); - } - $this->assertEquals(range(0, 9), $results); - } -} diff --git a/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php b/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php deleted file mode 100644 index 554c150..0000000 --- a/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php +++ /dev/null @@ -1,108 +0,0 @@ -assertEquals('fulfilled', $p->getState()); - $this->assertEquals('foo', $p->wait(true)); - } - - public function testCannotCancel() - { - $p = new FulfilledPromise('foo'); - $this->assertEquals('fulfilled', $p->getState()); - $p->cancel(); - $this->assertEquals('foo', $p->wait()); - } - - /** - * @expectedException \LogicException - * @exepctedExceptionMessage Cannot resolve a fulfilled promise - */ - public function testCannotResolve() - { - $p = new FulfilledPromise('foo'); - $p->resolve('bar'); - } - - /** - * @expectedException \LogicException - * @exepctedExceptionMessage Cannot reject a fulfilled promise - */ - public function testCannotReject() - { - $p = new FulfilledPromise('foo'); - $p->reject('bar'); - } - - public function testCanResolveWithSameValue() - { - $p = new FulfilledPromise('foo'); - $p->resolve('foo'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testCannotResolveWithPromise() - { - new FulfilledPromise(new Promise()); - } - - public function testReturnsSelfWhenNoOnFulfilled() - { - $p = new FulfilledPromise('a'); - $this->assertSame($p, $p->then()); - } - - public function testAsynchronouslyInvokesOnFulfilled() - { - $p = new FulfilledPromise('a'); - $r = null; - $f = function ($d) use (&$r) { $r = $d; }; - $p2 = $p->then($f); - $this->assertNotSame($p, $p2); - $this->assertNull($r); - \GuzzleHttp\Promise\queue()->run(); - $this->assertEquals('a', $r); - } - - public function testReturnsNewRejectedWhenOnFulfilledFails() - { - $p = new FulfilledPromise('a'); - $f = function () { throw new \Exception('b'); }; - $p2 = $p->then($f); - $this->assertNotSame($p, $p2); - try { - $p2->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertEquals('b', $e->getMessage()); - } - } - - public function testOtherwiseIsSugarForRejections() - { - $c = null; - $p = new FulfilledPromise('foo'); - $p->otherwise(function ($v) use (&$c) { $c = $v; }); - $this->assertNull($c); - } - - public function testDoesNotTryToFulfillTwiceDuringTrampoline() - { - $fp = new FulfilledPromise('a'); - $t1 = $fp->then(function ($v) { return $v . ' b'; }); - $t1->resolve('why!'); - $this->assertEquals('why!', $t1->wait()); - } -} diff --git a/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php b/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php deleted file mode 100644 index 6288aa8..0000000 --- a/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php +++ /dev/null @@ -1,50 +0,0 @@ -nextPromise = new Promise(); - } - - public function then(callable $res = null, callable $rej = null) - { - return $this->nextPromise->then($res, $rej); - } - - public function otherwise(callable $onRejected) - { - return $this->then($onRejected); - } - - public function resolve($value) - { - $this->nextPromise->resolve($value); - } - - public function reject($reason) - { - $this->nextPromise->reject($reason); - } - - public function wait($unwrap = true, $defaultResolution = null) - { - - } - - public function cancel() - { - - } - - public function getState() - { - return $this->nextPromise->getState(); - } -} diff --git a/vendor/guzzlehttp/promises/tests/PromiseTest.php b/vendor/guzzlehttp/promises/tests/PromiseTest.php deleted file mode 100644 index 946c627..0000000 --- a/vendor/guzzlehttp/promises/tests/PromiseTest.php +++ /dev/null @@ -1,579 +0,0 @@ -resolve('foo'); - $p->resolve('bar'); - $this->assertEquals('foo', $p->wait()); - } - - public function testCanResolveWithSameValue() - { - $p = new Promise(); - $p->resolve('foo'); - $p->resolve('foo'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot change a fulfilled promise to rejected - */ - public function testCannotRejectNonPendingPromise() - { - $p = new Promise(); - $p->resolve('foo'); - $p->reject('bar'); - $this->assertEquals('foo', $p->wait()); - } - - public function testCanRejectWithSameValue() - { - $p = new Promise(); - $p->reject('foo'); - $p->reject('foo'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot change a fulfilled promise to rejected - */ - public function testCannotRejectResolveWithSameValue() - { - $p = new Promise(); - $p->resolve('foo'); - $p->reject('foo'); - } - - public function testInvokesWaitFunction() - { - $p = new Promise(function () use (&$p) { $p->resolve('10'); }); - $this->assertEquals('10', $p->wait()); - } - - /** - * @expectedException \GuzzleHttp\Promise\RejectionException - */ - public function testRejectsAndThrowsWhenWaitFailsToResolve() - { - $p = new Promise(function () {}); - $p->wait(); - } - - /** - * @expectedException \GuzzleHttp\Promise\RejectionException - * @expectedExceptionMessage The promise was rejected with reason: foo - */ - public function testThrowsWhenUnwrapIsRejectedWithNonException() - { - $p = new Promise(function () use (&$p) { $p->reject('foo'); }); - $p->wait(); - } - - /** - * @expectedException \UnexpectedValueException - * @expectedExceptionMessage foo - */ - public function testThrowsWhenUnwrapIsRejectedWithException() - { - $e = new \UnexpectedValueException('foo'); - $p = new Promise(function () use (&$p, $e) { $p->reject($e); }); - $p->wait(); - } - - public function testDoesNotUnwrapExceptionsWhenDisabled() - { - $p = new Promise(function () use (&$p) { $p->reject('foo'); }); - $this->assertEquals('pending', $p->getState()); - $p->wait(false); - $this->assertEquals('rejected', $p->getState()); - } - - public function testRejectsSelfWhenWaitThrows() - { - $e = new \UnexpectedValueException('foo'); - $p = new Promise(function () use ($e) { throw $e; }); - try { - $p->wait(); - $this->fail(); - } catch (\UnexpectedValueException $e) { - $this->assertEquals('rejected', $p->getState()); - } - } - - public function testWaitsOnNestedPromises() - { - $p = new Promise(function () use (&$p) { $p->resolve('_'); }); - $p2 = new Promise(function () use (&$p2) { $p2->resolve('foo'); }); - $p3 = $p->then(function () use ($p2) { return $p2; }); - $this->assertSame('foo', $p3->wait()); - } - - /** - * @expectedException \GuzzleHttp\Promise\RejectionException - */ - public function testThrowsWhenWaitingOnPromiseWithNoWaitFunction() - { - $p = new Promise(); - $p->wait(); - } - - public function testThrowsWaitExceptionAfterPromiseIsResolved() - { - $p = new Promise(function () use (&$p) { - $p->reject('Foo!'); - throw new \Exception('Bar?'); - }); - - try { - $p->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertEquals('Bar?', $e->getMessage()); - } - } - - public function testGetsActualWaitValueFromThen() - { - $p = new Promise(function () use (&$p) { $p->reject('Foo!'); }); - $p2 = $p->then(null, function ($reason) { - return new RejectedPromise([$reason]); - }); - - try { - $p2->wait(); - $this->fail('Should have thrown'); - } catch (RejectionException $e) { - $this->assertEquals(['Foo!'], $e->getReason()); - } - } - - public function testWaitBehaviorIsBasedOnLastPromiseInChain() - { - $p3 = new Promise(function () use (&$p3) { $p3->resolve('Whoop'); }); - $p2 = new Promise(function () use (&$p2, $p3) { $p2->reject($p3); }); - $p = new Promise(function () use (&$p, $p2) { $p->reject($p2); }); - $this->assertEquals('Whoop', $p->wait()); - } - - public function testCannotCancelNonPending() - { - $p = new Promise(); - $p->resolve('foo'); - $p->cancel(); - $this->assertEquals('fulfilled', $p->getState()); - } - - /** - * @expectedException \GuzzleHttp\Promise\CancellationException - */ - public function testCancelsPromiseWhenNoCancelFunction() - { - $p = new Promise(); - $p->cancel(); - $this->assertEquals('rejected', $p->getState()); - $p->wait(); - } - - public function testCancelsPromiseWithCancelFunction() - { - $called = false; - $p = new Promise(null, function () use (&$called) { $called = true; }); - $p->cancel(); - $this->assertEquals('rejected', $p->getState()); - $this->assertTrue($called); - } - - public function testCancelsUppermostPendingPromise() - { - $called = false; - $p1 = new Promise(null, function () use (&$called) { $called = true; }); - $p2 = $p1->then(function () {}); - $p3 = $p2->then(function () {}); - $p4 = $p3->then(function () {}); - $p3->cancel(); - $this->assertEquals('rejected', $p1->getState()); - $this->assertEquals('rejected', $p2->getState()); - $this->assertEquals('rejected', $p3->getState()); - $this->assertEquals('pending', $p4->getState()); - $this->assertTrue($called); - - try { - $p3->wait(); - $this->fail(); - } catch (CancellationException $e) { - $this->assertContains('cancelled', $e->getMessage()); - } - - try { - $p4->wait(); - $this->fail(); - } catch (CancellationException $e) { - $this->assertContains('cancelled', $e->getMessage()); - } - - $this->assertEquals('rejected', $p4->getState()); - } - - public function testCancelsChildPromises() - { - $called1 = $called2 = $called3 = false; - $p1 = new Promise(null, function () use (&$called1) { $called1 = true; }); - $p2 = new Promise(null, function () use (&$called2) { $called2 = true; }); - $p3 = new Promise(null, function () use (&$called3) { $called3 = true; }); - $p4 = $p2->then(function () use ($p3) { return $p3; }); - $p5 = $p4->then(function () { $this->fail(); }); - $p4->cancel(); - $this->assertEquals('pending', $p1->getState()); - $this->assertEquals('rejected', $p2->getState()); - $this->assertEquals('rejected', $p4->getState()); - $this->assertEquals('pending', $p5->getState()); - $this->assertFalse($called1); - $this->assertTrue($called2); - $this->assertFalse($called3); - } - - public function testRejectsPromiseWhenCancelFails() - { - $called = false; - $p = new Promise(null, function () use (&$called) { - $called = true; - throw new \Exception('e'); - }); - $p->cancel(); - $this->assertEquals('rejected', $p->getState()); - $this->assertTrue($called); - try { - $p->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertEquals('e', $e->getMessage()); - } - } - - public function testCreatesPromiseWhenFulfilledAfterThen() - { - $p = new Promise(); - $carry = null; - $p2 = $p->then(function ($v) use (&$carry) { $carry = $v; }); - $this->assertNotSame($p, $p2); - $p->resolve('foo'); - P\queue()->run(); - - $this->assertEquals('foo', $carry); - } - - public function testCreatesPromiseWhenFulfilledBeforeThen() - { - $p = new Promise(); - $p->resolve('foo'); - $carry = null; - $p2 = $p->then(function ($v) use (&$carry) { $carry = $v; }); - $this->assertNotSame($p, $p2); - $this->assertNull($carry); - \GuzzleHttp\Promise\queue()->run(); - $this->assertEquals('foo', $carry); - } - - public function testCreatesPromiseWhenFulfilledWithNoCallback() - { - $p = new Promise(); - $p->resolve('foo'); - $p2 = $p->then(); - $this->assertNotSame($p, $p2); - $this->assertInstanceOf('GuzzleHttp\Promise\FulfilledPromise', $p2); - } - - public function testCreatesPromiseWhenRejectedAfterThen() - { - $p = new Promise(); - $carry = null; - $p2 = $p->then(null, function ($v) use (&$carry) { $carry = $v; }); - $this->assertNotSame($p, $p2); - $p->reject('foo'); - P\queue()->run(); - $this->assertEquals('foo', $carry); - } - - public function testCreatesPromiseWhenRejectedBeforeThen() - { - $p = new Promise(); - $p->reject('foo'); - $carry = null; - $p2 = $p->then(null, function ($v) use (&$carry) { $carry = $v; }); - $this->assertNotSame($p, $p2); - $this->assertNull($carry); - P\queue()->run(); - $this->assertEquals('foo', $carry); - } - - public function testCreatesPromiseWhenRejectedWithNoCallback() - { - $p = new Promise(); - $p->reject('foo'); - $p2 = $p->then(); - $this->assertNotSame($p, $p2); - $this->assertInstanceOf('GuzzleHttp\Promise\RejectedPromise', $p2); - } - - public function testInvokesWaitFnsForThens() - { - $p = new Promise(function () use (&$p) { $p->resolve('a'); }); - $p2 = $p - ->then(function ($v) { return $v . '-1-'; }) - ->then(function ($v) { return $v . '2'; }); - $this->assertEquals('a-1-2', $p2->wait()); - } - - public function testStacksThenWaitFunctions() - { - $p1 = new Promise(function () use (&$p1) { $p1->resolve('a'); }); - $p2 = new Promise(function () use (&$p2) { $p2->resolve('b'); }); - $p3 = new Promise(function () use (&$p3) { $p3->resolve('c'); }); - $p4 = $p1 - ->then(function () use ($p2) { return $p2; }) - ->then(function () use ($p3) { return $p3; }); - $this->assertEquals('c', $p4->wait()); - } - - public function testForwardsFulfilledDownChainBetweenGaps() - { - $p = new Promise(); - $r = $r2 = null; - $p->then(null, null) - ->then(function ($v) use (&$r) { $r = $v; return $v . '2'; }) - ->then(function ($v) use (&$r2) { $r2 = $v; }); - $p->resolve('foo'); - P\queue()->run(); - $this->assertEquals('foo', $r); - $this->assertEquals('foo2', $r2); - } - - public function testForwardsRejectedPromisesDownChainBetweenGaps() - { - $p = new Promise(); - $r = $r2 = null; - $p->then(null, null) - ->then(null, function ($v) use (&$r) { $r = $v; return $v . '2'; }) - ->then(function ($v) use (&$r2) { $r2 = $v; }); - $p->reject('foo'); - P\queue()->run(); - $this->assertEquals('foo', $r); - $this->assertEquals('foo2', $r2); - } - - public function testForwardsThrownPromisesDownChainBetweenGaps() - { - $e = new \Exception(); - $p = new Promise(); - $r = $r2 = null; - $p->then(null, null) - ->then(null, function ($v) use (&$r, $e) { - $r = $v; - throw $e; - }) - ->then( - null, - function ($v) use (&$r2) { $r2 = $v; } - ); - $p->reject('foo'); - P\queue()->run(); - $this->assertEquals('foo', $r); - $this->assertSame($e, $r2); - } - - public function testForwardsReturnedRejectedPromisesDownChainBetweenGaps() - { - $p = new Promise(); - $rejected = new RejectedPromise('bar'); - $r = $r2 = null; - $p->then(null, null) - ->then(null, function ($v) use (&$r, $rejected) { - $r = $v; - return $rejected; - }) - ->then( - null, - function ($v) use (&$r2) { $r2 = $v; } - ); - $p->reject('foo'); - P\queue()->run(); - $this->assertEquals('foo', $r); - $this->assertEquals('bar', $r2); - try { - $p->wait(); - } catch (RejectionException $e) { - $this->assertEquals('foo', $e->getReason()); - } - } - - public function testForwardsHandlersToNextPromise() - { - $p = new Promise(); - $p2 = new Promise(); - $resolved = null; - $p - ->then(function ($v) use ($p2) { return $p2; }) - ->then(function ($value) use (&$resolved) { $resolved = $value; }); - $p->resolve('a'); - $p2->resolve('b'); - P\queue()->run(); - $this->assertEquals('b', $resolved); - } - - public function testRemovesReferenceFromChildWhenParentWaitedUpon() - { - $r = null; - $p = new Promise(function () use (&$p) { $p->resolve('a'); }); - $p2 = new Promise(function () use (&$p2) { $p2->resolve('b'); }); - $pb = $p->then( - function ($v) use ($p2, &$r) { - $r = $v; - return $p2; - }) - ->then(function ($v) { return $v . '.'; }); - $this->assertEquals('a', $p->wait()); - $this->assertEquals('b', $p2->wait()); - $this->assertEquals('b.', $pb->wait()); - $this->assertEquals('a', $r); - } - - public function testForwardsHandlersWhenFulfilledPromiseIsReturned() - { - $res = []; - $p = new Promise(); - $p2 = new Promise(); - $p2->resolve('foo'); - $p2->then(function ($v) use (&$res) { $res[] = 'A:' . $v; }); - // $res is A:foo - $p - ->then(function () use ($p2, &$res) { $res[] = 'B'; return $p2; }) - ->then(function ($v) use (&$res) { $res[] = 'C:' . $v; }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { $res[] = 'D:' . $v; }); - P\queue()->run(); - $this->assertEquals(['A:foo', 'B', 'D:a', 'C:foo'], $res); - } - - public function testForwardsHandlersWhenRejectedPromiseIsReturned() - { - $res = []; - $p = new Promise(); - $p2 = new Promise(); - $p2->reject('foo'); - $p2->then(null, function ($v) use (&$res) { $res[] = 'A:' . $v; }); - $p->then(null, function () use ($p2, &$res) { $res[] = 'B'; return $p2; }) - ->then(null, function ($v) use (&$res) { $res[] = 'C:' . $v; }); - $p->reject('a'); - $p->then(null, function ($v) use (&$res) { $res[] = 'D:' . $v; }); - P\queue()->run(); - $this->assertEquals(['A:foo', 'B', 'D:a', 'C:foo'], $res); - } - - public function testDoesNotForwardRejectedPromise() - { - $res = []; - $p = new Promise(); - $p2 = new Promise(); - $p2->cancel(); - $p2->then(function ($v) use (&$res) { $res[] = "B:$v"; return $v; }); - $p->then(function ($v) use ($p2, &$res) { $res[] = "B:$v"; return $p2; }) - ->then(function ($v) use (&$res) { $res[] = 'C:' . $v; }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { $res[] = 'D:' . $v; }); - P\queue()->run(); - $this->assertEquals(['B:a', 'D:a'], $res); - } - - public function testRecursivelyForwardsWhenOnlyThennable() - { - $res = []; - $p = new Promise(); - $p2 = new Thennable(); - $p2->resolve('foo'); - $p2->then(function ($v) use (&$res) { $res[] = 'A:' . $v; }); - $p->then(function () use ($p2, &$res) { $res[] = 'B'; return $p2; }) - ->then(function ($v) use (&$res) { $res[] = 'C:' . $v; }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { $res[] = 'D:' . $v; }); - P\queue()->run(); - $this->assertEquals(['A:foo', 'B', 'D:a', 'C:foo'], $res); - } - - public function testRecursivelyForwardsWhenNotInstanceOfPromise() - { - $res = []; - $p = new Promise(); - $p2 = new NotPromiseInstance(); - $p2->then(function ($v) use (&$res) { $res[] = 'A:' . $v; }); - $p->then(function () use ($p2, &$res) { $res[] = 'B'; return $p2; }) - ->then(function ($v) use (&$res) { $res[] = 'C:' . $v; }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { $res[] = 'D:' . $v; }); - P\queue()->run(); - $this->assertEquals(['B', 'D:a'], $res); - $p2->resolve('foo'); - P\queue()->run(); - $this->assertEquals(['B', 'D:a', 'A:foo', 'C:foo'], $res); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot fulfill or reject a promise with itself - */ - public function testCannotResolveWithSelf() - { - $p = new Promise(); - $p->resolve($p); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot fulfill or reject a promise with itself - */ - public function testCannotRejectWithSelf() - { - $p = new Promise(); - $p->reject($p); - } - - public function testDoesNotBlowStackWhenWaitingOnNestedThens() - { - $inner = new Promise(function () use (&$inner) { $inner->resolve(0); }); - $prev = $inner; - for ($i = 1; $i < 100; $i++) { - $prev = $prev->then(function ($i) { return $i + 1; }); - } - - $parent = new Promise(function () use (&$parent, $prev) { - $parent->resolve($prev); - }); - - $this->assertEquals(99, $parent->wait()); - } - - public function testOtherwiseIsSugarForRejections() - { - $p = new Promise(); - $p->reject('foo'); - $p->otherwise(function ($v) use (&$c) { $c = $v; }); - P\queue()->run(); - $this->assertEquals($c, 'foo'); - } -} diff --git a/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php b/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php deleted file mode 100644 index 60f926e..0000000 --- a/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php +++ /dev/null @@ -1,143 +0,0 @@ -assertEquals('rejected', $p->getState()); - try { - $p->wait(true); - $this->fail(); - } catch (\Exception $e) { - $this->assertEquals('rejected', $p->getState()); - $this->assertContains('foo', $e->getMessage()); - } - } - - public function testCannotCancel() - { - $p = new RejectedPromise('foo'); - $p->cancel(); - $this->assertEquals('rejected', $p->getState()); - } - - /** - * @expectedException \LogicException - * @exepctedExceptionMessage Cannot resolve a rejected promise - */ - public function testCannotResolve() - { - $p = new RejectedPromise('foo'); - $p->resolve('bar'); - } - - /** - * @expectedException \LogicException - * @exepctedExceptionMessage Cannot reject a rejected promise - */ - public function testCannotReject() - { - $p = new RejectedPromise('foo'); - $p->reject('bar'); - } - - public function testCanRejectWithSameValue() - { - $p = new RejectedPromise('foo'); - $p->reject('foo'); - } - - public function testThrowsSpecificException() - { - $e = new \Exception(); - $p = new RejectedPromise($e); - try { - $p->wait(true); - $this->fail(); - } catch (\Exception $e2) { - $this->assertSame($e, $e2); - } - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testCannotResolveWithPromise() - { - new RejectedPromise(new Promise()); - } - - public function testReturnsSelfWhenNoOnReject() - { - $p = new RejectedPromise('a'); - $this->assertSame($p, $p->then()); - } - - public function testInvokesOnRejectedAsynchronously() - { - $p = new RejectedPromise('a'); - $r = null; - $f = function ($reason) use (&$r) { $r = $reason; }; - $p->then(null, $f); - $this->assertNull($r); - \GuzzleHttp\Promise\queue()->run(); - $this->assertEquals('a', $r); - } - - public function testReturnsNewRejectedWhenOnRejectedFails() - { - $p = new RejectedPromise('a'); - $f = function () { throw new \Exception('b'); }; - $p2 = $p->then(null, $f); - $this->assertNotSame($p, $p2); - try { - $p2->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertEquals('b', $e->getMessage()); - } - } - - public function testWaitingIsNoOp() - { - $p = new RejectedPromise('a'); - $p->wait(false); - } - - public function testOtherwiseIsSugarForRejections() - { - $p = new RejectedPromise('foo'); - $p->otherwise(function ($v) use (&$c) { $c = $v; }); - \GuzzleHttp\Promise\queue()->run(); - $this->assertSame('foo', $c); - } - - public function testCanResolveThenWithSuccess() - { - $actual = null; - $p = new RejectedPromise('foo'); - $p->otherwise(function ($v) { - return $v . ' bar'; - })->then(function ($v) use (&$actual) { - $actual = $v; - }); - \GuzzleHttp\Promise\queue()->run(); - $this->assertEquals('foo bar', $actual); - } - - public function testDoesNotTryToRejectTwiceDuringTrampoline() - { - $fp = new RejectedPromise('a'); - $t1 = $fp->then(null, function ($v) { return $v . ' b'; }); - $t1->resolve('why!'); - $this->assertEquals('why!', $t1->wait()); - } -} diff --git a/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php b/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php deleted file mode 100644 index 36c6a88..0000000 --- a/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php +++ /dev/null @@ -1,47 +0,0 @@ -message = $message; - } - - public function __toString() - { - return $this->message; - } -} - -class Thing2 implements \JsonSerializable -{ - public function jsonSerialize() - { - return '{}'; - } -} - -/** - * @covers GuzzleHttp\Promise\RejectionException - */ -class RejectionExceptionTest extends \PHPUnit_Framework_TestCase -{ - public function testCanGetReasonFromException() - { - $thing = new Thing1('foo'); - $e = new RejectionException($thing); - - $this->assertSame($thing, $e->getReason()); - $this->assertEquals('The promise was rejected with reason: foo', $e->getMessage()); - } - - public function testCanGetReasonMessageFromJson() - { - $reason = new Thing2(); - $e = new RejectionException($reason); - $this->assertContains("{}", $e->getMessage()); - } -} diff --git a/vendor/guzzlehttp/promises/tests/TaskQueueTest.php b/vendor/guzzlehttp/promises/tests/TaskQueueTest.php deleted file mode 100644 index 845b263..0000000 --- a/vendor/guzzlehttp/promises/tests/TaskQueueTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertTrue($tq->isEmpty()); - } - - public function testKnowsIfFull() - { - $tq = new TaskQueue(false); - $tq->add(function () {}); - $this->assertFalse($tq->isEmpty()); - } - - public function testExecutesTasksInOrder() - { - $tq = new TaskQueue(false); - $called = []; - $tq->add(function () use (&$called) { $called[] = 'a'; }); - $tq->add(function () use (&$called) { $called[] = 'b'; }); - $tq->add(function () use (&$called) { $called[] = 'c'; }); - $tq->run(); - $this->assertEquals(['a', 'b', 'c'], $called); - } -} diff --git a/vendor/guzzlehttp/promises/tests/Thennable.php b/vendor/guzzlehttp/promises/tests/Thennable.php deleted file mode 100644 index 398954d..0000000 --- a/vendor/guzzlehttp/promises/tests/Thennable.php +++ /dev/null @@ -1,24 +0,0 @@ -nextPromise = new Promise(); - } - - public function then(callable $res = null, callable $rej = null) - { - return $this->nextPromise->then($res, $rej); - } - - public function resolve($value) - { - $this->nextPromise->resolve($value); - } -} diff --git a/vendor/guzzlehttp/promises/tests/bootstrap.php b/vendor/guzzlehttp/promises/tests/bootstrap.php deleted file mode 100644 index a63d264..0000000 --- a/vendor/guzzlehttp/promises/tests/bootstrap.php +++ /dev/null @@ -1,4 +0,0 @@ -assertInstanceOf('GuzzleHttp\Promise\FulfilledPromise', $p); - } - - public function testReturnsPromiseForPromise() - { - $p = new Promise(); - $this->assertSame($p, \GuzzleHttp\Promise\promise_for($p)); - } - - public function testReturnsPromiseForThennable() - { - $p = new Thennable(); - $wrapped = \GuzzleHttp\Promise\promise_for($p); - $this->assertNotSame($p, $wrapped); - $this->assertInstanceOf('GuzzleHttp\Promise\PromiseInterface', $wrapped); - $p->resolve('foo'); - P\queue()->run(); - $this->assertEquals('foo', $wrapped->wait()); - } - - public function testReturnsRejection() - { - $p = \GuzzleHttp\Promise\rejection_for('fail'); - $this->assertInstanceOf('GuzzleHttp\Promise\RejectedPromise', $p); - $this->assertEquals('fail', $this->readAttribute($p, 'reason')); - } - - public function testReturnsPromisesAsIsInRejectionFor() - { - $a = new Promise(); - $b = \GuzzleHttp\Promise\rejection_for($a); - $this->assertSame($a, $b); - } - - public function testWaitsOnAllPromisesIntoArray() - { - $e = new \Exception(); - $a = new Promise(function () use (&$a) { $a->resolve('a'); }); - $b = new Promise(function () use (&$b) { $b->reject('b'); }); - $c = new Promise(function () use (&$c, $e) { $c->reject($e); }); - $results = \GuzzleHttp\Promise\inspect_all([$a, $b, $c]); - $this->assertEquals([ - ['state' => 'fulfilled', 'value' => 'a'], - ['state' => 'rejected', 'reason' => 'b'], - ['state' => 'rejected', 'reason' => $e] - ], $results); - } - - /** - * @expectedException \GuzzleHttp\Promise\RejectionException - */ - public function testUnwrapsPromisesWithNoDefaultAndFailure() - { - $promises = [new FulfilledPromise('a'), new Promise()]; - \GuzzleHttp\Promise\unwrap($promises); - } - - public function testUnwrapsPromisesWithNoDefault() - { - $promises = [new FulfilledPromise('a')]; - $this->assertEquals(['a'], \GuzzleHttp\Promise\unwrap($promises)); - } - - public function testUnwrapsPromisesWithKeys() - { - $promises = [ - 'foo' => new FulfilledPromise('a'), - 'bar' => new FulfilledPromise('b'), - ]; - $this->assertEquals([ - 'foo' => 'a', - 'bar' => 'b' - ], \GuzzleHttp\Promise\unwrap($promises)); - } - - public function testAllAggregatesSortedArray() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = \GuzzleHttp\Promise\all([$a, $b, $c]); - $b->resolve('b'); - $a->resolve('a'); - $c->resolve('c'); - $d->then( - function ($value) use (&$result) { $result = $value; }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\queue()->run(); - $this->assertEquals(['a', 'b', 'c'], $result); - } - - public function testAllThrowsWhenAnyRejected() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = \GuzzleHttp\Promise\all([$a, $b, $c]); - $b->resolve('b'); - $a->reject('fail'); - $c->resolve('c'); - $d->then( - function ($value) use (&$result) { $result = $value; }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\queue()->run(); - $this->assertEquals('fail', $result); - } - - public function testSomeAggregatesSortedArrayWithMax() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = \GuzzleHttp\Promise\some(2, [$a, $b, $c]); - $b->resolve('b'); - $c->resolve('c'); - $a->resolve('a'); - $d->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals(['b', 'c'], $result); - } - - public function testSomeRejectsWhenTooManyRejections() - { - $a = new Promise(); - $b = new Promise(); - $d = \GuzzleHttp\Promise\some(2, [$a, $b]); - $a->reject('bad'); - $b->resolve('good'); - P\queue()->run(); - $this->assertEquals($a::REJECTED, $d->getState()); - $d->then(null, function ($reason) use (&$called) { - $called = $reason; - }); - P\queue()->run(); - $this->assertInstanceOf('GuzzleHttp\Promise\AggregateException', $called); - $this->assertContains('bad', $called->getReason()); - } - - public function testCanWaitUntilSomeCountIsSatisfied() - { - $a = new Promise(function () use (&$a) { $a->resolve('a'); }); - $b = new Promise(function () use (&$b) { $b->resolve('b'); }); - $c = new Promise(function () use (&$c) { $c->resolve('c'); }); - $d = \GuzzleHttp\Promise\some(2, [$a, $b, $c]); - $this->assertEquals(['a', 'b'], $d->wait()); - } - - /** - * @expectedException \GuzzleHttp\Promise\AggregateException - * @expectedExceptionMessage Not enough promises to fulfill count - */ - public function testThrowsIfImpossibleToWaitForSomeCount() - { - $a = new Promise(function () use (&$a) { $a->resolve('a'); }); - $d = \GuzzleHttp\Promise\some(2, [$a]); - $d->wait(); - } - - /** - * @expectedException \GuzzleHttp\Promise\AggregateException - * @expectedExceptionMessage Not enough promises to fulfill count - */ - public function testThrowsIfResolvedWithoutCountTotalResults() - { - $a = new Promise(); - $b = new Promise(); - $d = \GuzzleHttp\Promise\some(3, [$a, $b]); - $a->resolve('a'); - $b->resolve('b'); - $d->wait(); - } - - public function testAnyReturnsFirstMatch() - { - $a = new Promise(); - $b = new Promise(); - $c = \GuzzleHttp\Promise\any([$a, $b]); - $b->resolve('b'); - $a->resolve('a'); - //P\queue()->run(); - //$this->assertEquals('fulfilled', $c->getState()); - $c->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals('b', $result); - } - - public function testSettleFulfillsWithFulfilledAndRejected() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = \GuzzleHttp\Promise\settle([$a, $b, $c]); - $b->resolve('b'); - $c->resolve('c'); - $a->reject('a'); - P\queue()->run(); - $this->assertEquals('fulfilled', $d->getState()); - $d->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals([ - ['state' => 'rejected', 'reason' => 'a'], - ['state' => 'fulfilled', 'value' => 'b'], - ['state' => 'fulfilled', 'value' => 'c'] - ], $result); - } - - public function testCanInspectFulfilledPromise() - { - $p = new FulfilledPromise('foo'); - $this->assertEquals([ - 'state' => 'fulfilled', - 'value' => 'foo' - ], \GuzzleHttp\Promise\inspect($p)); - } - - public function testCanInspectRejectedPromise() - { - $p = new RejectedPromise('foo'); - $this->assertEquals([ - 'state' => 'rejected', - 'reason' => 'foo' - ], \GuzzleHttp\Promise\inspect($p)); - } - - public function testCanInspectRejectedPromiseWithNormalException() - { - $e = new \Exception('foo'); - $p = new RejectedPromise($e); - $this->assertEquals([ - 'state' => 'rejected', - 'reason' => $e - ], \GuzzleHttp\Promise\inspect($p)); - } - - public function testCallsEachLimit() - { - $p = new Promise(); - $aggregate = \GuzzleHttp\Promise\each_limit($p, 2); - $p->resolve('a'); - P\queue()->run(); - $this->assertEquals($p::FULFILLED, $aggregate->getState()); - } - - public function testEachLimitAllRejectsOnFailure() - { - $p = [new FulfilledPromise('a'), new RejectedPromise('b')]; - $aggregate = \GuzzleHttp\Promise\each_limit_all($p, 2); - P\queue()->run(); - $this->assertEquals(P\PromiseInterface::REJECTED, $aggregate->getState()); - $result = \GuzzleHttp\Promise\inspect($aggregate); - $this->assertEquals('b', $result['reason']); - } - - public function testIterForReturnsIterator() - { - $iter = new \ArrayIterator(); - $this->assertSame($iter, \GuzzleHttp\Promise\iter_for($iter)); - } - - public function testKnowsIfFulfilled() - { - $p = new FulfilledPromise(null); - $this->assertTrue(P\is_fulfilled($p)); - $this->assertFalse(P\is_rejected($p)); - } - - public function testKnowsIfRejected() - { - $p = new RejectedPromise(null); - $this->assertTrue(P\is_rejected($p)); - $this->assertFalse(P\is_fulfilled($p)); - } - - public function testKnowsIfSettled() - { - $p = new RejectedPromise(null); - $this->assertTrue(P\is_settled($p)); - $p = new Promise(); - $this->assertFalse(P\is_settled($p)); - } - - public function testReturnsTrampoline() - { - $this->assertInstanceOf('GuzzleHttp\Promise\TaskQueue', P\queue()); - $this->assertSame(P\queue(), P\queue()); - } - - public function testCanScheduleThunk() - { - $tramp = P\queue(); - $promise = P\task(function () { return 'Hi!'; }); - $c = null; - $promise->then(function ($v) use (&$c) { $c = $v; }); - $this->assertNull($c); - $tramp->run(); - $this->assertEquals('Hi!', $c); - } - - public function testCanScheduleThunkWithRejection() - { - $tramp = P\queue(); - $promise = P\task(function () { throw new \Exception('Hi!'); }); - $c = null; - $promise->otherwise(function ($v) use (&$c) { $c = $v; }); - $this->assertNull($c); - $tramp->run(); - $this->assertEquals('Hi!', $c->getMessage()); - } - - public function testCanScheduleThunkWithWait() - { - $tramp = P\queue(); - $promise = P\task(function () { return 'a'; }); - $this->assertEquals('a', $promise->wait()); - $tramp->run(); - } - - public function testYieldsFromCoroutine() - { - $promise = P\coroutine(function () { - $value = (yield new P\FulfilledPromise('a')); - yield $value . 'b'; - }); - $promise->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals('ab', $result); - } - - public function testCanCatchExceptionsInCoroutine() - { - $promise = P\coroutine(function () { - try { - yield new P\RejectedPromise('a'); - $this->fail('Should have thrown into the coroutine!'); - } catch (P\RejectionException $e) { - $value = (yield new P\FulfilledPromise($e->getReason())); - yield $value . 'b'; - } - }); - $promise->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals(P\PromiseInterface::FULFILLED, $promise->getState()); - $this->assertEquals('ab', $result); - } - - public function testRejectsParentExceptionWhenException() - { - $promise = P\coroutine(function () { - yield new P\FulfilledPromise(0); - throw new \Exception('a'); - }); - $promise->then( - function () { $this->fail(); }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\queue()->run(); - $this->assertInstanceOf('Exception', $result); - $this->assertEquals('a', $result->getMessage()); - } - - public function testCanRejectFromRejectionCallback() - { - $promise = P\coroutine(function () { - yield new P\FulfilledPromise(0); - yield new P\RejectedPromise('no!'); - }); - $promise->then( - function () { $this->fail(); }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\queue()->run(); - $this->assertInstanceOf('GuzzleHttp\Promise\RejectionException', $result); - $this->assertEquals('no!', $result->getReason()); - } - - public function testCanAsyncReject() - { - $rej = new P\Promise(); - $promise = P\coroutine(function () use ($rej) { - yield new P\FulfilledPromise(0); - yield $rej; - }); - $promise->then( - function () { $this->fail(); }, - function ($reason) use (&$result) { $result = $reason; } - ); - $rej->reject('no!'); - P\queue()->run(); - $this->assertInstanceOf('GuzzleHttp\Promise\RejectionException', $result); - $this->assertEquals('no!', $result->getReason()); - } - - public function testCanCatchAndThrowOtherException() - { - $promise = P\coroutine(function () { - try { - yield new P\RejectedPromise('a'); - $this->fail('Should have thrown into the coroutine!'); - } catch (P\RejectionException $e) { - throw new \Exception('foo'); - } - }); - $promise->otherwise(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals(P\PromiseInterface::REJECTED, $promise->getState()); - $this->assertContains('foo', $result->getMessage()); - } - - public function testCanCatchAndYieldOtherException() - { - $promise = P\coroutine(function () { - try { - yield new P\RejectedPromise('a'); - $this->fail('Should have thrown into the coroutine!'); - } catch (P\RejectionException $e) { - yield new P\RejectedPromise('foo'); - } - }); - $promise->otherwise(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals(P\PromiseInterface::REJECTED, $promise->getState()); - $this->assertContains('foo', $result->getMessage()); - } - - public function createLotsOfSynchronousPromise() - { - return P\coroutine(function () { - $value = 0; - for ($i = 0; $i < 1000; $i++) { - $value = (yield new P\FulfilledPromise($i)); - } - yield $value; - }); - } - - public function testLotsOfSynchronousDoesNotBlowStack() - { - $promise = $this->createLotsOfSynchronousPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - P\queue()->run(); - $this->assertEquals(999, $r); - } - - public function testLotsOfSynchronousWaitDoesNotBlowStack() - { - $promise = $this->createLotsOfSynchronousPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - $this->assertEquals(999, $promise->wait()); - $this->assertEquals(999, $r); - } - - private function createLotsOfFlappingPromise() - { - return P\coroutine(function () { - $value = 0; - for ($i = 0; $i < 1000; $i++) { - try { - if ($i % 2) { - $value = (yield new P\FulfilledPromise($i)); - } else { - $value = (yield new P\RejectedPromise($i)); - } - } catch (\Exception $e) { - $value = (yield new P\FulfilledPromise($i)); - } - } - yield $value; - }); - } - - public function testLotsOfTryCatchingDoesNotBlowStack() - { - $promise = $this->createLotsOfFlappingPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - P\queue()->run(); - $this->assertEquals(999, $r); - } - - public function testLotsOfTryCatchingWaitingDoesNotBlowStack() - { - $promise = $this->createLotsOfFlappingPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - $this->assertEquals(999, $promise->wait()); - $this->assertEquals(999, $r); - } - - public function testAsyncPromisesWithCorrectlyYieldedValues() - { - $promises = [ - new P\Promise(), - new P\Promise(), - new P\Promise() - ]; - - $promise = P\coroutine(function () use ($promises) { - $value = null; - $this->assertEquals('skip', (yield new P\FulfilledPromise('skip'))); - foreach ($promises as $idx => $p) { - $value = (yield $p); - $this->assertEquals($value, $idx); - $this->assertEquals('skip', (yield new P\FulfilledPromise('skip'))); - } - $this->assertEquals('skip', (yield new P\FulfilledPromise('skip'))); - yield $value; - }); - - $promises[0]->resolve(0); - $promises[1]->resolve(1); - $promises[2]->resolve(2); - - $promise->then(function ($v) use (&$r) { $r = $v; }); - P\queue()->run(); - $this->assertEquals(2, $r); - } - - public function testYieldFinalWaitablePromise() - { - $p1 = new P\Promise(function () use (&$p1) { - $p1->resolve('skip me'); - }); - $p2 = new P\Promise(function () use (&$p2) { - $p2->resolve('hello!'); - }); - $co = P\coroutine(function() use ($p1, $p2) { - yield $p1; - yield $p2; - }); - P\queue()->run(); - $this->assertEquals('hello!', $co->wait()); - } - - public function testCanYieldFinalPendingPromise() - { - $p1 = new P\Promise(); - $p2 = new P\Promise(); - $co = P\coroutine(function() use ($p1, $p2) { - yield $p1; - yield $p2; - }); - $p1->resolve('a'); - $p2->resolve('b'); - $co->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals('b', $result); - } - - public function testCanNestYieldsAndFailures() - { - $p1 = new P\Promise(); - $p2 = new P\Promise(); - $p3 = new P\Promise(); - $p4 = new P\Promise(); - $p5 = new P\Promise(); - $co = P\coroutine(function() use ($p1, $p2, $p3, $p4, $p5) { - try { - yield $p1; - } catch (\Exception $e) { - yield $p2; - try { - yield $p3; - yield $p4; - } catch (\Exception $e) { - yield $p5; - } - } - }); - $p1->reject('a'); - $p2->resolve('b'); - $p3->resolve('c'); - $p4->reject('d'); - $p5->resolve('e'); - $co->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals('e', $result); - } - - public function testCanYieldErrorsAndSuccessesWithoutRecursion() - { - $promises = []; - for ($i = 0; $i < 20; $i++) { - $promises[] = new P\Promise(); - } - - $co = P\coroutine(function() use ($promises) { - for ($i = 0; $i < 20; $i += 4) { - try { - yield $promises[$i]; - yield $promises[$i + 1]; - } catch (\Exception $e) { - yield $promises[$i + 2]; - yield $promises[$i + 3]; - } - } - }); - - for ($i = 0; $i < 20; $i += 4) { - $promises[$i]->resolve($i); - $promises[$i + 1]->reject($i + 1); - $promises[$i + 2]->resolve($i + 2); - $promises[$i + 3]->resolve($i + 3); - } - - $co->then(function ($value) use (&$result) { $result = $value; }); - P\queue()->run(); - $this->assertEquals('19', $result); - } - - public function testCanWaitOnPromiseAfterFulfilled() - { - $f = function () { - static $i = 0; - $i++; - return $p = new P\Promise(function () use (&$p, $i) { - $p->resolve($i . '-bar'); - }); - }; - - $promises = []; - for ($i = 0; $i < 20; $i++) { - $promises[] = $f(); - } - - $p = P\coroutine(function () use ($promises) { - yield new P\FulfilledPromise('foo!'); - foreach ($promises as $promise) { - yield $promise; - } - }); - - $this->assertEquals('20-bar', $p->wait()); - } - - public function testCanWaitOnErroredPromises() - { - $p1 = new P\Promise(function () use (&$p1) { $p1->reject('a'); }); - $p2 = new P\Promise(function () use (&$p2) { $p2->resolve('b'); }); - $p3 = new P\Promise(function () use (&$p3) { $p3->resolve('c'); }); - $p4 = new P\Promise(function () use (&$p4) { $p4->reject('d'); }); - $p5 = new P\Promise(function () use (&$p5) { $p5->resolve('e'); }); - $p6 = new P\Promise(function () use (&$p6) { $p6->reject('f'); }); - - $co = P\coroutine(function() use ($p1, $p2, $p3, $p4, $p5, $p6) { - try { - yield $p1; - } catch (\Exception $e) { - yield $p2; - try { - yield $p3; - yield $p4; - } catch (\Exception $e) { - yield $p5; - yield $p6; - } - } - }); - - $res = P\inspect($co); - $this->assertEquals('f', $res['reason']); - } - - public function testCoroutineOtherwiseIntegrationTest() - { - $a = new P\Promise(); - $b = new P\Promise(); - $promise = P\coroutine(function () use ($a, $b) { - // Execute the pool of commands concurrently, and process errors. - yield $a; - yield $b; - })->otherwise(function (\Exception $e) { - // Throw errors from the operations as a specific Multipart error. - throw new \OutOfBoundsException('a', 0, $e); - }); - $a->resolve('a'); - $b->reject('b'); - $reason = P\inspect($promise)['reason']; - $this->assertInstanceOf('OutOfBoundsException', $reason); - $this->assertInstanceOf('GuzzleHttp\Promise\RejectionException', $reason->getPrevious()); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php b/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php deleted file mode 100644 index 3c197dc..0000000 --- a/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php +++ /dev/null @@ -1,186 +0,0 @@ -getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $a->addStream($s); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage The AppendStream can only seek with SEEK_SET - */ - public function testValidatesSeekType() - { - $a = new AppendStream(); - $a->seek(100, SEEK_CUR); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to seek stream 0 of the AppendStream - */ - public function testTriesToRewindOnSeek() - { - $a = new AppendStream(); - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'rewind', 'isSeekable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('rewind') - ->will($this->throwException(new \RuntimeException())); - $a->addStream($s); - $a->seek(10); - } - - public function testSeeksToPositionByReading() - { - $a = new AppendStream([ - Psr7\stream_for('foo'), - Psr7\stream_for('bar'), - Psr7\stream_for('baz'), - ]); - - $a->seek(3); - $this->assertEquals(3, $a->tell()); - $this->assertEquals('bar', $a->read(3)); - - $a->seek(6); - $this->assertEquals(6, $a->tell()); - $this->assertEquals('baz', $a->read(3)); - } - - public function testDetachesEachStream() - { - $s1 = Psr7\stream_for('foo'); - $s2 = Psr7\stream_for('bar'); - $a = new AppendStream([$s1, $s2]); - $this->assertSame('foobar', (string) $a); - $a->detach(); - $this->assertSame('', (string) $a); - $this->assertSame(0, $a->getSize()); - } - - public function testClosesEachStream() - { - $s1 = Psr7\stream_for('foo'); - $a = new AppendStream([$s1]); - $a->close(); - $this->assertSame('', (string) $a); - } - - /** - * @expectedExceptionMessage Cannot write to an AppendStream - * @expectedException \RuntimeException - */ - public function testIsNotWritable() - { - $a = new AppendStream([Psr7\stream_for('foo')]); - $this->assertFalse($a->isWritable()); - $this->assertTrue($a->isSeekable()); - $this->assertTrue($a->isReadable()); - $a->write('foo'); - } - - public function testDoesNotNeedStreams() - { - $a = new AppendStream(); - $this->assertEquals('', (string) $a); - } - - public function testCanReadFromMultipleStreams() - { - $a = new AppendStream([ - Psr7\stream_for('foo'), - Psr7\stream_for('bar'), - Psr7\stream_for('baz'), - ]); - $this->assertFalse($a->eof()); - $this->assertSame(0, $a->tell()); - $this->assertEquals('foo', $a->read(3)); - $this->assertEquals('bar', $a->read(3)); - $this->assertEquals('baz', $a->read(3)); - $this->assertSame('', $a->read(1)); - $this->assertTrue($a->eof()); - $this->assertSame(9, $a->tell()); - $this->assertEquals('foobarbaz', (string) $a); - } - - public function testCanDetermineSizeFromMultipleStreams() - { - $a = new AppendStream([ - Psr7\stream_for('foo'), - Psr7\stream_for('bar') - ]); - $this->assertEquals(6, $a->getSize()); - - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(null)); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $a->addStream($s); - $this->assertNull($a->getSize()); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'read', 'isReadable', 'eof']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('read') - ->will($this->throwException(new \RuntimeException('foo'))); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $s->expects($this->any()) - ->method('eof') - ->will($this->returnValue(false)); - $a = new AppendStream([$s]); - $this->assertFalse($a->eof()); - $this->assertSame('', (string) $a); - } - - public function testCanDetach() - { - $s = new AppendStream(); - $s->detach(); - } - - public function testReturnsEmptyMetadata() - { - $s = new AppendStream(); - $this->assertEquals([], $s->getMetadata()); - $this->assertNull($s->getMetadata('foo')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php b/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php deleted file mode 100644 index 0a635d4..0000000 --- a/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php +++ /dev/null @@ -1,63 +0,0 @@ -assertTrue($b->isReadable()); - $this->assertTrue($b->isWritable()); - $this->assertFalse($b->isSeekable()); - $this->assertEquals(null, $b->getMetadata('foo')); - $this->assertEquals(10, $b->getMetadata('hwm')); - $this->assertEquals([], $b->getMetadata()); - } - - public function testRemovesReadDataFromBuffer() - { - $b = new BufferStream(); - $this->assertEquals(3, $b->write('foo')); - $this->assertEquals(3, $b->getSize()); - $this->assertFalse($b->eof()); - $this->assertEquals('foo', $b->read(10)); - $this->assertTrue($b->eof()); - $this->assertEquals('', $b->read(10)); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot determine the position of a BufferStream - */ - public function testCanCastToStringOrGetContents() - { - $b = new BufferStream(); - $b->write('foo'); - $b->write('baz'); - $this->assertEquals('foo', $b->read(3)); - $b->write('bar'); - $this->assertEquals('bazbar', (string) $b); - $b->tell(); - } - - public function testDetachClearsBuffer() - { - $b = new BufferStream(); - $b->write('foo'); - $b->detach(); - $this->assertTrue($b->eof()); - $this->assertEquals(3, $b->write('abc')); - $this->assertEquals('abc', $b->read(10)); - } - - public function testExceedingHighwaterMarkReturnsFalseButStillBuffers() - { - $b = new BufferStream(5); - $this->assertEquals(3, $b->write('hi ')); - $this->assertFalse($b->write('hello')); - $this->assertEquals('hi hello', (string) $b); - $this->assertEquals(4, $b->write('test')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php b/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php deleted file mode 100644 index f82c3a5..0000000 --- a/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php +++ /dev/null @@ -1,166 +0,0 @@ -decorated = Psr7\stream_for('testing'); - $this->body = new CachingStream($this->decorated); - } - - public function tearDown() - { - $this->decorated->close(); - $this->body->close(); - } - - public function testUsesRemoteSizeIfPossible() - { - $body = Psr7\stream_for('test'); - $caching = new CachingStream($body); - $this->assertEquals(4, $caching->getSize()); - } - - public function testReadsUntilCachedToByte() - { - $this->body->seek(5); - $this->assertEquals('n', $this->body->read(1)); - $this->body->seek(0); - $this->assertEquals('t', $this->body->read(1)); - } - - public function testCanSeekNearEndWithSeekEnd() - { - $baseStream = Psr7\stream_for(implode('', range('a', 'z'))); - $cached = new CachingStream($baseStream); - $cached->seek(1, SEEK_END); - $this->assertEquals(24, $baseStream->tell()); - $this->assertEquals('y', $cached->read(1)); - $this->assertEquals(26, $cached->getSize()); - } - - public function testCanSeekToEndWithSeekEnd() - { - $baseStream = Psr7\stream_for(implode('', range('a', 'z'))); - $cached = new CachingStream($baseStream); - $cached->seek(0, SEEK_END); - $this->assertEquals(25, $baseStream->tell()); - $this->assertEquals('z', $cached->read(1)); - $this->assertEquals(26, $cached->getSize()); - } - - public function testCanUseSeekEndWithUnknownSize() - { - $baseStream = Psr7\stream_for('testing'); - $decorated = Psr7\FnStream::decorate($baseStream, [ - 'getSize' => function () { return null; } - ]); - $cached = new CachingStream($decorated); - $cached->seek(1, SEEK_END); - $this->assertEquals('ng', $cached->read(2)); - } - - public function testRewindUsesSeek() - { - $a = Psr7\stream_for('foo'); - $d = $this->getMockBuilder('GuzzleHttp\Psr7\CachingStream') - ->setMethods(array('seek')) - ->setConstructorArgs(array($a)) - ->getMock(); - $d->expects($this->once()) - ->method('seek') - ->with(0) - ->will($this->returnValue(true)); - $d->seek(0); - } - - public function testCanSeekToReadBytes() - { - $this->assertEquals('te', $this->body->read(2)); - $this->body->seek(0); - $this->assertEquals('test', $this->body->read(4)); - $this->assertEquals(4, $this->body->tell()); - $this->body->seek(2); - $this->assertEquals(2, $this->body->tell()); - $this->body->seek(2, SEEK_CUR); - $this->assertEquals(4, $this->body->tell()); - $this->assertEquals('ing', $this->body->read(3)); - } - - public function testWritesToBufferStream() - { - $this->body->read(2); - $this->body->write('hi'); - $this->body->seek(0); - $this->assertEquals('tehiing', (string) $this->body); - } - - public function testSkipsOverwrittenBytes() - { - $decorated = Psr7\stream_for( - implode("\n", array_map(function ($n) { - return str_pad($n, 4, '0', STR_PAD_LEFT); - }, range(0, 25))) - ); - - $body = new CachingStream($decorated); - - $this->assertEquals("0000\n", Psr7\readline($body)); - $this->assertEquals("0001\n", Psr7\readline($body)); - // Write over part of the body yet to be read, so skip some bytes - $this->assertEquals(5, $body->write("TEST\n")); - $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); - // Read, which skips bytes, then reads - $this->assertEquals("0003\n", Psr7\readline($body)); - $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); - $this->assertEquals("0004\n", Psr7\readline($body)); - $this->assertEquals("0005\n", Psr7\readline($body)); - - // Overwrite part of the cached body (so don't skip any bytes) - $body->seek(5); - $this->assertEquals(5, $body->write("ABCD\n")); - $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); - $this->assertEquals("TEST\n", Psr7\readline($body)); - $this->assertEquals("0003\n", Psr7\readline($body)); - $this->assertEquals("0004\n", Psr7\readline($body)); - $this->assertEquals("0005\n", Psr7\readline($body)); - $this->assertEquals("0006\n", Psr7\readline($body)); - $this->assertEquals(5, $body->write("1234\n")); - $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); - - // Seek to 0 and ensure the overwritten bit is replaced - $body->seek(0); - $this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50)); - - // Ensure that casting it to a string does not include the bit that was overwritten - $this->assertContains("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body); - } - - public function testClosesBothStreams() - { - $s = fopen('php://temp', 'r'); - $a = Psr7\stream_for($s); - $d = new CachingStream($a); - $d->close(); - $this->assertFalse(is_resource($s)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresValidWhence() - { - $this->body->seek(10, -123456); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php b/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php deleted file mode 100644 index 915b215..0000000 --- a/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertEquals(3, $drop->write('hel')); - $this->assertEquals(2, $drop->write('lo')); - $this->assertEquals(5, $drop->getSize()); - $this->assertEquals('hello', $drop->read(5)); - $this->assertEquals(0, $drop->getSize()); - $drop->write('12345678910'); - $this->assertEquals(5, $stream->getSize()); - $this->assertEquals(5, $drop->getSize()); - $this->assertEquals('12345', (string) $drop); - $this->assertEquals(0, $drop->getSize()); - $drop->write('hello'); - $this->assertSame(0, $drop->write('test')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/FnStreamTest.php b/vendor/guzzlehttp/psr7/tests/FnStreamTest.php deleted file mode 100644 index 66ae90a..0000000 --- a/vendor/guzzlehttp/psr7/tests/FnStreamTest.php +++ /dev/null @@ -1,90 +0,0 @@ -seek(1); - } - - public function testProxiesToFunction() - { - $s = new FnStream([ - 'read' => function ($len) { - $this->assertEquals(3, $len); - return 'foo'; - } - ]); - - $this->assertEquals('foo', $s->read(3)); - } - - public function testCanCloseOnDestruct() - { - $called = false; - $s = new FnStream([ - 'close' => function () use (&$called) { - $called = true; - } - ]); - unset($s); - $this->assertTrue($called); - } - - public function testDoesNotRequireClose() - { - $s = new FnStream([]); - unset($s); - } - - public function testDecoratesStream() - { - $a = Psr7\stream_for('foo'); - $b = FnStream::decorate($a, []); - $this->assertEquals(3, $b->getSize()); - $this->assertEquals($b->isWritable(), true); - $this->assertEquals($b->isReadable(), true); - $this->assertEquals($b->isSeekable(), true); - $this->assertEquals($b->read(3), 'foo'); - $this->assertEquals($b->tell(), 3); - $this->assertEquals($a->tell(), 3); - $this->assertSame('', $a->read(1)); - $this->assertEquals($b->eof(), true); - $this->assertEquals($a->eof(), true); - $b->seek(0); - $this->assertEquals('foo', (string) $b); - $b->seek(0); - $this->assertEquals('foo', $b->getContents()); - $this->assertEquals($a->getMetadata(), $b->getMetadata()); - $b->seek(0, SEEK_END); - $b->write('bar'); - $this->assertEquals('foobar', (string) $b); - $this->assertInternalType('resource', $b->detach()); - $b->close(); - } - - public function testDecoratesWithCustomizations() - { - $called = false; - $a = Psr7\stream_for('foo'); - $b = FnStream::decorate($a, [ - 'read' => function ($len) use (&$called, $a) { - $called = true; - return $a->read($len); - } - ]); - $this->assertEquals('foo', $b->read(3)); - $this->assertTrue($called); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/FunctionsTest.php b/vendor/guzzlehttp/psr7/tests/FunctionsTest.php deleted file mode 100644 index de5b5cb..0000000 --- a/vendor/guzzlehttp/psr7/tests/FunctionsTest.php +++ /dev/null @@ -1,586 +0,0 @@ -assertEquals('foobaz', Psr7\copy_to_string($s)); - $s->seek(0); - $this->assertEquals('foo', Psr7\copy_to_string($s, 3)); - $this->assertEquals('baz', Psr7\copy_to_string($s, 3)); - $this->assertEquals('', Psr7\copy_to_string($s)); - } - - public function testCopiesToStringStopsWhenReadFails() - { - $s1 = Psr7\stream_for('foobaz'); - $s1 = FnStream::decorate($s1, [ - 'read' => function () { return ''; } - ]); - $result = Psr7\copy_to_string($s1); - $this->assertEquals('', $result); - } - - public function testCopiesToStream() - { - $s1 = Psr7\stream_for('foobaz'); - $s2 = Psr7\stream_for(''); - Psr7\copy_to_stream($s1, $s2); - $this->assertEquals('foobaz', (string) $s2); - $s2 = Psr7\stream_for(''); - $s1->seek(0); - Psr7\copy_to_stream($s1, $s2, 3); - $this->assertEquals('foo', (string) $s2); - Psr7\copy_to_stream($s1, $s2, 3); - $this->assertEquals('foobaz', (string) $s2); - } - - public function testStopsCopyToStreamWhenWriteFails() - { - $s1 = Psr7\stream_for('foobaz'); - $s2 = Psr7\stream_for(''); - $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); - Psr7\copy_to_stream($s1, $s2); - $this->assertEquals('', (string) $s2); - } - - public function testStopsCopyToSteamWhenWriteFailsWithMaxLen() - { - $s1 = Psr7\stream_for('foobaz'); - $s2 = Psr7\stream_for(''); - $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); - Psr7\copy_to_stream($s1, $s2, 10); - $this->assertEquals('', (string) $s2); - } - - public function testStopsCopyToSteamWhenReadFailsWithMaxLen() - { - $s1 = Psr7\stream_for('foobaz'); - $s1 = FnStream::decorate($s1, ['read' => function () { return ''; }]); - $s2 = Psr7\stream_for(''); - Psr7\copy_to_stream($s1, $s2, 10); - $this->assertEquals('', (string) $s2); - } - - public function testReadsLines() - { - $s = Psr7\stream_for("foo\nbaz\nbar"); - $this->assertEquals("foo\n", Psr7\readline($s)); - $this->assertEquals("baz\n", Psr7\readline($s)); - $this->assertEquals("bar", Psr7\readline($s)); - } - - public function testReadsLinesUpToMaxLength() - { - $s = Psr7\stream_for("12345\n"); - $this->assertEquals("123", Psr7\readline($s, 4)); - $this->assertEquals("45\n", Psr7\readline($s)); - } - - public function testReadsLineUntilFalseReturnedFromRead() - { - $s = $this->getMockBuilder('GuzzleHttp\Psr7\Stream') - ->setMethods(['read', 'eof']) - ->disableOriginalConstructor() - ->getMock(); - $s->expects($this->exactly(2)) - ->method('read') - ->will($this->returnCallback(function () { - static $c = false; - if ($c) { - return false; - } - $c = true; - return 'h'; - })); - $s->expects($this->exactly(2)) - ->method('eof') - ->will($this->returnValue(false)); - $this->assertEquals("h", Psr7\readline($s)); - } - - public function testCalculatesHash() - { - $s = Psr7\stream_for('foobazbar'); - $this->assertEquals(md5('foobazbar'), Psr7\hash($s, 'md5')); - } - - /** - * @expectedException \RuntimeException - */ - public function testCalculatesHashThrowsWhenSeekFails() - { - $s = new NoSeekStream(Psr7\stream_for('foobazbar')); - $s->read(2); - Psr7\hash($s, 'md5'); - } - - public function testCalculatesHashSeeksToOriginalPosition() - { - $s = Psr7\stream_for('foobazbar'); - $s->seek(4); - $this->assertEquals(md5('foobazbar'), Psr7\hash($s, 'md5')); - $this->assertEquals(4, $s->tell()); - } - - public function testOpensFilesSuccessfully() - { - $r = Psr7\try_fopen(__FILE__, 'r'); - $this->assertInternalType('resource', $r); - fclose($r); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to open /path/to/does/not/exist using mode r - */ - public function testThrowsExceptionNotWarning() - { - Psr7\try_fopen('/path/to/does/not/exist', 'r'); - } - - public function parseQueryProvider() - { - return [ - // Does not need to parse when the string is empty - ['', []], - // Can parse mult-values items - ['q=a&q=b', ['q' => ['a', 'b']]], - // Can parse multi-valued items that use numeric indices - ['q[0]=a&q[1]=b', ['q[0]' => 'a', 'q[1]' => 'b']], - // Can parse duplicates and does not include numeric indices - ['q[]=a&q[]=b', ['q[]' => ['a', 'b']]], - // Ensures that the value of "q" is an array even though one value - ['q[]=a', ['q[]' => 'a']], - // Does not modify "." to "_" like PHP's parse_str() - ['q.a=a&q.b=b', ['q.a' => 'a', 'q.b' => 'b']], - // Can decode %20 to " " - ['q%20a=a%20b', ['q a' => 'a b']], - // Can parse funky strings with no values by assigning each to null - ['q&a', ['q' => null, 'a' => null]], - // Does not strip trailing equal signs - ['data=abc=', ['data' => 'abc=']], - // Can store duplicates without affecting other values - ['foo=a&foo=b&?µ=c', ['foo' => ['a', 'b'], '?µ' => 'c']], - // Sets value to null when no "=" is present - ['foo', ['foo' => null]], - // Preserves "0" keys. - ['0', ['0' => null]], - // Sets the value to an empty string when "=" is present - ['0=', ['0' => '']], - // Preserves falsey keys - ['var=0', ['var' => '0']], - ['a[b][c]=1&a[b][c]=2', ['a[b][c]' => ['1', '2']]], - ['a[b]=c&a[d]=e', ['a[b]' => 'c', 'a[d]' => 'e']], - // Ensure it doesn't leave things behind with repeated values - // Can parse mult-values items - ['q=a&q=b&q=c', ['q' => ['a', 'b', 'c']]], - ]; - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesQueries($input, $output) - { - $result = Psr7\parse_query($input); - $this->assertSame($output, $result); - } - - public function testDoesNotDecode() - { - $str = 'foo%20=bar'; - $data = Psr7\parse_query($str, false); - $this->assertEquals(['foo%20' => 'bar'], $data); - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesAndBuildsQueries($input, $output) - { - $result = Psr7\parse_query($input, false); - $this->assertSame($input, Psr7\build_query($result, false)); - } - - public function testEncodesWithRfc1738() - { - $str = Psr7\build_query(['foo bar' => 'baz+'], PHP_QUERY_RFC1738); - $this->assertEquals('foo+bar=baz%2B', $str); - } - - public function testEncodesWithRfc3986() - { - $str = Psr7\build_query(['foo bar' => 'baz+'], PHP_QUERY_RFC3986); - $this->assertEquals('foo%20bar=baz%2B', $str); - } - - public function testDoesNotEncode() - { - $str = Psr7\build_query(['foo bar' => 'baz+'], false); - $this->assertEquals('foo bar=baz+', $str); - } - - public function testCanControlDecodingType() - { - $result = Psr7\parse_query('var=foo+bar', PHP_QUERY_RFC3986); - $this->assertEquals('foo+bar', $result['var']); - $result = Psr7\parse_query('var=foo+bar', PHP_QUERY_RFC1738); - $this->assertEquals('foo bar', $result['var']); - } - - public function testParsesRequestMessages() - { - $req = "GET /abc HTTP/1.0\r\nHost: foo.com\r\nFoo: Bar\r\nBaz: Bam\r\nBaz: Qux\r\n\r\nTest"; - $request = Psr7\parse_request($req); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('/abc', $request->getRequestTarget()); - $this->assertEquals('1.0', $request->getProtocolVersion()); - $this->assertEquals('foo.com', $request->getHeaderLine('Host')); - $this->assertEquals('Bar', $request->getHeaderLine('Foo')); - $this->assertEquals('Bam, Qux', $request->getHeaderLine('Baz')); - $this->assertEquals('Test', (string) $request->getBody()); - $this->assertEquals('http://foo.com/abc', (string) $request->getUri()); - } - - public function testParsesRequestMessagesWithHttpsScheme() - { - $req = "PUT /abc?baz=bar HTTP/1.1\r\nHost: foo.com:443\r\n\r\n"; - $request = Psr7\parse_request($req); - $this->assertEquals('PUT', $request->getMethod()); - $this->assertEquals('/abc?baz=bar', $request->getRequestTarget()); - $this->assertEquals('1.1', $request->getProtocolVersion()); - $this->assertEquals('foo.com:443', $request->getHeaderLine('Host')); - $this->assertEquals('', (string) $request->getBody()); - $this->assertEquals('https://foo.com/abc?baz=bar', (string) $request->getUri()); - } - - public function testParsesRequestMessagesWithUriWhenHostIsNotFirst() - { - $req = "PUT / HTTP/1.1\r\nFoo: Bar\r\nHost: foo.com\r\n\r\n"; - $request = Psr7\parse_request($req); - $this->assertEquals('PUT', $request->getMethod()); - $this->assertEquals('/', $request->getRequestTarget()); - $this->assertEquals('http://foo.com/', (string) $request->getUri()); - } - - public function testParsesRequestMessagesWithFullUri() - { - $req = "GET https://www.google.com:443/search?q=foobar HTTP/1.1\r\nHost: www.google.com\r\n\r\n"; - $request = Psr7\parse_request($req); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('https://www.google.com:443/search?q=foobar', $request->getRequestTarget()); - $this->assertEquals('1.1', $request->getProtocolVersion()); - $this->assertEquals('www.google.com', $request->getHeaderLine('Host')); - $this->assertEquals('', (string) $request->getBody()); - $this->assertEquals('https://www.google.com/search?q=foobar', (string) $request->getUri()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesRequestMessages() - { - Psr7\parse_request("HTTP/1.1 200 OK\r\n\r\n"); - } - - public function testParsesResponseMessages() - { - $res = "HTTP/1.0 200 OK\r\nFoo: Bar\r\nBaz: Bam\r\nBaz: Qux\r\n\r\nTest"; - $response = Psr7\parse_response($res); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('OK', $response->getReasonPhrase()); - $this->assertEquals('1.0', $response->getProtocolVersion()); - $this->assertEquals('Bar', $response->getHeaderLine('Foo')); - $this->assertEquals('Bam, Qux', $response->getHeaderLine('Baz')); - $this->assertEquals('Test', (string) $response->getBody()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesResponseMessages() - { - Psr7\parse_response("GET / HTTP/1.1\r\n\r\n"); - } - - public function testDetermineMimetype() - { - $this->assertNull(Psr7\mimetype_from_extension('not-a-real-extension')); - $this->assertEquals( - 'application/json', - Psr7\mimetype_from_extension('json') - ); - $this->assertEquals( - 'image/jpeg', - Psr7\mimetype_from_filename('/tmp/images/IMG034821.JPEG') - ); - } - - public function testCreatesUriForValue() - { - $this->assertInstanceOf('GuzzleHttp\Psr7\Uri', Psr7\uri_for('/foo')); - $this->assertInstanceOf( - 'GuzzleHttp\Psr7\Uri', - Psr7\uri_for(new Psr7\Uri('/foo')) - ); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesUri() - { - Psr7\uri_for([]); - } - - public function testKeepsPositionOfResource() - { - $h = fopen(__FILE__, 'r'); - fseek($h, 10); - $stream = Psr7\stream_for($h); - $this->assertEquals(10, $stream->tell()); - $stream->close(); - } - - public function testCreatesWithFactory() - { - $stream = Psr7\stream_for('foo'); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $stream); - $this->assertEquals('foo', $stream->getContents()); - $stream->close(); - } - - public function testFactoryCreatesFromEmptyString() - { - $s = Psr7\stream_for(); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - } - - public function testFactoryCreatesFromNull() - { - $s = Psr7\stream_for(null); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - } - - public function testFactoryCreatesFromResource() - { - $r = fopen(__FILE__, 'r'); - $s = Psr7\stream_for($r); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - $this->assertSame(file_get_contents(__FILE__), (string) $s); - } - - public function testFactoryCreatesFromObjectWithToString() - { - $r = new HasToString(); - $s = Psr7\stream_for($r); - $this->assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - $this->assertEquals('foo', (string) $s); - } - - public function testCreatePassesThrough() - { - $s = Psr7\stream_for('foo'); - $this->assertSame($s, Psr7\stream_for($s)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsExceptionForUnknown() - { - Psr7\stream_for(new \stdClass()); - } - - public function testReturnsCustomMetadata() - { - $s = Psr7\stream_for('foo', ['metadata' => ['hwm' => 3]]); - $this->assertEquals(3, $s->getMetadata('hwm')); - $this->assertArrayHasKey('hwm', $s->getMetadata()); - } - - public function testCanSetSize() - { - $s = Psr7\stream_for('', ['size' => 10]); - $this->assertEquals(10, $s->getSize()); - } - - public function testCanCreateIteratorBasedStream() - { - $a = new \ArrayIterator(['foo', 'bar', '123']); - $p = Psr7\stream_for($a); - $this->assertInstanceOf('GuzzleHttp\Psr7\PumpStream', $p); - $this->assertEquals('foo', $p->read(3)); - $this->assertFalse($p->eof()); - $this->assertEquals('b', $p->read(1)); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals('r12', $p->read(3)); - $this->assertFalse($p->eof()); - $this->assertEquals('3', $p->getContents()); - $this->assertTrue($p->eof()); - $this->assertEquals(9, $p->tell()); - } - - public function testConvertsRequestsToStrings() - { - $request = new Psr7\Request('PUT', 'http://foo.com/hi?123', [ - 'Baz' => 'bar', - 'Qux' => ' ipsum' - ], 'hello', '1.0'); - $this->assertEquals( - "PUT /hi?123 HTTP/1.0\r\nHost: foo.com\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\str($request) - ); - } - - public function testConvertsResponsesToStrings() - { - $response = new Psr7\Response(200, [ - 'Baz' => 'bar', - 'Qux' => ' ipsum' - ], 'hello', '1.0', 'FOO'); - $this->assertEquals( - "HTTP/1.0 200 FOO\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\str($response) - ); - } - - public function parseParamsProvider() - { - $res1 = array( - array( - '', - 'rel' => 'front', - 'type' => 'image/jpeg', - ), - array( - '', - 'rel' => 'back', - 'type' => 'image/jpeg', - ), - ); - return array( - array( - '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"', - $res1 - ), - array( - '; rel="front"; type="image/jpeg",; rel=back; type="image/jpeg"', - $res1 - ), - array( - 'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"', - array( - array('foo' => 'baz', 'bar' => '123'), - array('boo'), - array('test' => '123'), - array('foobar' => 'foo;bar') - ) - ), - array( - '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"', - array( - array('', 'rel' => 'side', 'type' => 'image/jpeg'), - array('', 'rel' => 'side', 'type' => 'image/jpeg') - ) - ), - array( - '', - array() - ) - ); - } - /** - * @dataProvider parseParamsProvider - */ - public function testParseParams($header, $result) - { - $this->assertEquals($result, Psr7\parse_header($header)); - } - - public function testParsesArrayHeaders() - { - $header = ['a, b', 'c', 'd, e']; - $this->assertEquals(['a', 'b', 'c', 'd', 'e'], Psr7\normalize_header($header)); - } - - public function testRewindsBody() - { - $body = Psr7\stream_for('abc'); - $res = new Psr7\Response(200, [], $body); - Psr7\rewind_body($res); - $this->assertEquals(0, $body->tell()); - $body->rewind(1); - Psr7\rewind_body($res); - $this->assertEquals(0, $body->tell()); - } - - /** - * @expectedException \RuntimeException - */ - public function testThrowsWhenBodyCannotBeRewound() - { - $body = Psr7\stream_for('abc'); - $body->read(1); - $body = FnStream::decorate($body, [ - 'rewind' => function () { throw new \RuntimeException('a'); } - ]); - $res = new Psr7\Response(200, [], $body); - Psr7\rewind_body($res); - } - - public function testCanModifyRequestWithUri() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\modify_request($r1, [ - 'uri' => new Psr7\Uri('http://www.foo.com') - ]); - $this->assertEquals('http://www.foo.com', (string) $r2->getUri()); - $this->assertEquals('www.foo.com', (string) $r2->getHeaderLine('host')); - } - - public function testCanModifyRequestWithCaseInsensitiveHeader() - { - $r1 = new Psr7\Request('GET', 'http://foo.com', ['User-Agent' => 'foo']); - $r2 = Psr7\modify_request($r1, ['set_headers' => ['User-agent' => 'bar']]); - $this->assertEquals('bar', $r2->getHeaderLine('User-Agent')); - $this->assertEquals('bar', $r2->getHeaderLine('User-agent')); - } - - public function testReturnsAsIsWhenNoChanges() - { - $request = new Psr7\Request('GET', 'http://foo.com'); - $this->assertSame($request, Psr7\modify_request($request, [])); - } - - public function testReturnsUriAsIsWhenNoChanges() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\modify_request($r1, ['set_headers' => ['foo' => 'bar']]); - $this->assertNotSame($r1, $r2); - $this->assertEquals('bar', $r2->getHeaderLine('foo')); - } - - public function testRemovesHeadersFromMessage() - { - $r1 = new Psr7\Request('GET', 'http://foo.com', ['foo' => 'bar']); - $r2 = Psr7\modify_request($r1, ['remove_headers' => ['foo']]); - $this->assertNotSame($r1, $r2); - $this->assertFalse($r2->hasHeader('foo')); - } - - public function testAddsQueryToUri() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\modify_request($r1, ['query' => 'foo=bar']); - $this->assertNotSame($r1, $r2); - $this->assertEquals('foo=bar', $r2->getUri()->getQuery()); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php b/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php deleted file mode 100644 index 927fc0b..0000000 --- a/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php +++ /dev/null @@ -1,16 +0,0 @@ -assertEquals('test', (string) $b); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php b/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php deleted file mode 100644 index fdef142..0000000 --- a/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php +++ /dev/null @@ -1,64 +0,0 @@ -fname = tempnam('/tmp', 'tfile'); - - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - public function tearDown() - { - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - public function testOpensLazily() - { - $l = new LazyOpenStream($this->fname, 'w+'); - $l->write('foo'); - $this->assertInternalType('array', $l->getMetadata()); - $this->assertFileExists($this->fname); - $this->assertEquals('foo', file_get_contents($this->fname)); - $this->assertEquals('foo', (string) $l); - } - - public function testProxiesToFile() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - $this->assertEquals('foo', $l->read(4)); - $this->assertTrue($l->eof()); - $this->assertEquals(3, $l->tell()); - $this->assertTrue($l->isReadable()); - $this->assertTrue($l->isSeekable()); - $this->assertFalse($l->isWritable()); - $l->seek(1); - $this->assertEquals('oo', $l->getContents()); - $this->assertEquals('foo', (string) $l); - $this->assertEquals(3, $l->getSize()); - $this->assertInternalType('array', $l->getMetadata()); - $l->close(); - } - - public function testDetachesUnderlyingStream() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - $r = $l->detach(); - $this->assertInternalType('resource', $r); - fseek($r, 0); - $this->assertEquals('foo', stream_get_contents($r)); - fclose($r); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php b/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php deleted file mode 100644 index 2198b7a..0000000 --- a/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php +++ /dev/null @@ -1,166 +0,0 @@ -decorated = Psr7\stream_for(fopen(__FILE__, 'r')); - $this->body = new LimitStream($this->decorated, 10, 3); - } - - public function testReturnsSubset() - { - $body = new LimitStream(Psr7\stream_for('foo'), -1, 1); - $this->assertEquals('oo', (string) $body); - $this->assertTrue($body->eof()); - $body->seek(0); - $this->assertFalse($body->eof()); - $this->assertEquals('oo', $body->read(100)); - $this->assertSame('', $body->read(1)); - $this->assertTrue($body->eof()); - } - - public function testReturnsSubsetWhenCastToString() - { - $body = Psr7\stream_for('foo_baz_bar'); - $limited = new LimitStream($body, 3, 4); - $this->assertEquals('baz', (string) $limited); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to seek to stream position 10 with whence 0 - */ - public function testEnsuresPositionCanBeekSeekedTo() - { - new LimitStream(Psr7\stream_for(''), 0, 10); - } - - public function testReturnsSubsetOfEmptyBodyWhenCastToString() - { - $body = Psr7\stream_for('01234567891234'); - $limited = new LimitStream($body, 0, 10); - $this->assertEquals('', (string) $limited); - } - - public function testReturnsSpecificSubsetOBodyWhenCastToString() - { - $body = Psr7\stream_for('0123456789abcdef'); - $limited = new LimitStream($body, 3, 10); - $this->assertEquals('abc', (string) $limited); - } - - public function testSeeksWhenConstructed() - { - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - } - - public function testAllowsBoundedSeek() - { - $this->body->seek(100); - $this->assertEquals(10, $this->body->tell()); - $this->assertEquals(13, $this->decorated->tell()); - $this->body->seek(0); - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - try { - $this->body->seek(-10); - $this->fail(); - } catch (\RuntimeException $e) {} - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - $this->body->seek(5); - $this->assertEquals(5, $this->body->tell()); - $this->assertEquals(8, $this->decorated->tell()); - // Fail - try { - $this->body->seek(1000, SEEK_END); - $this->fail(); - } catch (\RuntimeException $e) {} - } - - public function testReadsOnlySubsetOfData() - { - $data = $this->body->read(100); - $this->assertEquals(10, strlen($data)); - $this->assertSame('', $this->body->read(1000)); - - $this->body->setOffset(10); - $newData = $this->body->read(100); - $this->assertEquals(10, strlen($newData)); - $this->assertNotSame($data, $newData); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Could not seek to stream offset 2 - */ - public function testThrowsWhenCurrentGreaterThanOffsetSeek() - { - $a = Psr7\stream_for('foo_bar'); - $b = new NoSeekStream($a); - $c = new LimitStream($b); - $a->getContents(); - $c->setOffset(2); - } - - public function testCanGetContentsWithoutSeeking() - { - $a = Psr7\stream_for('foo_bar'); - $b = new NoSeekStream($a); - $c = new LimitStream($b); - $this->assertEquals('foo_bar', $c->getContents()); - } - - public function testClaimsConsumedWhenReadLimitIsReached() - { - $this->assertFalse($this->body->eof()); - $this->body->read(1000); - $this->assertTrue($this->body->eof()); - } - - public function testContentLengthIsBounded() - { - $this->assertEquals(10, $this->body->getSize()); - } - - public function testGetContentsIsBasedOnSubset() - { - $body = new LimitStream(Psr7\stream_for('foobazbar'), 3, 3); - $this->assertEquals('baz', $body->getContents()); - } - - public function testReturnsNullIfSizeCannotBeDetermined() - { - $a = new FnStream([ - 'getSize' => function () { return null; }, - 'tell' => function () { return 0; }, - ]); - $b = new LimitStream($a); - $this->assertNull($b->getSize()); - } - - public function testLengthLessOffsetWhenNoLimitSize() - { - $a = Psr7\stream_for('foo_bar'); - $b = new LimitStream($a, -1, 4); - $this->assertEquals(3, $b->getSize()); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php b/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php deleted file mode 100644 index 61edb06..0000000 --- a/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php +++ /dev/null @@ -1,214 +0,0 @@ -assertNotEmpty($b->getBoundary()); - } - - public function testCanProvideBoundary() - { - $b = new MultipartStream([], 'foo'); - $this->assertEquals('foo', $b->getBoundary()); - } - - public function testIsNotWritable() - { - $b = new MultipartStream(); - $this->assertFalse($b->isWritable()); - } - - public function testCanCreateEmptyStream() - { - $b = new MultipartStream(); - $boundary = $b->getBoundary(); - $this->assertSame("--{$boundary}--\r\n", $b->getContents()); - $this->assertSame(strlen($boundary) + 6, $b->getSize()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesFilesArrayElement() - { - new MultipartStream([['foo' => 'bar']]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresFileHasName() - { - new MultipartStream([['contents' => 'bar']]); - } - - public function testSerializesFields() - { - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => 'bar' - ], - [ - 'name' => 'baz', - 'contents' => 'bam' - ] - ], 'boundary'); - $this->assertEquals( - "--boundary\r\nContent-Disposition: form-data; name=\"foo\"\r\nContent-Length: 3\r\n\r\n" - . "bar\r\n--boundary\r\nContent-Disposition: form-data; name=\"baz\"\r\nContent-Length: 3" - . "\r\n\r\nbam\r\n--boundary--\r\n", (string) $b); - } - - public function testSerializesFiles() - { - $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [ - 'getMetadata' => function () { - return '/foo/bar.txt'; - } - ]); - - $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), [ - 'getMetadata' => function () { - return '/foo/baz.jpg'; - } - ]); - - $f3 = Psr7\FnStream::decorate(Psr7\stream_for('bar'), [ - 'getMetadata' => function () { - return '/foo/bar.gif'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1 - ], - [ - 'name' => 'qux', - 'contents' => $f2 - ], - [ - 'name' => 'qux', - 'contents' => $f3 - ], - ], 'boundary'); - - $expected = <<assertEquals($expected, str_replace("\r", '', $b)); - } - - public function testSerializesFilesWithCustomHeaders() - { - $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [ - 'getMetadata' => function () { - return '/foo/bar.txt'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1, - 'headers' => [ - 'x-foo' => 'bar', - 'content-disposition' => 'custom' - ] - ] - ], 'boundary'); - - $expected = <<assertEquals($expected, str_replace("\r", '', $b)); - } - - public function testSerializesFilesWithCustomHeadersAndMultipleValues() - { - $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [ - 'getMetadata' => function () { - return '/foo/bar.txt'; - } - ]); - - $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), [ - 'getMetadata' => function () { - return '/foo/baz.jpg'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1, - 'headers' => [ - 'x-foo' => 'bar', - 'content-disposition' => 'custom' - ] - ], - [ - 'name' => 'foo', - 'contents' => $f2, - 'headers' => ['cOntenT-Type' => 'custom'], - ] - ], 'boundary'); - - $expected = <<assertEquals($expected, str_replace("\r", '', $b)); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php b/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php deleted file mode 100644 index a309317..0000000 --- a/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php +++ /dev/null @@ -1,40 +0,0 @@ -getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'seek']) - ->getMockForAbstractClass(); - $s->expects($this->never())->method('seek'); - $s->expects($this->never())->method('isSeekable'); - $wrapped = new NoSeekStream($s); - $this->assertFalse($wrapped->isSeekable()); - $wrapped->seek(2); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot write to a non-writable stream - */ - public function testHandlesClose() - { - $s = Psr7\stream_for('foo'); - $wrapped = new NoSeekStream($s); - $wrapped->close(); - $wrapped->write('foo'); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php b/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php deleted file mode 100644 index 7358bb6..0000000 --- a/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php +++ /dev/null @@ -1,72 +0,0 @@ - ['foo' => 'bar'], - 'size' => 100 - ]); - - $this->assertEquals('bar', $p->getMetadata('foo')); - $this->assertEquals(['foo' => 'bar'], $p->getMetadata()); - $this->assertEquals(100, $p->getSize()); - } - - public function testCanReadFromCallable() - { - $p = Psr7\stream_for(function ($size) { - return 'a'; - }); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals(1, $p->tell()); - $this->assertEquals('aaaaa', $p->read(5)); - $this->assertEquals(6, $p->tell()); - } - - public function testStoresExcessDataInBuffer() - { - $called = []; - $p = Psr7\stream_for(function ($size) use (&$called) { - $called[] = $size; - return 'abcdef'; - }); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals('b', $p->read(1)); - $this->assertEquals('cdef', $p->read(4)); - $this->assertEquals('abcdefabc', $p->read(9)); - $this->assertEquals([1, 9, 3], $called); - } - - public function testInifiniteStreamWrappedInLimitStream() - { - $p = Psr7\stream_for(function () { return 'a'; }); - $s = new LimitStream($p, 5); - $this->assertEquals('aaaaa', (string) $s); - } - - public function testDescribesCapabilities() - { - $p = Psr7\stream_for(function () {}); - $this->assertTrue($p->isReadable()); - $this->assertFalse($p->isSeekable()); - $this->assertFalse($p->isWritable()); - $this->assertNull($p->getSize()); - $this->assertEquals('', $p->getContents()); - $this->assertEquals('', (string) $p); - $p->close(); - $this->assertEquals('', $p->read(10)); - $this->assertTrue($p->eof()); - - try { - $this->assertFalse($p->write('aa')); - $this->fail(); - } catch (\RuntimeException $e) {} - } -} diff --git a/vendor/guzzlehttp/psr7/tests/RequestTest.php b/vendor/guzzlehttp/psr7/tests/RequestTest.php deleted file mode 100644 index 9defe68..0000000 --- a/vendor/guzzlehttp/psr7/tests/RequestTest.php +++ /dev/null @@ -1,157 +0,0 @@ -assertEquals('/', (string) $r->getUri()); - } - - public function testRequestUriMayBeUri() - { - $uri = new Uri('/'); - $r = new Request('GET', $uri); - $this->assertSame($uri, $r->getUri()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidateRequestUri() - { - new Request('GET', true); - } - - public function testCanConstructWithBody() - { - $r = new Request('GET', '/', [], 'baz'); - $this->assertEquals('baz', (string) $r->getBody()); - } - - public function testCapitalizesMethod() - { - $r = new Request('get', '/'); - $this->assertEquals('GET', $r->getMethod()); - } - - public function testCapitalizesWithMethod() - { - $r = new Request('GET', '/'); - $this->assertEquals('PUT', $r->withMethod('put')->getMethod()); - } - - public function testWithUri() - { - $r1 = new Request('GET', '/'); - $u1 = $r1->getUri(); - $u2 = new Uri('http://www.example.com'); - $r2 = $r1->withUri($u2); - $this->assertNotSame($r1, $r2); - $this->assertSame($u2, $r2->getUri()); - $this->assertSame($u1, $r1->getUri()); - } - - public function testSameInstanceWhenSameUri() - { - $r1 = new Request('GET', 'http://foo.com'); - $r2 = $r1->withUri($r1->getUri()); - $this->assertSame($r1, $r2); - } - - public function testWithRequestTarget() - { - $r1 = new Request('GET', '/'); - $r2 = $r1->withRequestTarget('*'); - $this->assertEquals('*', $r2->getRequestTarget()); - $this->assertEquals('/', $r1->getRequestTarget()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testRequestTargetDoesNotAllowSpaces() - { - $r1 = new Request('GET', '/'); - $r1->withRequestTarget('/foo bar'); - } - - public function testRequestTargetDefaultsToSlash() - { - $r1 = new Request('GET', ''); - $this->assertEquals('/', $r1->getRequestTarget()); - $r2 = new Request('GET', '*'); - $this->assertEquals('*', $r2->getRequestTarget()); - $r3 = new Request('GET', 'http://foo.com/bar baz/'); - $this->assertEquals('/bar%20baz/', $r3->getRequestTarget()); - } - - public function testBuildsRequestTarget() - { - $r1 = new Request('GET', 'http://foo.com/baz?bar=bam'); - $this->assertEquals('/baz?bar=bam', $r1->getRequestTarget()); - } - - public function testHostIsAddedFirst() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Foo' => 'Bar']); - $this->assertEquals([ - 'Host' => ['foo.com'], - 'Foo' => ['Bar'] - ], $r->getHeaders()); - } - - public function testCanGetHeaderAsCsv() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', [ - 'Foo' => ['a', 'b', 'c'] - ]); - $this->assertEquals('a, b, c', $r->getHeaderLine('Foo')); - $this->assertEquals('', $r->getHeaderLine('Bar')); - } - - public function testHostIsNotOverwrittenWhenPreservingHost() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Host' => 'a.com']); - $this->assertEquals(['Host' => ['a.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.foo.com/bar'), true); - $this->assertEquals('a.com', $r2->getHeaderLine('Host')); - } - - public function testOverridesHostWithUri() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam'); - $this->assertEquals(['Host' => ['foo.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.baz.com/bar')); - $this->assertEquals('www.baz.com', $r2->getHeaderLine('Host')); - } - - public function testAggregatesHeaders() - { - $r = new Request('GET', 'http://foo.com', [ - 'ZOO' => 'zoobar', - 'zoo' => ['foobar', 'zoobar'] - ]); - $this->assertEquals('zoobar, foobar, zoobar', $r->getHeaderLine('zoo')); - } - - public function testAddsPortToHeader() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - $this->assertEquals('foo.com:8124', $r->getHeaderLine('host')); - } - - public function testAddsPortToHeaderAndReplacePreviousPort() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - $r = $r->withUri(new Uri('http://foo.com:8125/bar')); - $this->assertEquals('foo.com:8125', $r->getHeaderLine('host')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/ResponseTest.php b/vendor/guzzlehttp/psr7/tests/ResponseTest.php deleted file mode 100644 index 0ce3e21..0000000 --- a/vendor/guzzlehttp/psr7/tests/ResponseTest.php +++ /dev/null @@ -1,146 +0,0 @@ -assertSame(200, $r->getStatusCode()); - $this->assertEquals('OK', $r->getReasonPhrase()); - } - - public function testCanGiveCustomReason() - { - $r = new Response(200, [], null, '1.1', 'bar'); - $this->assertEquals('bar', $r->getReasonPhrase()); - } - - public function testCanGiveCustomProtocolVersion() - { - $r = new Response(200, [], null, '1000'); - $this->assertEquals('1000', $r->getProtocolVersion()); - } - - public function testCanCreateNewResponseWithStatusAndNoReason() - { - $r = new Response(200); - $r2 = $r->withStatus(201); - $this->assertEquals(200, $r->getStatusCode()); - $this->assertEquals('OK', $r->getReasonPhrase()); - $this->assertEquals(201, $r2->getStatusCode()); - $this->assertEquals('Created', $r2->getReasonPhrase()); - } - - public function testCanCreateNewResponseWithStatusAndReason() - { - $r = new Response(200); - $r2 = $r->withStatus(201, 'Foo'); - $this->assertEquals(200, $r->getStatusCode()); - $this->assertEquals('OK', $r->getReasonPhrase()); - $this->assertEquals(201, $r2->getStatusCode()); - $this->assertEquals('Foo', $r2->getReasonPhrase()); - } - - public function testCreatesResponseWithAddedHeaderArray() - { - $r = new Response(); - $r2 = $r->withAddedHeader('foo', ['baz', 'bar']); - $this->assertFalse($r->hasHeader('foo')); - $this->assertEquals('baz, bar', $r2->getHeaderLine('foo')); - } - - public function testReturnsIdentityWhenRemovingMissingHeader() - { - $r = new Response(); - $this->assertSame($r, $r->withoutHeader('foo')); - } - - public function testAlwaysReturnsBody() - { - $r = new Response(); - $this->assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - } - - public function testCanSetHeaderAsArray() - { - $r = new Response(200, [ - 'foo' => ['baz ', ' bar '] - ]); - $this->assertEquals('baz, bar', $r->getHeaderLine('foo')); - $this->assertEquals(['baz', 'bar'], $r->getHeader('foo')); - } - - public function testSameInstanceWhenSameBody() - { - $r = new Response(200, [], 'foo'); - $b = $r->getBody(); - $this->assertSame($r, $r->withBody($b)); - } - - public function testNewInstanceWhenNewBody() - { - $r = new Response(200, [], 'foo'); - $b2 = Psr7\stream_for('abc'); - $this->assertNotSame($r, $r->withBody($b2)); - } - - public function testSameInstanceWhenSameProtocol() - { - $r = new Response(200); - $this->assertSame($r, $r->withProtocolVersion('1.1')); - } - - public function testNewInstanceWhenNewProtocol() - { - $r = new Response(200); - $this->assertNotSame($r, $r->withProtocolVersion('1.0')); - } - - public function testNewInstanceWhenRemovingHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withoutHeader('Foo'); - $this->assertNotSame($r, $r2); - $this->assertFalse($r2->hasHeader('foo')); - } - - public function testNewInstanceWhenAddingHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('Foo', 'Baz'); - $this->assertNotSame($r, $r2); - $this->assertEquals('Bar, Baz', $r2->getHeaderLine('foo')); - } - - public function testNewInstanceWhenAddingHeaderThatWasNotThereBefore() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('Baz', 'Bam'); - $this->assertNotSame($r, $r2); - $this->assertEquals('Bam', $r2->getHeaderLine('Baz')); - $this->assertEquals('Bar', $r2->getHeaderLine('Foo')); - } - - public function testRemovesPreviouslyAddedHeaderOfDifferentCase() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('foo', 'Bam'); - $this->assertNotSame($r, $r2); - $this->assertEquals('Bam', $r2->getHeaderLine('Foo')); - } - - public function testBodyConsistent() - { - $r = new Response(200, [], '0'); - $this->assertEquals('0', (string)$r->getBody()); - } - -} diff --git a/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php b/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php deleted file mode 100644 index 682079e..0000000 --- a/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php +++ /dev/null @@ -1,137 +0,0 @@ -c = fopen('php://temp', 'r+'); - fwrite($this->c, 'foo'); - fseek($this->c, 0); - $this->a = Psr7\stream_for($this->c); - $this->b = new Str($this->a); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['read']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('read') - ->will($this->throwException(new \Exception('foo'))); - $msg = ''; - set_error_handler(function ($errNo, $str) use (&$msg) { $msg = $str; }); - echo new Str($s); - restore_error_handler(); - $this->assertContains('foo', $msg); - } - - public function testToString() - { - $this->assertEquals('foo', (string) $this->b); - } - - public function testHasSize() - { - $this->assertEquals(3, $this->b->getSize()); - } - - public function testReads() - { - $this->assertEquals('foo', $this->b->read(10)); - } - - public function testCheckMethods() - { - $this->assertEquals($this->a->isReadable(), $this->b->isReadable()); - $this->assertEquals($this->a->isWritable(), $this->b->isWritable()); - $this->assertEquals($this->a->isSeekable(), $this->b->isSeekable()); - } - - public function testSeeksAndTells() - { - $this->b->seek(1); - $this->assertEquals(1, $this->a->tell()); - $this->assertEquals(1, $this->b->tell()); - $this->b->seek(0); - $this->assertEquals(0, $this->a->tell()); - $this->assertEquals(0, $this->b->tell()); - $this->b->seek(0, SEEK_END); - $this->assertEquals(3, $this->a->tell()); - $this->assertEquals(3, $this->b->tell()); - } - - public function testGetsContents() - { - $this->assertEquals('foo', $this->b->getContents()); - $this->assertEquals('', $this->b->getContents()); - $this->b->seek(1); - $this->assertEquals('oo', $this->b->getContents(1)); - } - - public function testCloses() - { - $this->b->close(); - $this->assertFalse(is_resource($this->c)); - } - - public function testDetaches() - { - $this->b->detach(); - $this->assertFalse($this->b->isReadable()); - } - - public function testWrapsMetadata() - { - $this->assertSame($this->b->getMetadata(), $this->a->getMetadata()); - $this->assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri')); - } - - public function testWrapsWrites() - { - $this->b->seek(0, SEEK_END); - $this->b->write('foo'); - $this->assertEquals('foofoo', (string) $this->a); - } - - /** - * @expectedException \UnexpectedValueException - */ - public function testThrowsWithInvalidGetter() - { - $this->b->foo; - } - - /** - * @expectedException \BadMethodCallException - */ - public function testThrowsWhenGetterNotImplemented() - { - $s = new BadStream(); - $s->stream; - } -} - -class BadStream -{ - use StreamDecoratorTrait; - - public function __construct() {} -} diff --git a/vendor/guzzlehttp/psr7/tests/StreamTest.php b/vendor/guzzlehttp/psr7/tests/StreamTest.php deleted file mode 100644 index 4fe92cc..0000000 --- a/vendor/guzzlehttp/psr7/tests/StreamTest.php +++ /dev/null @@ -1,161 +0,0 @@ -assertTrue($stream->isReadable()); - $this->assertTrue($stream->isWritable()); - $this->assertTrue($stream->isSeekable()); - $this->assertEquals('php://temp', $stream->getMetadata('uri')); - $this->assertInternalType('array', $stream->getMetadata()); - $this->assertEquals(4, $stream->getSize()); - $this->assertFalse($stream->eof()); - $stream->close(); - } - - public function testStreamClosesHandleOnDestruct() - { - $handle = fopen('php://temp', 'r'); - $stream = new Stream($handle); - unset($stream); - $this->assertFalse(is_resource($handle)); - } - - public function testConvertsToString() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertEquals('data', (string) $stream); - $this->assertEquals('data', (string) $stream); - $stream->close(); - } - - public function testGetsContents() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertEquals('', $stream->getContents()); - $stream->seek(0); - $this->assertEquals('data', $stream->getContents()); - $this->assertEquals('', $stream->getContents()); - } - - public function testChecksEof() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertFalse($stream->eof()); - $stream->read(4); - $this->assertTrue($stream->eof()); - $stream->close(); - } - - public function testGetSize() - { - $size = filesize(__FILE__); - $handle = fopen(__FILE__, 'r'); - $stream = new Stream($handle); - $this->assertEquals($size, $stream->getSize()); - // Load from cache - $this->assertEquals($size, $stream->getSize()); - $stream->close(); - } - - public function testEnsuresSizeIsConsistent() - { - $h = fopen('php://temp', 'w+'); - $this->assertEquals(3, fwrite($h, 'foo')); - $stream = new Stream($h); - $this->assertEquals(3, $stream->getSize()); - $this->assertEquals(4, $stream->write('test')); - $this->assertEquals(7, $stream->getSize()); - $this->assertEquals(7, $stream->getSize()); - $stream->close(); - } - - public function testProvidesStreamPosition() - { - $handle = fopen('php://temp', 'w+'); - $stream = new Stream($handle); - $this->assertEquals(0, $stream->tell()); - $stream->write('foo'); - $this->assertEquals(3, $stream->tell()); - $stream->seek(1); - $this->assertEquals(1, $stream->tell()); - $this->assertSame(ftell($handle), $stream->tell()); - $stream->close(); - } - - public function testCanDetachStream() - { - $r = fopen('php://temp', 'w+'); - $stream = new Stream($r); - $stream->write('foo'); - $this->assertTrue($stream->isReadable()); - $this->assertSame($r, $stream->detach()); - $stream->detach(); - - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->isWritable()); - $this->assertFalse($stream->isSeekable()); - - $throws = function (callable $fn) use ($stream) { - try { - $fn($stream); - $this->fail(); - } catch (\Exception $e) {} - }; - - $throws(function ($stream) { $stream->read(10); }); - $throws(function ($stream) { $stream->write('bar'); }); - $throws(function ($stream) { $stream->seek(10); }); - $throws(function ($stream) { $stream->tell(); }); - $throws(function ($stream) { $stream->eof(); }); - $throws(function ($stream) { $stream->getSize(); }); - $throws(function ($stream) { $stream->getContents(); }); - $this->assertSame('', (string) $stream); - $stream->close(); - } - - public function testCloseClearProperties() - { - $handle = fopen('php://temp', 'r+'); - $stream = new Stream($handle); - $stream->close(); - - $this->assertFalse($stream->isSeekable()); - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->isWritable()); - $this->assertNull($stream->getSize()); - $this->assertEmpty($stream->getMetadata()); - } - - public function testDoesNotThrowInToString() - { - $s = \GuzzleHttp\Psr7\stream_for('foo'); - $s = new NoSeekStream($s); - $this->assertEquals('foo', (string) $s); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php b/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php deleted file mode 100644 index 0156e59..0000000 --- a/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php +++ /dev/null @@ -1,100 +0,0 @@ -assertSame('foo', fread($handle, 3)); - $this->assertSame(3, ftell($handle)); - $this->assertSame(3, fwrite($handle, 'bar')); - $this->assertSame(0, fseek($handle, 0)); - $this->assertSame('foobar', fread($handle, 6)); - $this->assertSame('', fread($handle, 1)); - $this->assertTrue(feof($handle)); - - // This fails on HHVM for some reason - if (!defined('HHVM_VERSION')) { - $this->assertEquals([ - 'dev' => 0, - 'ino' => 0, - 'mode' => 33206, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 6, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0, - 0 => 0, - 1 => 0, - 2 => 33206, - 3 => 0, - 4 => 0, - 5 => 0, - 6 => 0, - 7 => 6, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => 0, - 12 => 0, - ], fstat($handle)); - } - - $this->assertTrue(fclose($handle)); - $this->assertSame('foobar', (string) $stream); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesStream() - { - $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $stream->expects($this->once()) - ->method('isWritable') - ->will($this->returnValue(false)); - StreamWrapper::getResource($stream); - } - - /** - * @expectedException \PHPUnit_Framework_Error_Warning - */ - public function testReturnsFalseWhenStreamDoesNotExist() - { - fopen('guzzle://foo', 'r'); - } - - public function testCanOpenReadonlyStream() - { - $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $stream->expects($this->once()) - ->method('isWritable') - ->will($this->returnValue(true)); - $r = StreamWrapper::getResource($stream); - $this->assertInternalType('resource', $r); - fclose($r); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/UriTest.php b/vendor/guzzlehttp/psr7/tests/UriTest.php deleted file mode 100644 index 2776920..0000000 --- a/vendor/guzzlehttp/psr7/tests/UriTest.php +++ /dev/null @@ -1,247 +0,0 @@ -assertEquals( - 'https://michael:test@test.com/path/123?q=abc#test', - (string) $uri - ); - - $this->assertEquals('test', $uri->getFragment()); - $this->assertEquals('test.com', $uri->getHost()); - $this->assertEquals('/path/123', $uri->getPath()); - $this->assertEquals(null, $uri->getPort()); - $this->assertEquals('q=abc', $uri->getQuery()); - $this->assertEquals('https', $uri->getScheme()); - $this->assertEquals('michael:test', $uri->getUserInfo()); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unable to parse URI - */ - public function testValidatesUriCanBeParsed() - { - new Uri('///'); - } - - public function testCanTransformAndRetrievePartsIndividually() - { - $uri = (new Uri('')) - ->withFragment('#test') - ->withHost('example.com') - ->withPath('path/123') - ->withPort(8080) - ->withQuery('?q=abc') - ->withScheme('http') - ->withUserInfo('user', 'pass'); - - // Test getters. - $this->assertEquals('user:pass@example.com:8080', $uri->getAuthority()); - $this->assertEquals('test', $uri->getFragment()); - $this->assertEquals('example.com', $uri->getHost()); - $this->assertEquals('path/123', $uri->getPath()); - $this->assertEquals(8080, $uri->getPort()); - $this->assertEquals('q=abc', $uri->getQuery()); - $this->assertEquals('http', $uri->getScheme()); - $this->assertEquals('user:pass', $uri->getUserInfo()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testPortMustBeValid() - { - (new Uri(''))->withPort(100000); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testPathMustBeValid() - { - (new Uri(''))->withPath([]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testQueryMustBeValid() - { - (new Uri(''))->withQuery(new \stdClass); - } - - public function testAllowsFalseyUrlParts() - { - $url = new Uri('http://a:1/0?0#0'); - $this->assertSame('a', $url->getHost()); - $this->assertEquals(1, $url->getPort()); - $this->assertSame('/0', $url->getPath()); - $this->assertEquals('0', (string) $url->getQuery()); - $this->assertSame('0', $url->getFragment()); - $this->assertEquals('http://a:1/0?0#0', (string) $url); - $url = new Uri(''); - $this->assertSame('', (string) $url); - $url = new Uri('0'); - $this->assertSame('0', (string) $url); - $url = new Uri('/'); - $this->assertSame('/', (string) $url); - } - - /** - * @dataProvider getResolveTestCases - */ - public function testResolvesUris($base, $rel, $expected) - { - $uri = new Uri($base); - $actual = Uri::resolve($uri, $rel); - $this->assertEquals($expected, (string) $actual); - } - - public function getResolveTestCases() - { - return [ - //[self::RFC3986_BASE, 'g:h', 'g:h'], - [self::RFC3986_BASE, 'g', 'http://a/b/c/g'], - [self::RFC3986_BASE, './g', 'http://a/b/c/g'], - [self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'], - [self::RFC3986_BASE, '/g', 'http://a/g'], - [self::RFC3986_BASE, '//g', 'http://g'], - [self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'], - [self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'], - [self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'], - [self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'], - [self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'], - [self::RFC3986_BASE, ';x', 'http://a/b/c/;x'], - [self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'], - [self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'], - [self::RFC3986_BASE, '', self::RFC3986_BASE], - [self::RFC3986_BASE, '.', 'http://a/b/c/'], - [self::RFC3986_BASE, './', 'http://a/b/c/'], - [self::RFC3986_BASE, '..', 'http://a/b/'], - [self::RFC3986_BASE, '../', 'http://a/b/'], - [self::RFC3986_BASE, '../g', 'http://a/b/g'], - [self::RFC3986_BASE, '../..', 'http://a/'], - [self::RFC3986_BASE, '../../', 'http://a/'], - [self::RFC3986_BASE, '../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../../g', 'http://a/g'], - [self::RFC3986_BASE, '/./g', 'http://a/g'], - [self::RFC3986_BASE, '/../g', 'http://a/g'], - [self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'], - [self::RFC3986_BASE, '.g', 'http://a/b/c/.g'], - [self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'], - [self::RFC3986_BASE, '..g', 'http://a/b/c/..g'], - [self::RFC3986_BASE, './../g', 'http://a/b/g'], - [self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'], - [self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'], - [self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'], - [self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'], - [self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'], - [self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'], - ['http://u@a/b/c/d;p?q', '.', 'http://u@a/b/c/'], - ['http://u:p@a/b/c/d;p?q', '.', 'http://u:p@a/b/c/'], - //[self::RFC3986_BASE, 'http:g', 'http:g'], - ]; - } - - public function testAddAndRemoveQueryValues() - { - $uri = new Uri('http://foo.com/bar'); - $uri = Uri::withQueryValue($uri, 'a', 'b'); - $uri = Uri::withQueryValue($uri, 'c', 'd'); - $uri = Uri::withQueryValue($uri, 'e', null); - $this->assertEquals('a=b&c=d&e', $uri->getQuery()); - - $uri = Uri::withoutQueryValue($uri, 'c'); - $uri = Uri::withoutQueryValue($uri, 'e'); - $this->assertEquals('a=b', $uri->getQuery()); - $uri = Uri::withoutQueryValue($uri, 'a'); - $uri = Uri::withoutQueryValue($uri, 'a'); - $this->assertEquals('', $uri->getQuery()); - } - - public function testGetAuthorityReturnsCorrectPort() - { - // HTTPS non-standard port - $uri = new Uri('https://foo.co:99'); - $this->assertEquals('foo.co:99', $uri->getAuthority()); - - // HTTP non-standard port - $uri = new Uri('http://foo.co:99'); - $this->assertEquals('foo.co:99', $uri->getAuthority()); - - // No scheme - $uri = new Uri('foo.co:99'); - $this->assertEquals('foo.co:99', $uri->getAuthority()); - - // No host or port - $uri = new Uri('http:'); - $this->assertEquals('', $uri->getAuthority()); - - // No host or port - $uri = new Uri('http://foo.co'); - $this->assertEquals('foo.co', $uri->getAuthority()); - } - - public function pathTestProvider() - { - return [ - // Percent encode spaces. - ['http://foo.com/baz bar', 'http://foo.com/baz%20bar'], - // Don't encoding something that's already encoded. - ['http://foo.com/baz%20bar', 'http://foo.com/baz%20bar'], - // Percent encode invalid percent encodings - ['http://foo.com/baz%2-bar', 'http://foo.com/baz%252-bar'], - // Don't encode path segments - ['http://foo.com/baz/bar/bam?a', 'http://foo.com/baz/bar/bam?a'], - ['http://foo.com/baz+bar', 'http://foo.com/baz+bar'], - ['http://foo.com/baz:bar', 'http://foo.com/baz:bar'], - ['http://foo.com/baz@bar', 'http://foo.com/baz@bar'], - ['http://foo.com/baz(bar);bam/', 'http://foo.com/baz(bar);bam/'], - ['http://foo.com/a-zA-Z0-9.-_~!$&\'()*+,;=:@', 'http://foo.com/a-zA-Z0-9.-_~!$&\'()*+,;=:@'], - ]; - } - - /** - * @dataProvider pathTestProvider - */ - public function testUriEncodesPathProperly($input, $output) - { - $uri = new Uri($input); - $this->assertEquals((string) $uri, $output); - } - - public function testDoesNotAddPortWhenNoPort() - { - $this->assertEquals('bar', new Uri('//bar')); - $this->assertEquals('bar', (new Uri('//bar'))->getHost()); - } - - public function testAllowsForRelativeUri() - { - $uri = (new Uri)->withPath('foo'); - $this->assertEquals('foo', $uri->getPath()); - $this->assertEquals('foo', (string) $uri); - } - - public function testAddsSlashForRelativeUriStringWithHost() - { - $uri = (new Uri)->withPath('foo')->withHost('bar.com'); - $this->assertEquals('foo', $uri->getPath()); - $this->assertEquals('bar.com/foo', (string) $uri); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/bootstrap.php b/vendor/guzzlehttp/psr7/tests/bootstrap.php deleted file mode 100644 index 8601dd3..0000000 --- a/vendor/guzzlehttp/psr7/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -html5Elements as $element) { - $this->assertTrue(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element); - - $this->assertTrue(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - - $nonhtml5 = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonhtml5 as $element) { - $this->assertFalse(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element); - - $this->assertFalse(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - } - - public function testIsMathMLElement() - { - foreach ($this->mathmlElements as $element) { - $this->assertTrue(Elements::isMathMLElement($element), 'MathML element test failed on: ' . $element); - - // MathML is case sensetitive so these should all fail. - $this->assertFalse(Elements::isMathMLElement(strtoupper($element)), 'MathML element test failed on: ' . strtoupper($element)); - } - - $nonMathML = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonMathML as $element) { - $this->assertFalse(Elements::isMathMLElement($element), 'MathML element test failed on: ' . $element); - } - } - - public function testIsSvgElement() - { - foreach ($this->svgElements as $element) { - $this->assertTrue(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element); - - // SVG is case sensetitive so these should all fail. - $this->assertFalse(Elements::isSvgElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element)); - } - - $nonSVG = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonSVG as $element) { - $this->assertFalse(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element); - } - } - - public function testIsElement() - { - foreach ($this->html5Elements as $element) { - $this->assertTrue(Elements::isElement($element), 'html5 element test failed on: ' . $element); - - $this->assertTrue(Elements::isElement(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - - foreach ($this->mathmlElements as $element) { - $this->assertTrue(Elements::isElement($element), 'MathML element test failed on: ' . $element); - - // MathML is case sensetitive so these should all fail. - $this->assertFalse(Elements::isElement(strtoupper($element)), 'MathML element test failed on: ' . strtoupper($element)); - } - - foreach ($this->svgElements as $element) { - $this->assertTrue(Elements::isElement($element), 'SVG element test failed on: ' . $element); - - // SVG is case sensetitive so these should all fail. But, there is duplication - // html5 and SVG. Since html5 is case insensetitive we need to make sure - // it's not a html5 element first. - if (! in_array($element, $this->html5Elements)) { - $this->assertFalse(Elements::isElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element)); - } - } - - $nonhtml5 = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonhtml5 as $element) { - $this->assertFalse(Elements::isElement($element), 'html5 element test failed on: ' . $element); - - $this->assertFalse(Elements::isElement(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - } - - public function testElement() - { - foreach ($this->html5Elements as $element) { - $this->assertGreaterThan(0, Elements::element($element)); - } - $nonhtml5 = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonhtml5 as $element) { - $this->assertFalse(Elements::element($element)); - } - } - - public function testIsA() - { - $this->assertTrue(Elements::isA('script', Elements::KNOWN_ELEMENT)); - $this->assertFalse(Elements::isA('scriptypoo', Elements::KNOWN_ELEMENT)); - $this->assertTrue(Elements::isA('script', Elements::TEXT_RAW)); - $this->assertFalse(Elements::isA('script', Elements::TEXT_RCDATA)); - - $voidElements = array( - 'area', - 'base', - 'basefont', - 'bgsound', - 'br', - 'col', - 'command', - 'embed', - 'frame', - 'hr', - 'img' - ); - - foreach ($voidElements as $element) { - $this->assertTrue(Elements::isA($element, Elements::VOID_TAG), 'Void element test failed on: ' . $element); - } - - $nonVoid = array( - 'span', - 'a', - 'div' - ); - foreach ($nonVoid as $tag) { - $this->assertFalse(Elements::isA($tag, Elements::VOID_TAG), 'Void element test failed on: ' . $tag); - } - - $blockTags = array( - 'address', - 'article', - 'aside', - 'audio', - 'blockquote', - 'canvas', - 'dd', - 'div', - 'dl', - 'fieldset', - 'figcaption', - 'figure', - 'footer', - 'form', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'header', - 'hgroup', - 'hr', - 'noscript', - 'ol', - 'output', - 'p', - 'pre', - 'section', - 'table', - 'tfoot', - 'ul', - 'video' - ); - - foreach ($blockTags as $tag) { - $this->assertTrue(Elements::isA($tag, Elements::BLOCK_TAG), 'Block tag test failed on: ' . $tag); - } - - $nonBlockTags = array( - 'span', - 'img', - 'label' - ); - foreach ($nonBlockTags as $tag) { - $this->assertFalse(Elements::isA($tag, Elements::BLOCK_TAG), 'Block tag test failed on: ' . $tag); - } - } - - public function testNormalizeSvgElement() - { - $tests = array( - 'foo' => 'foo', - 'altglyph' => 'altGlyph', - 'BAR' => 'bar', - 'fespecularlighting' => 'feSpecularLighting', - 'bAz' => 'baz', - 'foreignobject' => 'foreignObject' - ); - - foreach ($tests as $input => $expected) { - $this->assertEquals($expected, Elements::normalizeSvgElement($input)); - } - } - - public function testNormalizeSvgAttribute() - { - $tests = array( - 'foo' => 'foo', - 'attributename' => 'attributeName', - 'BAR' => 'bar', - 'limitingconeangle' => 'limitingConeAngle', - 'bAz' => 'baz', - 'patterncontentunits' => 'patternContentUnits' - ); - - foreach ($tests as $input => $expected) { - $this->assertEquals($expected, Elements::normalizeSvgAttribute($input)); - } - } - - public function testNormalizeMathMlAttribute() - { - $tests = array( - 'foo' => 'foo', - 'definitionurl' => 'definitionURL', - 'BAR' => 'bar' - ); - - foreach ($tests as $input => $expected) { - $this->assertEquals($expected, Elements::normalizeMathMlAttribute($input)); - } - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Html5Test.html b/vendor/masterminds/html5/test/HTML5/Html5Test.html deleted file mode 100644 index a976e8b..0000000 --- a/vendor/masterminds/html5/test/HTML5/Html5Test.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Test - - -

This is a test.

- - \ No newline at end of file diff --git a/vendor/masterminds/html5/test/HTML5/Html5Test.php b/vendor/masterminds/html5/test/HTML5/Html5Test.php deleted file mode 100644 index cce58b7..0000000 --- a/vendor/masterminds/html5/test/HTML5/Html5Test.php +++ /dev/null @@ -1,401 +0,0 @@ -html5 = $this->getInstance(); - } - - /** - * Parse and serialize a string. - */ - protected function cycle($html) - { - $dom = $this->html5->loadHTML('' . $html . ''); - $out = $this->html5->saveHTML($dom); - - return $out; - } - - protected function cycleFragment($fragment) - { - $dom = $this->html5->loadHTMLFragment($fragment); - $out = $this->html5->saveHTML($dom); - - return $out; - } - - public function testLoadOptions() - { - // doc - $dom = $this->html5->loadHTML($this->wrap(''), array( - 'implicitNamespaces' => array('t' => 'http://example.com'), - "xmlNamespaces" => true - )); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - $this->assertFalse($this->html5->hasErrors()); - - $xpath = new \DOMXPath( $dom ); - $xpath->registerNamespace( "t", "http://example.com" ); - $this->assertEquals(1, $xpath->query( "//t:tag" )->length); - - // doc fragment - $frag = $this->html5->loadHTMLFragment('', array( - 'implicitNamespaces' => array('t' => 'http://example.com'), - "xmlNamespaces" => true - )); - $this->assertInstanceOf('\DOMDocumentFragment', $frag); - $this->assertEmpty($this->html5->getErrors()); - $this->assertFalse($this->html5->hasErrors()); - - $frag->ownerDocument->appendChild($frag); - $xpath = new \DOMXPath( $frag->ownerDocument ); - $xpath->registerNamespace( "t", "http://example.com" ); - $this->assertEquals(1, $xpath->query( "//t:tag" , $frag)->length); - } - - public function testErrors() - { - $dom = $this->html5->loadHTML(''); - $this->assertInstanceOf('\DOMDocument', $dom); - - $this->assertNotEmpty($this->html5->getErrors()); - $this->assertTrue($this->html5->hasErrors()); - } - - public function testLoad() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - $this->assertFalse($this->html5->hasErrors()); - - $file = fopen(__DIR__ . '/Html5Test.html', 'r'); - $dom = $this->html5->load($file); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - $dom = $this->html5->loadHTMLFile(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testLoadHTML() - { - $contents = file_get_contents(__DIR__ . '/Html5Test.html'); - $dom = $this->html5->loadHTML($contents); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testLoadHTMLFragment() - { - $fragment = '
Baz
'; - $dom = $this->html5->loadHTMLFragment($fragment); - $this->assertInstanceOf('\DOMDocumentFragment', $dom); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testSaveHTML() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - $saved = $this->html5->saveHTML($dom); - $this->assertRegExp('|

This is a test.

|', $saved); - } - - public function testSaveHTMLFragment() - { - $fragment = '
Baz
'; - $dom = $this->html5->loadHTMLFragment($fragment); - - $string = $this->html5->saveHTML($dom); - $this->assertEquals($fragment, $string); - } - - public function testSave() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - // Test resource - $file = fopen('php://temp', 'w'); - $this->html5->save($dom, $file); - $content = stream_get_contents($file, - 1, 0); - $this->assertRegExp('|

This is a test.

|', $content); - - // Test file - $tmpfname = tempnam(sys_get_temp_dir(), "html5-php"); - $this->html5->save($dom, $tmpfname); - $content = file_get_contents($tmpfname); - $this->assertRegExp('|

This is a test.

|', $content); - unlink($tmpfname); - } - - // This test reads a document into a dom, turn the dom into a document, - // then tries to read that document again. This makes sure we are reading, - // and generating a document that works at a high level. - public function testItWorks() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - $saved = $this->html5->saveHTML($dom); - - $dom2 = $this->html5->loadHTML($saved); - $this->assertInstanceOf('\DOMDocument', $dom2); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testConfig() - { - $html5 = $this->getInstance(); - $options = $html5->getOptions(); - $this->assertEquals(false, $options['encode_entities']); - - $html5 = $this->getInstance(array( - 'foo' => 'bar', - 'encode_entities' => true - )); - $options = $html5->getOptions(); - $this->assertEquals('bar', $options['foo']); - $this->assertEquals(true, $options['encode_entities']); - - // Need to reset to original so future tests pass as expected. - // $this->getInstance()->setOption('encode_entities', false); - } - - public function testSvg() - { - $dom = $this->html5->loadHTML( - ' - - -
foo bar baz
- - - - - - - Test Text. - - - - - '); - - $this->assertEmpty($this->html5->getErrors()); - - // Test a mixed case attribute. - $list = $dom->getElementsByTagName('svg'); - $this->assertNotEmpty($list->length); - $svg = $list->item(0); - $this->assertEquals("0 0 3 2", $svg->getAttribute('viewBox')); - $this->assertFalse($svg->hasAttribute('viewbox')); - - // Test a mixed case tag. - // Note: getElementsByTagName is not case sensetitive. - $list = $dom->getElementsByTagName('textPath'); - $this->assertNotEmpty($list->length); - $textPath = $list->item(0); - $this->assertEquals('textPath', $textPath->tagName); - $this->assertNotEquals('textpath', $textPath->tagName); - - $html = $this->html5->saveHTML($dom); - $this->assertRegExp('||', $html); - $this->assertRegExp('||', $html); - } - - public function testMathMl() - { - $dom = $this->html5->loadHTML( - ' - - -
foo bar baz
- - x - - ± - - y - - - '); - - $this->assertEmpty($this->html5->getErrors()); - $list = $dom->getElementsByTagName('math'); - $this->assertNotEmpty($list->length); - - $list = $dom->getElementsByTagName('div'); - $this->assertNotEmpty($list->length); - $div = $list->item(0); - $this->assertEquals('http://example.com', $div->getAttribute('definitionurl')); - $this->assertFalse($div->hasAttribute('definitionURL')); - $list = $dom->getElementsByTagName('csymbol'); - $csymbol = $list->item(0); - $this->assertEquals('http://www.example.com/mathops/multiops.html#plusminus', $csymbol->getAttribute('definitionURL')); - $this->assertFalse($csymbol->hasAttribute('definitionurl')); - - $html = $this->html5->saveHTML($dom); - $this->assertRegExp('||', $html); - $this->assertRegExp('|y|', $html); - } - - public function testUnknownElements() - { - // The : should not have special handling accourding to section 2.9 of the - // spec. This is differenant than XML. Since we don't know these elements - // they are handled as normal elements. Note, to do this is really - // an invalid example and you should not embed prefixed xml in html5. - $dom = $this->html5->loadHTMLFragment( - " - Big rectangle thing - 40 - 80 - - um, yeah"); - - $this->assertEmpty($this->html5->getErrors()); - $markup = $this->html5->saveHTML($dom); - $this->assertRegExp('|Big rectangle thing|', $markup); - $this->assertRegExp('|um, yeah|', $markup); - } - - public function testElements() - { - // Should have content. - $res = $this->cycle('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - - // Should be empty - $res = $this->cycle(''); - $this->assertRegExp('||', $res); - - // Should have content. - $res = $this->cycleFragment('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - - // Should be empty - $res = $this->cycleFragment(''); - $this->assertRegExp('||', $res); - - // Elements with dashes and underscores - $res = $this->cycleFragment(''); - $this->assertRegExp('||', $res); - $res = $this->cycleFragment(''); - $this->assertRegExp('||', $res); - - // Should have no closing tag. - $res = $this->cycle('
'); - $this->assertRegExp('|
|', $res); - } - - public function testAttributes() - { - $res = $this->cycle('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - - // XXX: Note that spec does NOT require attrs in the same order. - $res = $this->cycle('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - - $res = $this->cycle('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - - $res = $this->cycleFragment('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - - // XXX: Note that spec does NOT require attrs in the same order. - $res = $this->cycleFragment('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - - $res = $this->cycleFragment('
FOO
'); - $this->assertRegExp('|
FOO
|', $res); - } - - public function testPCData() - { - $res = $this->cycle('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - - $res = $this->cycleFragment('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - - $res = $this->cycle('This - is - a - test.'); - - // Check that newlines are there, but don't count spaces. - $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res); - - $res = $this->cycleFragment('This - is - a - test.'); - - // Check that newlines are there, but don't count spaces. - $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res); - - $res = $this->cycle('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - - $res = $this->cycleFragment('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - } - - public function testUnescaped() - { - $res = $this->cycle(''); - $this->assertRegExp('|2 < 1|', $res); - - $res = $this->cycle(''); - $this->assertRegExp('|div>div>div|', $res); - - $res = $this->cycleFragment(''); - $this->assertRegExp('|2 < 1|', $res); - - $res = $this->cycleFragment(''); - $this->assertRegExp('|div>div>div|', $res); - } - - public function testEntities() - { - $res = $this->cycle('Apples & bananas.'); - $this->assertRegExp('|Apples & bananas.|', $res); - - $res = $this->cycleFragment('Apples & bananas.'); - $this->assertRegExp('|Apples & bananas.|', $res); - - $res = $this->cycleFragment('

R&D

'); - $this->assertRegExp('|R&D|', $res); - } - - public function testComment() - { - $res = $this->cycle('ab'); - $this->assertRegExp('||', $res); - - $res = $this->cycleFragment('ab'); - $this->assertRegExp('||', $res); - } - - public function testCDATA() - { - $res = $this->cycle('a a test. ]]>b'); - $this->assertRegExp('| a test\. \]\]>|', $res); - - $res = $this->cycleFragment('a a test. ]]>b'); - $this->assertRegExp('| a test\. \]\]>|', $res); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php b/vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php deleted file mode 100644 index 762bcc2..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals('&', CharacterReference::lookupName('amp')); - $this->assertEquals('<', CharacterReference::lookupName('lt')); - $this->assertEquals('>', CharacterReference::lookupName('gt')); - $this->assertEquals('"', CharacterReference::lookupName('quot')); - $this->assertEquals('∌', CharacterReference::lookupName('NotReverseElement')); - - $this->assertNull(CharacterReference::lookupName('StinkyCheese')); - } - - public function testLookupHex() - { - $this->assertEquals('<', CharacterReference::lookupHex('3c')); - $this->assertEquals('<', CharacterReference::lookupHex('003c')); - $this->assertEquals('&', CharacterReference::lookupHex('26')); - $this->assertEquals('}', CharacterReference::lookupHex('7d')); - $this->assertEquals('Σ', CharacterReference::lookupHex('3A3')); - $this->assertEquals('Σ', CharacterReference::lookupHex('03A3')); - $this->assertEquals('Σ', CharacterReference::lookupHex('3a3')); - $this->assertEquals('Σ', CharacterReference::lookupHex('03a3')); - } - - public function testLookupDecimal() - { - $this->assertEquals('&', CharacterReference::lookupDecimal(38)); - $this->assertEquals('&', CharacterReference::lookupDecimal('38')); - $this->assertEquals('<', CharacterReference::lookupDecimal(60)); - $this->assertEquals('Σ', CharacterReference::lookupDecimal(931)); - $this->assertEquals('Σ', CharacterReference::lookupDecimal('0931')); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php b/vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php deleted file mode 100644 index b2a2d39..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php +++ /dev/null @@ -1,537 +0,0 @@ -parse(); - $this->errors = $treeBuilder->getErrors(); - - return $treeBuilder->document(); - } - - /** - * Utility function for parsing a fragment of HTML5. - */ - protected function parseFragment($string) - { - $treeBuilder = new DOMTreeBuilder(true); - $input = new StringInputStream($string); - $scanner = new Scanner($input); - $parser = new Tokenizer($scanner, $treeBuilder); - - $parser->parse(); - $this->errors = $treeBuilder->getErrors(); - - return $treeBuilder->fragment(); - } - - public function testDocument() - { - $html = ""; - $doc = $this->parse($html); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertEquals('html', $doc->documentElement->tagName); - $this->assertEquals('http://www.w3.org/1999/xhtml', $doc->documentElement->namespaceURI); - } - - public function testStrangeCapitalization() - { - $html = " - - - Hello, world! - - TheBody - "; - $doc = $this->parse($html); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertEquals('html', $doc->documentElement->tagName); - - $xpath = new \DOMXPath( $doc ); - $xpath->registerNamespace( "x", "http://www.w3.org/1999/xhtml" ); - - $this->assertEquals("Hello, world!", $xpath->query( "//x:title" )->item( 0 )->nodeValue); - $this->assertEquals("foo", $xpath->query( "//x:script" )->item( 0 )->nodeValue); - } - - public function testDocumentWithDisabledNamespaces() - { - $html = ""; - $doc = $this->parse($html, array('disable_html_ns' => true)); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertEquals('html', $doc->documentElement->tagName); - $this->assertNull($doc->documentElement->namespaceURI); - } - - public function testDocumentWithATargetDocument() - { - $targetDom = new \DOMDocument(); - - $html = ""; - $doc = $this->parse($html, array('target_document' => $targetDom)); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertSame($doc, $targetDom); - $this->assertEquals('html', $doc->documentElement->tagName); - } - - public function testDocumentFakeAttrAbsence() - { - $html = "foo"; - $doc = $this->parse($html, array('xmlNamespaces'=>true)); - - $xp = new \DOMXPath($doc); - $this->assertEquals(0, $xp->query("//@html5-php-fake-id-attribute")->length); - } - - public function testFragment() - { - $html = "
test
test2"; - $doc = $this->parseFragment($html); - - $this->assertInstanceOf('\DOMDocumentFragment', $doc); - $this->assertTrue($doc->hasChildNodes()); - $this->assertEquals('div', $doc->childNodes->item(0)->tagName); - $this->assertEquals('test', $doc->childNodes->item(0)->textContent); - $this->assertEquals('span', $doc->childNodes->item(1)->tagName); - $this->assertEquals('test2', $doc->childNodes->item(1)->textContent); - } - - public function testElements() - { - $html = ""; - $doc = $this->parse($html); - $root = $doc->documentElement; - - $this->assertEquals('html', $root->tagName); - $this->assertEquals('html', $root->localName); - $this->assertEquals('html', $root->nodeName); - - $this->assertEquals(2, $root->childNodes->length); - $kids = $root->childNodes; - - $this->assertEquals('head', $kids->item(0)->tagName); - $this->assertEquals('body', $kids->item(1)->tagName); - - $head = $kids->item(0); - $this->assertEquals(1, $head->childNodes->length); - $this->assertEquals('title', $head->childNodes->item(0)->tagName); - } - - public function testImplicitNamespaces() - { - $dom = $this->parse('foo'); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('xlink:href'); - $this->assertEquals('http://www.w3.org/1999/xlink', $attr->namespaceURI); - - $dom = $this->parse('foo'); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('xml:base'); - $this->assertEquals('http://www.w3.org/XML/1998/namespace', $attr->namespaceURI); - } - - public function testCustomImplicitNamespaces() - { - $dom = $this->parse('foo', array( - 'implicitNamespaces' => array( - 't' => 'http://www.example.com' - ) - )); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('t:href'); - $this->assertEquals('http://www.example.com', $attr->namespaceURI); - - $dom = $this->parse('foo', array( - 'implicitNamespaces' => array( - 't' => 'http://www.example.com' - ) - )); - $list = $dom->getElementsByTagNameNS('http://www.example.com', 'a'); - $this->assertEquals(1, $list->length); - } - - public function testXmlNamespaces() - { - $dom = $this->parse( - ' - - foo - -
foo
- ', array( - 'xmlNamespaces' => true - )); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('t:href'); - $this->assertEquals('http://www.example.com', $attr->namespaceURI); - - $list = $dom->getElementsByTagNameNS('http://www.example.com', 'body'); - $this->assertEquals(1, $list->length); - } - - public function testXmlNamespaceNesting() - { - $dom = $this->parse( - ' - - - - - - -
- - - - ', array( - 'xmlNamespaces' => true - )); - - - $this->assertEmpty($this->errors); - - $div = $dom->getElementById('div'); - $this->assertEquals('http://www.w3.org/1999/xhtml', $div->namespaceURI); - - $body = $dom->getElementById('body'); - $this->assertEquals('http://www.w3.org/1999/xhtml', $body->namespaceURI); - - $bar1 = $dom->getElementById('bar1'); - $this->assertEquals('http://www.prefixed.com/bar1', $bar1->namespaceURI); - - $bar2 = $dom->getElementById('bar2'); - $this->assertEquals("http://www.prefixed.com/bar2", $bar2->namespaceURI); - - $bar3 = $dom->getElementById('bar3'); - $this->assertEquals("http://www.w3.org/1999/xhtml", $bar3->namespaceURI); - - $bar4 = $dom->getElementById('bar4'); - $this->assertEquals("http://www.prefixed.com/bar4", $bar4->namespaceURI); - - $svg = $dom->getElementById('svg'); - $this->assertEquals("http://www.w3.org/2000/svg", $svg->namespaceURI); - - $prefixed = $dom->getElementById('prefixed'); - $this->assertEquals("http://www.prefixed.com", $prefixed->namespaceURI); - - $prefixed = $dom->getElementById('bar5'); - $this->assertEquals("http://www.prefixed.com/xn", $prefixed->namespaceURI); - - $prefixed = $dom->getElementById('bar5_x'); - $this->assertEquals("http://www.prefixed.com/bar5_x", $prefixed->namespaceURI); - } - - public function testMoveNonInlineElements() - { - $doc = $this->parse('

line1


line2

'); - $this->assertEquals('

line1


line2', $doc->saveXML($doc->documentElement), 'Move non-inline elements outside of inline containers.'); - - $doc = $this->parse('

line1

line2

'); - $this->assertEquals('

line1

line2
', $doc->saveXML($doc->documentElement), 'Move non-inline elements outside of inline containers.'); - } - - public function testAttributes() - { - $html = " - - - - "; - $doc = $this->parse($html); - $root = $doc->documentElement; - - $body = $root->GetElementsByTagName('body')->item(0); - $this->assertEquals('body', $body->tagName); - $this->assertTrue($body->hasAttributes()); - $this->assertEquals('a', $body->getAttribute('id')); - $this->assertEquals('b c', $body->getAttribute('class')); - - $body2 = $doc->getElementById('a'); - $this->assertEquals('body', $body2->tagName); - $this->assertEquals('a', $body2->getAttribute('id')); - } - - public function testSVGAttributes() - { - $html = " - - - - foo - - "; - $doc = $this->parse($html); - $root = $doc->documentElement; - - $svg = $root->getElementsByTagName('svg')->item(0); - $this->assertTrue($svg->hasAttribute('viewBox')); - - $rect = $root->getElementsByTagName('rect')->item(0); - $this->assertTrue($rect->hasAttribute('textLength')); - - $ac = $root->getElementsByTagName('animateColor'); - $this->assertEquals(1, $ac->length); - } - - public function testMathMLAttribute() - { - $html = ' - - - - x - - ± - - y - - - '; - - $doc = $this->parse($html); - $root = $doc->documentElement; - - $csymbol = $root->getElementsByTagName('csymbol')->item(0); - $this->assertTrue($csymbol->hasAttribute('definitionURL')); - } - - public function testMissingHtmlTag() - { - $html = "test"; - $doc = $this->parse($html); - - $this->assertEquals('html', $doc->documentElement->tagName); - $this->assertEquals('title', $doc->documentElement->childNodes->item(0)->tagName); - } - - public function testComment() - { - $html = ''; - - $doc = $this->parse($html); - - $comment = $doc->documentElement->childNodes->item(0); - $this->assertEquals(XML_COMMENT_NODE, $comment->nodeType); - $this->assertEquals("Hello World.", $comment->data); - - $html = ''; - $doc = $this->parse($html); - - $comment = $doc->childNodes->item(1); - $this->assertEquals(XML_COMMENT_NODE, $comment->nodeType); - $this->assertEquals("Hello World.", $comment->data); - - $comment = $doc->childNodes->item(2); - $this->assertEquals(XML_ELEMENT_NODE, $comment->nodeType); - $this->assertEquals("html", $comment->tagName); - } - - public function testCDATA() - { - $html = "test"; - $doc = $this->parse($html); - - $wrapper = $doc->getElementsByTagName('math')->item(0); - $this->assertEquals(1, $wrapper->childNodes->length); - $cdata = $wrapper->childNodes->item(0); - $this->assertEquals(XML_CDATA_SECTION_NODE, $cdata->nodeType); - $this->assertEquals('test', $cdata->data); - } - - public function testText() - { - $html = "test"; - $doc = $this->parse($html); - - $wrapper = $doc->getElementsByTagName('math')->item(0); - $this->assertEquals(1, $wrapper->childNodes->length); - $data = $wrapper->childNodes->item(0); - $this->assertEquals(XML_TEXT_NODE, $data->nodeType); - $this->assertEquals('test', $data->data); - - // The DomTreeBuilder has special handling for text when in before head mode. - $html = " - Foo"; - $doc = $this->parse($html); - $this->assertEquals('Line 0, Col 0: Unexpected text. Ignoring: Foo', $this->errors[0]); - $headElement = $doc->documentElement->firstChild; - $this->assertEquals('head', $headElement->tagName); - } - - public function testParseErrors() - { - $html = "test"; - $doc = $this->parse($html); - - // We're JUST testing that we can access errors. Actual testing of - // error messages happen in the Tokenizer's tests. - $this->assertGreaterThan(0, count($this->errors)); - $this->assertTrue(is_string($this->errors[0])); - } - - public function testProcessingInstruction() - { - // Test the simple case, which is where PIs are inserted into the DOM. - $doc = $this->parse('<!DOCTYPE html><html><?foo bar?>'); - $this->assertEquals(1, $doc->documentElement->childNodes->length); - $pi = $doc->documentElement->firstChild; - $this->assertInstanceOf('\DOMProcessingInstruction', $pi); - $this->assertEquals('foo', $pi->nodeName); - $this->assertEquals('bar', $pi->data); - - // Leading xml PIs should be ignored. - $doc = $this->parse('<?xml version="1.0"?><!DOCTYPE html><html><head></head></html>'); - - $this->assertEquals(2, $doc->childNodes->length); - $this->assertInstanceOf('\DOMDocumentType', $doc->childNodes->item(0)); - $this->assertInstanceOf('\DOMElement', $doc->childNodes->item(1)); - } - - public function testAutocloseP() - { - $html = "<!DOCTYPE html><html><body><p><figure></body></html>"; - $doc = $this->parse($html); - - $p = $doc->getElementsByTagName('p')->item(0); - $this->assertEquals(0, $p->childNodes->length); - $this->assertEquals('figure', $p->nextSibling->tagName); - } - - public function testAutocloseLI() - { - $html = '<!doctype html> - <html lang="en"> - <body> - <ul><li>Foo<li>Bar<li>Baz</ul> - </body> - </html>'; - - $doc = $this->parse($html); - $length = $doc->getElementsByTagName('ul')->item(0)->childNodes->length; - $this->assertEquals(3, $length); - } - - public function testMathML() - { - $html = '<!doctype html> - <html lang="en"> - <body> - <math xmlns="http://www.w3.org/1998/Math/MathML"> - <mi>x</mi> - <csymbol definitionurl="http://www.example.com/mathops/multiops.html#plusminus"> - <mo>&PlusMinus;</mo> - </csymbol> - <mi>y</mi> - </math> - </body> - </html>'; - - $doc = $this->parse($html); - $math = $doc->getElementsByTagName('math')->item(0); - $this->assertEquals('math', $math->tagName); - $this->assertEquals('math', $math->nodeName); - $this->assertEquals('math', $math->localName); - $this->assertEquals('http://www.w3.org/1998/Math/MathML', $math->namespaceURI); - } - - public function testSVG() - { - $html = '<!doctype html> - <html lang="en"> - <body> - <svg width="150" height="100" viewBox="0 0 3 2" xmlns="http://www.w3.org/2000/svg"> - <rect width="1" height="2" x="2" fill="#d2232c" /> - <text font-family="Verdana" font-size="32"> - <textpath xlink:href="#Foo"> - Test Text. - </textPath> - </text> - </svg> - </body> - </html>'; - - $doc = $this->parse($html); - $svg = $doc->getElementsByTagName('svg')->item(0); - $this->assertEquals('svg', $svg->tagName); - $this->assertEquals('svg', $svg->nodeName); - $this->assertEquals('svg', $svg->localName); - $this->assertEquals('http://www.w3.org/2000/svg', $svg->namespaceURI); - - $textPath = $doc->getElementsByTagName('textPath')->item(0); - $this->assertEquals('textPath', $textPath->tagName); - } - - public function testNoScript() - { - $html = '<!DOCTYPE html><html><head><noscript>No JS</noscript></head></html>'; - $doc = $this->parse($html); - $this->assertEmpty($this->errors); - $noscript = $doc->getElementsByTagName('noscript')->item(0); - $this->assertEquals('noscript', $noscript->tagName); - } - - /** - * Regression for issue #13 - */ - public function testRegressionHTMLNoBody() - { - $html = '<!DOCTYPE html><html><span id="test">Test</span></html>'; - $doc = $this->parse($html); - $span = $doc->getElementById('test'); - - $this->assertEmpty($this->errors); - - $this->assertEquals('span', $span->tagName); - $this->assertEquals('Test', $span->textContent); - } - - public function testInstructionProcessor() - { - $string = '<!DOCTYPE html><html><?foo bar ?></html>'; - - $treeBuilder = new DOMTreeBuilder(); - $is = new InstructionProcessorMock(); - $treeBuilder->setInstructionProcessor($is); - - $input = new StringInputStream($string); - $scanner = new Scanner($input); - $parser = new Tokenizer($scanner, $treeBuilder); - - $parser->parse(); - $dom = $treeBuilder->document(); - $div = $dom->getElementsByTagName('div')->item(0); - - $this->assertEquals(1, $is->count); - $this->assertEquals('foo', $is->name); - $this->assertEquals('bar ', $is->data); - $this->assertEquals('div', $div->tagName); - $this->assertEquals('foo', $div->textContent); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/EventStack.php b/vendor/masterminds/html5/test/HTML5/Parser/EventStack.php deleted file mode 100644 index 60e2abe..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/EventStack.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Elements; -use Masterminds\HTML5\Parser\EventHandler; - -/** - * This testing class gathers events from a parser and builds a stack of events. - * It is useful for checking the output of a tokenizer. - * - * IMPORTANT: - * - * The startTag event also kicks the parser into TEXT_RAW when it encounters - * script or pre tags. This is to match the behavior required by the HTML5 spec, - * which says that the tree builder must tell the tokenizer when to switch states. - */ -class EventStack implements EventHandler -{ - - protected $stack; - - public function __construct() - { - $this->stack = array(); - } - - /** - * Get the event stack. - */ - public function events() - { - return $this->stack; - } - - public function depth() - { - return count($this->stack); - } - - public function get($index) - { - return $this->stack[$index]; - } - - protected function store($event, $data = null) - { - $this->stack[] = array( - 'name' => $event, - 'data' => $data - ); - } - - public function doctype($name, $type = 0, $id = null, $quirks = false) - { - $args = array( - $name, - $type, - $id, - $quirks - ); - $this->store('doctype', $args); - } - - public function startTag($name, $attributes = array(), $selfClosing = false) - { - $args = func_get_args(); - $this->store('startTag', $args); - if ($name == 'pre' || $name == 'script') { - return Elements::TEXT_RAW; - } - } - - public function endTag($name) - { - $this->store('endTag', array( - $name - )); - } - - public function comment($cdata) - { - $this->store('comment', array( - $cdata - )); - } - - public function cdata($data) - { - $this->store('cdata', func_get_args()); - } - - public function text($cdata) - { - // fprintf(STDOUT, "Received TEXT event with: " . $cdata); - $this->store('text', array( - $cdata - )); - } - - public function eof() - { - $this->store('eof'); - } - - public function parseError($msg, $line, $col) - { - // throw new EventStackParseError(sprintf("%s (line %d, col %d)", $msg, $line, $col)); - // $this->store(sprintf("%s (line %d, col %d)", $msg, $line, $col)); - $this->store('error', func_get_args()); - } - - public function processingInstruction($name, $data = null) - { - $this->store('pi', func_get_args()); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php b/vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php deleted file mode 100644 index e58fdff..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -class EventStackError extends \Exception -{ -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.html b/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.html deleted file mode 100644 index a976e8b..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.html +++ /dev/null @@ -1,10 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <title>Test</title> - </head> - <body> - <p>This is a test.</p> - </body> -</html> \ No newline at end of file diff --git a/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.php b/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.php deleted file mode 100644 index 71dd828..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.php +++ /dev/null @@ -1,195 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\FileInputStream; - -class FileInputStreamTest extends \Masterminds\HTML5\Tests\TestCase -{ - - public function testConstruct() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertInstanceOf('\Masterminds\HTML5\Parser\FileInputStream', $s); - } - - public function testNext() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $s->next(); - $this->assertEquals('!', $s->current()); - $s->next(); - $this->assertEquals('d', $s->current()); - } - - public function testKey() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals(0, $s->key()); - - $s->next(); - $this->assertEquals(1, $s->key()); - } - - public function testPeek() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('!', $s->peek()); - - $s->next(); - $this->assertEquals('d', $s->peek()); - } - - public function testCurrent() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('<', $s->current()); - - $s->next(); - $this->assertEquals('!', $s->current()); - - $s->next(); - $this->assertEquals('d', $s->current()); - } - - public function testColumnOffset() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $this->assertEquals(1, $s->columnOffset()); - $s->next(); - $this->assertEquals(2, $s->columnOffset()); - $s->next(); - $this->assertEquals(3, $s->columnOffset()); - - // Make sure we get to the second line - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(0, $s->columnOffset()); - - $s->next(); - $canary = $s->current(); // h - $this->assertEquals('h', $canary); - $this->assertEquals(1, $s->columnOffset()); - } - - public function testCurrentLine() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals(1, $s->currentLine()); - - // Make sure we get to the second line - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(2, $s->currentLine()); - - // Make sure we get to the third line - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(3, $s->currentLine()); - } - - public function testRemainingChars() - { - $text = file_get_contents(__DIR__ . '/FileInputStreamTest.html'); - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - $this->assertEquals($text, $s->remainingChars()); - - $text = substr(file_get_contents(__DIR__ . '/FileInputStreamTest.html'), 1); - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - $s->next(); // Pop one. - $this->assertEquals($text, $s->remainingChars()); - } - - public function testCharsUnitl() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('', $s->charsUntil('<')); - // Pointer at '<', moves to ' ' - $this->assertEquals('<!doctype', $s->charsUntil(' ', 20)); - - // Pointer at ' ', moves to '>' - $this->assertEquals(' html', $s->charsUntil('>')); - - // Pointer at '>', moves to '\n'. - $this->assertEquals('>', $s->charsUntil("\n")); - - // Pointer at '\n', move forward then to the next'\n'. - $s->next(); - $this->assertEquals('<html lang="en">', $s->charsUntil("\n")); - - // Ony get one of the spaces. - $this->assertEquals("\n ", $s->charsUntil('<', 2)); - - // Get the other space. - $this->assertEquals(" ", $s->charsUntil('<')); - - // This should scan to the end of the file. - $text = "<head> - <meta charset=\"utf-8\"> - <title>Test</title> - </head> - <body> - <p>This is a test.</p> - </body> -</html>"; - $this->assertEquals($text, $s->charsUntil("\t")); - } - - public function testCharsWhile() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('<!', $s->charsWhile('!<')); - $this->assertEquals('', $s->charsWhile('>')); - $this->assertEquals('doctype', $s->charsWhile('odcyept')); - $this->assertEquals(' htm', $s->charsWhile('html ', 4)); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php b/vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php deleted file mode 100644 index 32a2204..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -class InstructionProcessorMock implements \Masterminds\HTML5\InstructionProcessor -{ - - public $name = null; - - public $data = null; - - public $count = 0; - - public function process(\DOMElement $element, $name, $data) - { - $this->name = $name; - $this->data = $data; - $this->count ++; - - $div = $element->ownerDocument->createElement("div"); - $div->nodeValue = 'foo'; - - $element->appendChild($div); - - return $div; - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php b/vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php deleted file mode 100644 index 8fa5110..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php +++ /dev/null @@ -1,171 +0,0 @@ -<?php -/** - * @file - * Test the Scanner. This requires the InputStream tests are all good. - */ -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\StringInputStream; -use Masterminds\HTML5\Parser\Scanner; - -class ScannerTest extends \Masterminds\HTML5\Tests\TestCase -{ - - /** - * A canary test to make sure the basics are setup and working. - */ - public function testConstruct() - { - $is = new StringInputStream("abc"); - $s = new Scanner($is); - - $this->assertInstanceOf('\Masterminds\HTML5\Parser\Scanner', $s); - } - - public function testNext() - { - $s = new Scanner(new StringInputStream("abc")); - - $this->assertEquals('b', $s->next()); - $this->assertEquals('c', $s->next()); - } - - public function testPosition() - { - $s = new Scanner(new StringInputStream("abc")); - - $this->assertEquals(0, $s->position()); - - $s->next(); - $this->assertEquals(1, $s->position()); - } - - public function testPeek() - { - $s = new Scanner(new StringInputStream("abc")); - - $this->assertEquals('b', $s->peek()); - - $s->next(); - $this->assertEquals('c', $s->peek()); - } - - public function testCurrent() - { - $s = new Scanner(new StringInputStream("abc")); - - // Before scanning the string begins the current is empty. - $this->assertEquals('a', $s->current()); - - $c = $s->next(); - $this->assertEquals('b', $s->current()); - - // Test movement through the string. - $c = $s->next(); - $this->assertEquals('c', $s->current()); - } - - public function testUnconsume() - { - $s = new Scanner(new StringInputStream("abcdefghijklmnopqrst")); - - // Get initial position. - $s->next(); - $start = $s->position(); - - // Move forward a bunch of positions. - $amount = 7; - for ($i = 0; $i < $amount; $i ++) { - $s->next(); - } - - // Roll back the amount we moved forward. - $s->unconsume($amount); - - $this->assertEquals($start, $s->position()); - } - - public function testGetHex() - { - $s = new Scanner(new StringInputStream("ab13ck45DE*")); - - $this->assertEquals('ab13c', $s->getHex()); - - $s->next(); - $this->assertEquals('45DE', $s->getHex()); - } - - public function testGetAsciiAlpha() - { - $s = new Scanner(new StringInputStream("abcdef1%mnop*")); - - $this->assertEquals('abcdef', $s->getAsciiAlpha()); - - // Move past the 1% to scan the next group of text. - $s->next(); - $s->next(); - $this->assertEquals('mnop', $s->getAsciiAlpha()); - } - - public function testGetAsciiAlphaNum() - { - $s = new Scanner(new StringInputStream("abcdef1ghpo#mn94op")); - - $this->assertEquals('abcdef1ghpo', $s->getAsciiAlphaNum()); - - // Move past the # to scan the next group of text. - $s->next(); - $this->assertEquals('mn94op', $s->getAsciiAlphaNum()); - } - - public function testGetNumeric() - { - $s = new Scanner(new StringInputStream("1784a 45 9867 #")); - - $this->assertEquals('1784', $s->getNumeric()); - - // Move past the 'a ' to scan the next group of text. - $s->next(); - $s->next(); - $this->assertEquals('45', $s->getNumeric()); - } - - public function testCurrentLine() - { - $s = new Scanner(new StringInputStream("1784a\n45\n9867 #\nThis is a test.")); - - $this->assertEquals(1, $s->currentLine()); - - // Move to the next line. - $s->getAsciiAlphaNum(); - $s->next(); - $this->assertEquals(2, $s->currentLine()); - } - - public function testColumnOffset() - { - $s = new Scanner(new StringInputStream("1784a a\n45 9867 #\nThis is a test.")); - - // Move the pointer to the space. - $s->getAsciiAlphaNum(); - $this->assertEquals(5, $s->columnOffset()); - - // We move the pointer ahead. There must be a better way to do this. - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(3, $s->columnOffset()); - } - - public function testRemainingChars() - { - $string = "\n45\n9867 #\nThis is a test."; - $s = new Scanner(new StringInputStream("1784a\n45\n9867 #\nThis is a test.")); - - $s->getAsciiAlphaNum(); - $this->assertEquals($string, $s->remainingChars()); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php b/vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php deleted file mode 100644 index f87cc10..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php +++ /dev/null @@ -1,327 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\StringInputStream; - -class StringInputStreamTest extends \Masterminds\HTML5\Tests\TestCase -{ - - /** - * A canary test to make sure the basics are setup and working. - */ - public function testConstruct() - { - $s = new StringInputStream("abc"); - - $this->assertInstanceOf('\Masterminds\HTML5\Parser\StringInputStream', $s); - } - - public function testNext() - { - $s = new StringInputStream("abc"); - - $s->next(); - $this->assertEquals('b', $s->current()); - $s->next(); - $this->assertEquals('c', $s->current()); - } - - public function testKey() - { - $s = new StringInputStream("abc"); - - $this->assertEquals(0, $s->key()); - - $s->next(); - $this->assertEquals(1, $s->key()); - } - - public function testPeek() - { - $s = new StringInputStream("abc"); - - $this->assertEquals('b', $s->peek()); - - $s->next(); - $this->assertEquals('c', $s->peek()); - } - - public function testCurrent() - { - $s = new StringInputStream("abc"); - - // Before scanning the string begins the current is empty. - $this->assertEquals('a', $s->current()); - - $s->next(); - $this->assertEquals('b', $s->current()); - - // Test movement through the string. - $s->next(); - $this->assertEquals('c', $s->current()); - } - - public function testColumnOffset() - { - $s = new StringInputStream("abc\ndef\n"); - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $this->assertEquals(1, $s->columnOffset()); - $s->next(); - $this->assertEquals(2, $s->columnOffset()); - $s->next(); - $this->assertEquals(3, $s->columnOffset()); - $s->next(); // LF - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $canary = $s->current(); // e - $this->assertEquals('e', $canary); - $this->assertEquals(1, $s->columnOffset()); - - $s = new StringInputStream("abc"); - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $this->assertEquals(1, $s->columnOffset()); - $s->next(); - $this->assertEquals(2, $s->columnOffset()); - } - - public function testCurrentLine() - { - $txt = "1\n2\n\n\n\n3"; - $stream = new StringInputStream($txt); - $this->assertEquals(1, $stream->currentLine()); - - // Advance over 1 and LF on to line 2 value 2. - $stream->next(); - $stream->next(); - $canary = $stream->current(); - $this->assertEquals(2, $stream->currentLine()); - $this->assertEquals('2', $canary); - - // Advance over 4x LF - $stream->next(); - $stream->next(); - $stream->next(); - $stream->next(); - $stream->next(); - $this->assertEquals(6, $stream->currentLine()); - $this->assertEquals('3', $stream->current()); - - // Make sure it doesn't do 7. - $this->assertEquals(6, $stream->currentLine()); - } - - public function testRemainingChars() - { - $text = "abcd"; - $s = new StringInputStream($text); - $this->assertEquals($text, $s->remainingChars()); - - $text = "abcd"; - $s = new StringInputStream($text); - $s->next(); // Pop one. - $this->assertEquals('bcd', $s->remainingChars()); - } - - public function testCharsUnitl() - { - $text = "abcdefffffffghi"; - $s = new StringInputStream($text); - $this->assertEquals('', $s->charsUntil('a')); - // Pointer at 'a', moves 2 to 'c' - $this->assertEquals('ab', $s->charsUntil('w', 2)); - - // Pointer at 'c', moves to first 'f' - $this->assertEquals('cde', $s->charsUntil('fzxv')); - - // Only get five 'f's - $this->assertEquals('fffff', $s->charsUntil('g', 5)); - - // Get just the last two 'f's - $this->assertEquals('ff', $s->charsUntil('g')); - - // This should scan to the end. - $this->assertEquals('ghi', $s->charsUntil('w', 9)); - } - - public function testCharsWhile() - { - $text = "abcdefffffffghi"; - $s = new StringInputStream($text); - - $this->assertEquals('ab', $s->charsWhile('ba')); - - $this->assertEquals('', $s->charsWhile('a')); - $this->assertEquals('cde', $s->charsWhile('cdeba')); - $this->assertEquals('ff', $s->charsWhile('f', 2)); - $this->assertEquals('fffff', $s->charsWhile('f')); - $this->assertEquals('g', $s->charsWhile('fg')); - $this->assertEquals('hi', $s->charsWhile('fghi', 99)); - } - - public function testBOM() - { - // Ignore in-text BOM. - $stream = new StringInputStream("a\xEF\xBB\xBF"); - $this->assertEquals("a\xEF\xBB\xBF", $stream->remainingChars(), 'A non-leading U+FEFF (BOM/ZWNBSP) should remain'); - - // Strip leading BOM - $leading = new StringInputStream("\xEF\xBB\xBFa"); - $this->assertEquals('a', $leading->current(), 'BOM should be stripped'); - } - - public function testCarriageReturn() - { - // Replace NULL with Unicode replacement. - $stream = new StringInputStream("\0\0\0"); - $this->assertEquals("\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD", $stream->remainingChars(), 'Null character should be replaced by U+FFFD'); - $this->assertEquals(3, count($stream->errors), 'Null character should set parse error: ' . print_r($stream->errors, true)); - - // Remove CR when next to LF. - $stream = new StringInputStream("\r\n"); - $this->assertEquals("\n", $stream->remainingChars(), 'CRLF should be replaced by LF'); - - // Convert CR to LF when on its own. - $stream = new StringInputStream("\r"); - $this->assertEquals("\n", $stream->remainingChars(), 'CR should be replaced by LF'); - } - - public function invalidParseErrorTestHandler($input, $numErrors, $name) - { - $stream = new StringInputStream($input, 'UTF-8'); - $this->assertEquals($input, $stream->remainingChars(), $name . ' (stream content)'); - $this->assertEquals($numErrors, count($stream->errors), $name . ' (number of errors)'); - } - - public function testInvalidReplace() - { - $invalidTest = array( - - // Min/max overlong - "\xC0\x80a" => 'Overlong representation of U+0000', - "\xE0\x80\x80a" => 'Overlong representation of U+0000', - "\xF0\x80\x80\x80a" => 'Overlong representation of U+0000', - "\xF8\x80\x80\x80\x80a" => 'Overlong representation of U+0000', - "\xFC\x80\x80\x80\x80\x80a" => 'Overlong representation of U+0000', - "\xC1\xBFa" => 'Overlong representation of U+007F', - "\xE0\x9F\xBFa" => 'Overlong representation of U+07FF', - "\xF0\x8F\xBF\xBFa" => 'Overlong representation of U+FFFF', - - "a\xDF" => 'Incomplete two byte sequence (missing final byte)', - "a\xEF\xBF" => 'Incomplete three byte sequence (missing final byte)', - "a\xF4\xBF\xBF" => 'Incomplete four byte sequence (missing final byte)', - - // Min/max continuation bytes - "a\x80" => 'Lone 80 continuation byte', - "a\xBF" => 'Lone BF continuation byte', - - // Invalid bytes (these can never occur) - "a\xFE" => 'Invalid FE byte', - "a\xFF" => 'Invalid FF byte' - ); - foreach ($invalidTest as $test => $note) { - $stream = new StringInputStream($test); - $this->assertEquals('a', $stream->remainingChars(), $note); - } - - // MPB: - // It appears that iconv just leaves these alone. Not sure what to - // do. - /* - * $converted = array( "a\xF5\x90\x80\x80" => 'U+110000, off unicode planes.', ); foreach ($converted as $test => $note) { $stream = new StringInputStream($test); $this->assertEquals(2, mb_strlen($stream->remainingChars()), $note); } - */ - } - - public function testInvalidParseError() - { - // C0 controls (except U+0000 and U+000D due to different handling) - $this->invalidParseErrorTestHandler("\x01", 1, 'U+0001 (C0 control)'); - $this->invalidParseErrorTestHandler("\x02", 1, 'U+0002 (C0 control)'); - $this->invalidParseErrorTestHandler("\x03", 1, 'U+0003 (C0 control)'); - $this->invalidParseErrorTestHandler("\x04", 1, 'U+0004 (C0 control)'); - $this->invalidParseErrorTestHandler("\x05", 1, 'U+0005 (C0 control)'); - $this->invalidParseErrorTestHandler("\x06", 1, 'U+0006 (C0 control)'); - $this->invalidParseErrorTestHandler("\x07", 1, 'U+0007 (C0 control)'); - $this->invalidParseErrorTestHandler("\x08", 1, 'U+0008 (C0 control)'); - $this->invalidParseErrorTestHandler("\x09", 0, 'U+0009 (C0 control)'); - $this->invalidParseErrorTestHandler("\x0A", 0, 'U+000A (C0 control)'); - $this->invalidParseErrorTestHandler("\x0B", 1, 'U+000B (C0 control)'); - $this->invalidParseErrorTestHandler("\x0C", 0, 'U+000C (C0 control)'); - $this->invalidParseErrorTestHandler("\x0E", 1, 'U+000E (C0 control)'); - $this->invalidParseErrorTestHandler("\x0F", 1, 'U+000F (C0 control)'); - $this->invalidParseErrorTestHandler("\x10", 1, 'U+0010 (C0 control)'); - $this->invalidParseErrorTestHandler("\x11", 1, 'U+0011 (C0 control)'); - $this->invalidParseErrorTestHandler("\x12", 1, 'U+0012 (C0 control)'); - $this->invalidParseErrorTestHandler("\x13", 1, 'U+0013 (C0 control)'); - $this->invalidParseErrorTestHandler("\x14", 1, 'U+0014 (C0 control)'); - $this->invalidParseErrorTestHandler("\x15", 1, 'U+0015 (C0 control)'); - $this->invalidParseErrorTestHandler("\x16", 1, 'U+0016 (C0 control)'); - $this->invalidParseErrorTestHandler("\x17", 1, 'U+0017 (C0 control)'); - $this->invalidParseErrorTestHandler("\x18", 1, 'U+0018 (C0 control)'); - $this->invalidParseErrorTestHandler("\x19", 1, 'U+0019 (C0 control)'); - $this->invalidParseErrorTestHandler("\x1A", 1, 'U+001A (C0 control)'); - $this->invalidParseErrorTestHandler("\x1B", 1, 'U+001B (C0 control)'); - $this->invalidParseErrorTestHandler("\x1C", 1, 'U+001C (C0 control)'); - $this->invalidParseErrorTestHandler("\x1D", 1, 'U+001D (C0 control)'); - $this->invalidParseErrorTestHandler("\x1E", 1, 'U+001E (C0 control)'); - $this->invalidParseErrorTestHandler("\x1F", 1, 'U+001F (C0 control)'); - - // DEL (U+007F) - $this->invalidParseErrorTestHandler("\x7F", 1, 'U+007F'); - - // C1 Controls - $this->invalidParseErrorTestHandler("\xC2\x80", 1, 'U+0080 (C1 control)'); - $this->invalidParseErrorTestHandler("\xC2\x9F", 1, 'U+009F (C1 control)'); - $this->invalidParseErrorTestHandler("\xC2\xA0", 0, 'U+00A0 (first codepoint above highest C1 control)'); - - // Charcters surrounding surrogates - $this->invalidParseErrorTestHandler("\xED\x9F\xBF", 0, 'U+D7FF (one codepoint below lowest surrogate codepoint)'); - $this->invalidParseErrorTestHandler("\xEF\xBF\xBD", 0, 'U+DE00 (one codepoint above highest surrogate codepoint)'); - - // Permanent noncharacters - $this->invalidParseErrorTestHandler("\xEF\xB7\x90", 1, 'U+FDD0 (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xEF\xB7\xAF", 1, 'U+FDEF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xEF\xBF\xBE", 1, 'U+FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xEF\xBF\xBF", 1, 'U+FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\x9F\xBF\xBE", 1, 'U+1FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\x9F\xBF\xBF", 1, 'U+1FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xAF\xBF\xBE", 1, 'U+2FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xAF\xBF\xBF", 1, 'U+2FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xBF\xBF\xBE", 1, 'U+3FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xBF\xBF\xBF", 1, 'U+3FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x8F\xBF\xBE", 1, 'U+4FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x8F\xBF\xBF", 1, 'U+4FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x9F\xBF\xBE", 1, 'U+5FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x9F\xBF\xBF", 1, 'U+5FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xAF\xBF\xBE", 1, 'U+6FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xAF\xBF\xBF", 1, 'U+6FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xBF\xBF\xBE", 1, 'U+7FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xBF\xBF\xBF", 1, 'U+7FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x8F\xBF\xBE", 1, 'U+8FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x8F\xBF\xBF", 1, 'U+8FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x9F\xBF\xBE", 1, 'U+9FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x9F\xBF\xBF", 1, 'U+9FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xAF\xBF\xBE", 1, 'U+AFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xAF\xBF\xBF", 1, 'U+AFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xBF\xBF\xBE", 1, 'U+BFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xBF\xBF\xBF", 1, 'U+BFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x8F\xBF\xBE", 1, 'U+CFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x8F\xBF\xBF", 1, 'U+CFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x9F\xBF\xBE", 1, 'U+DFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x9F\xBF\xBF", 1, 'U+DFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xAF\xBF\xBE", 1, 'U+EFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xAF\xBF\xBF", 1, 'U+EFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xBF\xBF\xBE", 1, 'U+FFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xBF\xBF\xBF", 1, 'U+FFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF4\x8F\xBF\xBE", 1, 'U+10FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF4\x8F\xBF\xBF", 1, 'U+10FFFF (permanent noncharacter)'); - - // MPB: These pass on some versions of iconv, and fail on others. Since we aren't in the - // business of writing tests against iconv, I've just commented these out. Should revisit - // at a later point. - /* - * $this->invalidParseErrorTestHandler("\xED\xA0\x80", 1, 'U+D800 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xAD\xBF", 1, 'U+DB7F (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xAE\x80", 1, 'U+DB80 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xAF\xBF", 1, 'U+DBFF (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xB0\x80", 1, 'U+DC00 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xBE\x80", 1, 'U+DF80 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xBF\xBF", 1, 'U+DFFF (UTF-16 surrogate character)'); // Paired UTF-16 surrogates $this->invalidParseErrorTestHandler("\xED\xA0\x80\xED\xB0\x80", 2, 'U+D800 U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xA0\x80\xED\xBF\xBF", 2, 'U+D800 U+DFFF (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAD\xBF\xED\xB0\x80", 2, 'U+DB7F U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAD\xBF\xED\xBF\xBF", 2, 'U+DB7F U+DFFF (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAE\x80\xED\xB0\x80", 2, 'U+DB80 U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAE\x80\xED\xBF\xBF", 2, 'U+DB80 U+DFFF (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAF\xBF\xED\xB0\x80", 2, 'U+DBFF U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAF\xBF\xED\xBF\xBF", 2, 'U+DBFF U+DFFF (paired UTF-16 surrogates)'); - */ - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php b/vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php deleted file mode 100644 index 3d834fd..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php +++ /dev/null @@ -1,970 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\UTF8Utils; -use Masterminds\HTML5\Parser\StringInputStream; -use Masterminds\HTML5\Parser\Scanner; -use Masterminds\HTML5\Parser\Tokenizer; - -class TokenizerTest extends \Masterminds\HTML5\Tests\TestCase -{ - // ================================================================ - // Additional assertions. - // ================================================================ - /** - * Tests that an event matches both the event type and the expected value. - * - * @param string $type - * Expected event type. - * @param string $expects - * The value expected in $event['data'][0]. - */ - public function assertEventEquals($type, $expects, $event) - { - $this->assertEquals($type, $event['name'], "Event $type for " . print_r($event, true)); - if (is_array($expects)) { - $this->assertEquals($expects, $event['data'], "Event $type should equal " . print_r($expects, true) . ": " . print_r($event, true)); - } else { - $this->assertEquals($expects, $event['data'][0], "Event $type should equal $expects: " . print_r($event, true)); - } - } - - /** - * Assert that a given event is 'error'. - */ - public function assertEventError($event) - { - $this->assertEquals('error', $event['name'], "Expected error for event: " . print_r($event, true)); - } - - /** - * Asserts that all of the tests are good. - * - * This loops through a map of tests/expectations and runs a few assertions on each test. - * - * Checks: - * - depth (if depth is > 0) - * - event name - * - matches on event 0. - */ - protected function isAllGood($name, $depth, $tests, $debug = false) - { - foreach ($tests as $try => $expects) { - if ($debug) { - fprintf(STDOUT, "%s expects %s\n", $try, print_r($expects, true)); - } - $e = $this->parse($try); - if ($depth > 0) { - $this->assertEquals($depth, $e->depth(), "Expected depth $depth for test $try." . print_r($e, true)); - } - $this->assertEventEquals($name, $expects, $e->get(0)); - } - } - - // ================================================================ - // Utility functions. - // ================================================================ - public function testParse() - { - list ($tok, $events) = $this->createTokenizer(''); - - $tok->parse(); - $e1 = $events->get(0); - - $this->assertEquals(1, $events->Depth()); - $this->assertEquals('eof', $e1['name']); - } - - public function testWhitespace() - { - $spaces = ' '; - list ($tok, $events) = $this->createTokenizer($spaces); - - $tok->parse(); - - $this->assertEquals(2, $events->depth()); - - $e1 = $events->get(0); - - $this->assertEquals('text', $e1['name']); - $this->assertEquals($spaces, $e1['data'][0]); - } - - public function testCharacterReference() - { - $good = array( - '&amp;' => '&', - '&#x0003c;' => '<', - '&#38;' => '&', - '&' => '&' - ); - $this->isAllGood('text', 2, $good); - - // Test with broken charref - $str = '&foo'; - $events = $this->parse($str); - $e1 = $events->get(0); - $this->assertEquals('error', $e1['name']); - - $str = '&#xfoo'; - $events = $this->parse($str); - $e1 = $events->get(0); - $this->assertEquals('error', $e1['name']); - - $str = '&#foo'; - $events = $this->parse($str); - $e1 = $events->get(0); - $this->assertEquals('error', $e1['name']); - - // FIXME: Once the text processor is done, need to verify that the - // tokens are transformed correctly into text. - } - - public function testBogusComment() - { - $bogus = array( - '</+this is a bogus comment. +>', - '<!+this is a bogus comment. !>', - '<!D OCTYPE foo bar>', - '<!DOCTYEP foo bar>', - '<![CADATA[ TEST ', - '', - ' Hello [[>', - '<!CDATA[[ test ', - '', - '<![CDATA[hellooooo hello', - '<? Hello World ?>', - '<? Hello World' - ); - foreach ($bogus as $str) { - $events = $this->parse($str); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('comment', $str, $events->get(1)); - } - } - - public function testEndTag() - { - $succeed = array( - '</a>' => 'a', - '</test>' => 'test', - '</test - >' => 'test', - '</thisIsTheTagThatDoesntEndItJustGoesOnAndOnMyFriend>' => 'thisisthetagthatdoesntenditjustgoesonandonmyfriend', - // See 8.2.4.10, which requires this and does not say error. - '</a<b>' => 'a<b' - ); - $this->isAllGood('endTag', 2, $succeed); - - // Recoverable failures - $fail = array( - '</a class="monkey">' => 'a', - '</a <b>' => 'a', - '</a <b <c>' => 'a', - '</a is the loneliest letter>' => 'a', - '</a' => 'a' - ); - foreach ($fail as $test => $result) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth()); - // Should have triggered an error. - $this->assertEventError($events->get(0)); - // Should have tried to parse anyway. - $this->assertEventEquals('endTag', $result, $events->get(1)); - } - - // BogoComments - $comments = array( - '</>' => '</>', - '</ >' => '</ >', - '</ a>' => '</ a>' - ); - foreach ($comments as $test => $result) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth()); - - // Should have triggered an error. - $this->assertEventError($events->get(0)); - - // Should have tried to parse anyway. - $this->assertEventEquals('comment', $result, $events->get(1)); - } - } - - public function testComment() - { - $good = array( - '<!--easy-->' => 'easy', - '<!-- 1 > 0 -->' => ' 1 > 0 ', - '<!-- --$i -->' => ' --$i ', - '<!----$i-->' => '--$i', - '<!-- 1 > 0 -->' => ' 1 > 0 ', - "<!--\nHello World.\na-->" => "\nHello World.\na", - '<!-- <!-- -->' => ' <!-- ' - ); - foreach ($good as $test => $expected) { - $events = $this->parse($test); - $this->assertEventEquals('comment', $expected, $events->get(0)); - } - - $fail = array( - '<!-->' => '', - '<!--Hello' => 'Hello', - "<!--\0Hello" => UTF8Utils::FFFD . 'Hello', - '<!--' => '' - ); - foreach ($fail as $test => $expected) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth()); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('comment', $expected, $events->get(1)); - } - } - - public function testCDATASection() - { - $good = array( - '<![CDATA[ This is a test. ' => ' This is a test. ', - 'CDATA' => 'CDATA', - ' ]] > ' => ' ]] > ', - ' ' => ' ' - ); - $this->isAllGood('cdata', 2, $good); - } - - public function testDoctype() - { - $good = array( - '' => array( - 'html', - 0, - null, - false - ), - '' => array( - 'html', - 0, - null, - false - ), - '' => array( - 'html', - 0, - null, - false - ), - "" => array( - 'html', - 0, - null, - false - ), - "" => array( - 'html', - 0, - null, - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo/bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - false - ) - ); - $this->isAllGood('doctype', 2, $good); - - $bad = array( - '' => array( - null, - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - null, - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - - // Can't tell whether these are ids or ID types, since the context is chopped. - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - - ' array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - true - ), - '' => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - true - ) - ); - foreach ($bad as $test => $expects) { - $events = $this->parse($test); - // fprintf(STDOUT, $test . PHP_EOL); - $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('doctype', $expects, $events->get(1)); - } - } - - public function testProcessorInstruction() - { - $good = array( - '' => 'hph', - '' => array( - 'hph', - 'echo "Hello World"; ' - ), - "" => array( - 'hph', - "echo 'Hello World';\n" - ) - ); - $this->isAllGood('pi', 2, $good); - } - - /** - * This tests just simple tags. - */ - public function testSimpleTags() - { - $open = array( - '' => 'foo', - '' => 'foo', - '' => 'foo', - '' => 'foo', - "" => 'foo', - '' => 'foo:bar' - ); - $this->isAllGood('startTag', 2, $open); - - $selfClose = array( - '' => 'foo', - '' => 'foo', - '' => 'foo', - "" => 'foo', - '' => 'foo:bar' - ); - foreach ($selfClose as $test => $expects) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth(), "Counting events for '$test'" . print_r($events, true)); - $this->assertEventEquals('startTag', $expects, $events->get(0)); - $this->assertEventEquals('endTag', $expects, $events->get(1)); - } - - $bad = array( - ' 'foo', - ' 'foo', - ' 'foo', - ' 'foo' - ); - - foreach ($bad as $test => $expects) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expects, $events->get(1)); - } - } - - public function testTagsWithAttributeAndMissingName() - { - $cases = array( - '' => 'id', - '' => 'color', - "" => 'class', - '' => 'bgcolor', - '' => 'class' - ); - - foreach ($cases as $html => $expected) { - $events = $this->parse($html); - $this->assertEventError($events->get(0)); - $this->assertEventError($events->get(1)); - $this->assertEventError($events->get(2)); - $this->assertEventEquals('startTag', $expected, $events->get(3)); - $this->assertEventEquals('eof', null, $events->get(4)); - } - } - - public function testTagNotClosedAfterTagName() - { - $cases = array( - "" => array( - 'noscript', - 'img' - ), - '' => array( - 'center', - 'a' - ), - '' => array( - 'br', - 'br' - ) - ); - - foreach ($cases as $html => $expected) { - $events = $this->parse($html); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expected[0], $events->get(1)); - $this->assertEventEquals('startTag', $expected[1], $events->get(2)); - $this->assertEventEquals('eof', null, $events->get(3)); - } - - $events = $this->parse('02'); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', 'span', $events->get(1)); - $this->assertEventError($events->get(2)); - $this->assertEventEquals('text', '>02', $events->get(3)); - $this->assertEventEquals('endTag', 'span', $events->get(4)); - $this->assertEventEquals('eof', null, $events->get(5)); - - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', 'p', $events->get(1)); - $this->assertEventEquals('endTag', 'p', $events->get(2)); - $this->assertEventEquals('eof', null, $events->get(3)); - - $events = $this->parse(''); - $this->assertEventEquals('startTag', 'strong', $events->get(0)); - $this->assertEventError($events->get(1)); - $this->assertEventEquals('startTag', 'wordpress', $events->get(2)); - $this->assertEventEquals('endTag', 'strong', $events->get(3)); - $this->assertEventEquals('eof', null, $events->get(4)); - - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventError($events->get(1)); - $this->assertEventError($events->get(2)); - $this->assertEventEquals('startTag', 'src', $events->get(3)); - $this->assertEventEquals('startTag', 'a', $events->get(4)); - $this->assertEventEquals('eof', null, $events->get(5)); - - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', 'br', $events->get(1)); - $this->assertEventEquals('eof', null, $events->get(2)); - } - - public function testIllegalTagNames() - { - $cases = array( - '' => 'li', - '' => 'p', - '' => 'b', - '' => 'static', - '' => 'h', - '' => 'st', - ); - - foreach ($cases as $html => $expected) { - $events = $this->parse($html); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expected, $events->get(1)); - } - } - - /** - * @depends testCharacterReference - */ - public function testTagAttributes() - { - // Opening tags. - $good = array( - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => ' baz ' - ), - false - ), - "" => array( - 'foo', - array( - 'bar' => "\nbaz\n" - ), - false - ), - "" => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'A full sentence.' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => '1', - 'b' => '2' - ), - false - ), - "" => array( - 'foo', - array( - 'ns:bar' => 'baz' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => 'blue&red' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => 'blue&&red' - ), - false - ), - "" => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - '' => array( - 'doe', - array( - 'a' => null, - 'deer' => null - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - - // Updated for 8.1.2.3 - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - - // The spec allows an unquoted value '/'. This will not be a closing - // tag. - '' => array( - 'foo', - array( - 'bar' => '/' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'baz/' - ), - false - ) - ); - $this->isAllGood('startTag', 2, $good); - - // Self-closing tags. - $withEnd = array( - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - true - ), - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - true - ), - '' => array( - 'foo', - array( - 'bar' => 'BAZ' - ), - true - ), - "" => array( - 'foo', - array( - 'a' => '1', - 'b' => '2', - 'c' => '3', - 'd' => null - ), - true - ) - ); - $this->isAllGood('startTag', 3, $withEnd); - - // Cause a parse error. - $bad = array( - // This will emit an entity lookup failure for &red. - "" => array( - 'foo', - array( - 'a' => 'blue&red' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => 'blue&&&red' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => null - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'oh"' - ), - false - ), - - // these attributes are ignored because of current implementation - // of method "DOMElement::setAttribute" - // see issue #23: https://github.com/Masterminds/html5-php/issues/23 - '' => array( - 'foo', - array(), - false - ), - '' => array( - 'foo', - array(), - false - ), - '' => array( - 'foo', - array(), - false - ), - '' => array( - 'foo', - array(), - false - ) - ) - ; - foreach ($bad as $test => $expects) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expects, $events->get(1)); - } - - // Cause multiple parse errors. - $reallyBad = array( - '' => array( - 'foo', - array( - '=' => null, - '"bar"' => null - ), - false - ), - '' => array( - 'foo', - array(), - true - ), - // character "&" in unquoted attribute shouldn't cause an infinite loop - '' => array( - 'foo', - array( - 'bar' => 'index.php?str=1&id=29' - ), - false - ) - ); - foreach ($reallyBad as $test => $expects) { - $events = $this->parse($test); - // fprintf(STDOUT, $test . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventError($events->get(1)); - // $this->assertEventEquals('startTag', $expects, $events->get(1)); - } - - // Regression: Malformed elements should be detected. - // '' => array('foo', array('baz' => '1'), false), - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', array( - 'foo', - array( - 'baz' => '1' - ), - false - ), $events->get(1)); - $this->assertEventEquals('startTag', array( - 'bar', - array(), - false - ), $events->get(2)); - $this->assertEventEquals('endTag', array( - 'foo' - ), $events->get(3)); - } - - public function testRawText() - { - $good = array( - ' ' => 'abcd efg hijk lmnop', - '' => '', - '' => '<<<<<<<<', - '' => 'hello\nhello" => "\nhello&' => '&', - '' => '', - '' => '' - ); - foreach ($good as $test => $expects) { - $events = $this->parse($test); - $this->assertEventEquals('startTag', 'script', $events->get(0)); - $this->assertEventEquals('text', $expects, $events->get(1)); - $this->assertEventEquals('endTag', 'script', $events->get(2)); - } - - $bad = array( - ' - - -
foo bar baz
- - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $script = $dom->getElementsByTagName('script'); - $r->element($script->item(0)); - $this->assertEquals( - '', stream_get_contents($stream, - 1, 0)); - } - - public function testElementWithStyle() - { - $dom = $this->html5->loadHTML( - ' - - - - - -
foo bar baz
- - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $style = $dom->getElementsByTagName('style'); - $r->element($style->item(0)); - $this->assertEquals('', stream_get_contents($stream, - 1, 0)); - } - - public function testOpenTag() - { - $dom = $this->html5->loadHTML(' - - -
foo bar baz
- - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $m = $this->getProtectedMethod('openTag'); - $m->invoke($r, $list->item(0)); - $this->assertEquals('
', stream_get_contents($stream, - 1, 0)); - } - - public function testCData() - { - $dom = $this->html5->loadHTML(' - - -
- - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $r->cdata($list->item(0)->childNodes->item(0)); - $this->assertEquals('', stream_get_contents($stream, - 1, 0)); - - $dom = $this->html5->loadHTML(' - - -
- - '); - - $dom->getElementById('foo')->appendChild(new \DOMCdataSection("]]>Foo<[![CDATA test ]]>")); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - $list = $dom->getElementsByTagName('div'); - $r->cdata($list->item(0)->childNodes->item(0)); - - $this->assertEquals('Foo<[![CDATA test ]]]]>]]>', stream_get_contents($stream, - 1, 0)); - } - - public function testComment() - { - $dom = $this->html5->loadHTML(' - - -
- - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $r->comment($list->item(0)->childNodes->item(0)); - $this->assertEquals('', stream_get_contents($stream, - 1, 0)); - - $dom = $this->html5->loadHTML(' - - -
- - '); - $dom->getElementById('foo')->appendChild(new \DOMComment(' --> Foo -->')); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $r->comment($list->item(0)->childNodes->item(0)); - - // Could not find more definitive guidelines on what this should be. Went with - // what the HTML5 spec says and what \DOMDocument::saveXML() produces. - $this->assertEquals(' --> Foo -->-->', stream_get_contents($stream, - 1, 0)); - } - - public function testText() - { - $dom = $this->html5->loadHTML(' - - - - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('script'); - $r->text($list->item(0)->childNodes->item(0)); - $this->assertEquals('baz();', stream_get_contents($stream, - 1, 0)); - - $dom = $this->html5->loadHTML(' - - - '); - $foo = $dom->getElementById('foo'); - $foo->appendChild(new \DOMText('')); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $r->text($foo->firstChild); - $this->assertEquals('<script>alert("hi");</script>', stream_get_contents($stream, - 1, 0)); - } - - public function testNl() - { - list ($o, $s) = $this->getOutputRules(); - - $m = $this->getProtectedMethod('nl'); - $m->invoke($o); - $this->assertEquals(PHP_EOL, stream_get_contents($s, - 1, 0)); - } - - public function testWr() - { - list ($o, $s) = $this->getOutputRules(); - - $m = $this->getProtectedMethod('wr'); - $m->invoke($o, 'foo'); - $this->assertEquals('foo', stream_get_contents($s, - 1, 0)); - } - - public function getEncData() - { - return array( - array( - false, - '&\'<>"', - '&\'<>"', - '&'<>"' - ), - array( - false, - 'This + is. a < test', - 'This + is. a < test', - 'This + is. a < test' - ), - array( - false, - '.+#', - '.+#', - '.+#' - ), - - array( - true, - '.+#\'', - '.+#\'', - '.+#'' - ), - array( - true, - '&".<', - '&".<', - '&".<' - ), - array( - true, - '&\'<>"', - '&\'<>"', - '&'<>"' - ), - array( - true, - "\xc2\xa0\"'", - ' "\'', - ' "'' - ) - ); - } - - /** - * Test basic encoding of text. - * @dataProvider getEncData - */ - public function testEnc($isAttribute, $test, $expected, $expectedEncoded) - { - list ($o, $s) = $this->getOutputRules(); - $m = $this->getProtectedMethod('enc'); - - $this->assertEquals($expected, $m->invoke($o, $test, $isAttribute)); - - list ($o, $s) = $this->getOutputRules(array( - 'encode_entities' => true - )); - $m = $this->getProtectedMethod('enc'); - $this->assertEquals($expectedEncoded, $m->invoke($o, $test, $isAttribute)); - } - - /** - * Test basic encoding of text. - * @dataProvider getEncData - */ - public function testEscape($isAttribute, $test, $expected, $expectedEncoded) - { - list ($o, $s) = $this->getOutputRules(); - $m = $this->getProtectedMethod('escape'); - - $this->assertEquals($expected, $m->invoke($o, $test, $isAttribute)); - } - - public function booleanAttributes() - { - return array( - array(''), - array(''), - array(''), - array(''), - array(''), - array(''), - array('
'), - array(''), - array('
'), - array(''), - ); - } - /** - * @dataProvider booleanAttributes - */ - public function testBooleanAttrs($html) - { - $dom = $this->html5->loadHTML(''.$html.''); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $node = $dom->getElementsByTagName('body')->item(0)->firstChild; - - $m = $this->getProtectedMethod('attrs'); - $m->invoke($r, $node); - - $content = stream_get_contents($stream, - 1, 0); - - $html = preg_replace('~<[a-z]+(.*)>~', '\1', $html); - $html = preg_replace('~<[a-z]+(.*)/?>~', '\1', $html); - - $this->assertEquals($content, $html); - - } - - public function testAttrs() - { - $dom = $this->html5->loadHTML(' - - -
foo bar baz
- - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - - $m = $this->getProtectedMethod('attrs'); - $m->invoke($r, $list->item(0)); - - $content = stream_get_contents($stream, - 1, 0); - $this->assertEquals(' id="foo" class="bar baz"', $content); - } - - public function testSvg() - { - $dom = $this->html5->loadHTML( - ' - - -
foo bar baz
- - - - - - - - - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('svg'); - $r->element($list->item(0)); - $contents = stream_get_contents($stream, - 1, 0); - $this->assertRegExp('||', $contents); - $this->assertRegExp('||', $contents); - $this->assertRegExp('||', $contents); - } - - public function testMath() - { - $dom = $this->html5->loadHTML( - ' - - -
foo bar baz
- - x - - ± - - y - - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('math'); - $r->element($list->item(0)); - $content = stream_get_contents($stream, - 1, 0); - $this->assertRegExp('||', $content); - $this->assertRegExp('||', $content); - } - - public function testProcessorInstruction() - { - $dom = $this->html5->loadHTMLFragment(''); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $r->processorInstruction($dom->firstChild); - $content = stream_get_contents($stream, - 1, 0); - $this->assertRegExp('|<\?foo bar \?>|', $content); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php b/vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php deleted file mode 100644 index c914633..0000000 --- a/vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Test - - -

This is a test.

- - '; - - public function setUp() - { - $this->html5 = $this->getInstance(); - } - - /** - * Using reflection we make a protected method accessible for testing. - * - * @param string $name - * The name of the method on the Traverser class to test. - * - * @return \ReflectionMethod \ReflectionMethod for the specified method - */ - public function getProtectedMethod($name) - { - $class = new \ReflectionClass('\Masterminds\HTML5\Serializer\Traverser'); - $method = $class->getMethod($name); - $method->setAccessible(true); - - return $method; - } - - public function getTraverser() - { - $stream = fopen('php://temp', 'w'); - - $dom = $this->html5->loadHTML($this->markup); - $t = new Traverser($dom, $stream, $html5->getOptions()); - - // We return both the traverser and stream so we can pull from it. - return array( - $t, - $stream - ); - } - - public function testConstruct() - { - // The traverser needs a place to write the output to. In our case we - // use a stream in temp space. - $stream = fopen('php://temp', 'w'); - - $html5 = $this->getInstance(); - - $r = new OutputRules($stream, $this->html5->getOptions()); - $dom = $this->html5->loadHTML($this->markup); - - $t = new Traverser($dom, $stream, $r, $html5->getOptions()); - - $this->assertInstanceOf('\Masterminds\HTML5\Serializer\Traverser', $t); - } - - public function testFragment() - { - $html = 'foo
bar
'; - $input = new \Masterminds\HTML5\Parser\StringInputStream($html); - $dom = $this->html5->parseFragment($input); - - $this->assertInstanceOf('\DOMDocumentFragment', $dom); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $out = $t->walk(); - $this->assertEquals($html, stream_get_contents($stream, - 1, 0)); - } - - public function testProcessorInstruction() - { - $html = ''; - $input = new \Masterminds\HTML5\Parser\StringInputStream($html); - $dom = $this->html5->parseFragment($input); - - $this->assertInstanceOf('\DOMDocumentFragment', $dom); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $out = $t->walk(); - $this->assertEquals($html, stream_get_contents($stream, - 1, 0)); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/TestCase.php b/vendor/masterminds/html5/test/HTML5/TestCase.php deleted file mode 100644 index 3cb8645..0000000 --- a/vendor/masterminds/html5/test/HTML5/TestCase.php +++ /dev/null @@ -1,27 +0,0 @@ -test'; - - const DOC_CLOSE = ''; - - public function testFoo() - { - // Placeholder. Why is PHPUnit emitting warnings about no tests? - } - - public function getInstance(array $options = array()) - { - return new HTML5($options); - } - - protected function wrap($fragment) - { - return self::DOC_OPEN . $fragment . self::DOC_CLOSE; - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php deleted file mode 100644 index 4f30b03..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php +++ /dev/null @@ -1,318 +0,0 @@ -assertEquals($expectedCount, - $actualCount, - 'Directory foo contains ' . $expectedCount . ' children, but got ' . $actualCount . ' children while iterating over directory contents' - ); - } - - /** - * @param \Closure $dotFilesSwitch - * @param string[] $expectedDirectories - * @test - * @dataProvider provideSwitchWithExpectations - */ - public function directoryIteration(\Closure $dotFilesSwitch, array $expectedDirectories) - { - $dotFilesSwitch(); - $dir = dir($this->fooURL); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue(in_array($entry, $expectedDirectories)); - } - - $this->assertDirectoryCount(count($expectedDirectories), $i); - $dir->rewind(); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue(in_array($entry, $expectedDirectories)); - } - - $this->assertDirectoryCount(count($expectedDirectories), $i); - $dir->close(); - } - - /** - * @param \Closure $dotFilesSwitch - * @param string[] $expectedDirectories - * @test - * @dataProvider provideSwitchWithExpectations - */ - public function directoryIterationWithDot(\Closure $dotFilesSwitch, array $expectedDirectories) - { - $dotFilesSwitch(); - $dir = dir($this->fooURL . '/.'); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue(in_array($entry, $expectedDirectories)); - } - - $this->assertDirectoryCount(count($expectedDirectories), $i); - $dir->rewind(); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue(in_array($entry, $expectedDirectories)); - } - - $this->assertDirectoryCount(count($expectedDirectories), $i); - $dir->close(); - } - - /** - * assure that a directory iteration works as expected - * - * @param \Closure $dotFilesSwitch - * @param string[] $expectedDirectories - * @test - * @dataProvider provideSwitchWithExpectations - * @group regression - * @group bug_2 - */ - public function directoryIterationWithOpenDir_Bug_2(\Closure $dotFilesSwitch, array $expectedDirectories) - { - $dotFilesSwitch(); - $handle = opendir($this->fooURL); - $i = 0; - while (false !== ($entry = readdir($handle))) { - $i++; - $this->assertTrue(in_array($entry, $expectedDirectories)); - } - - $this->assertDirectoryCount(count($expectedDirectories), $i); - - rewinddir($handle); - $i = 0; - while (false !== ($entry = readdir($handle))) { - $i++; - $this->assertTrue(in_array($entry, $expectedDirectories)); - } - - $this->assertDirectoryCount(count($expectedDirectories), $i); - closedir($handle); - } - - /** - * assure that a directory iteration works as expected - * - * @author Christoph Bloemer - * @param \Closure $dotFilesSwitch - * @param string[] $expectedDirectories - * @test - * @dataProvider provideSwitchWithExpectations - * @group regression - * @group bug_4 - */ - public function directoryIteration_Bug_4(\Closure $dotFilesSwitch, array $expectedDirectories) - { - $dotFilesSwitch(); - $dir = $this->fooURL; - $list1 = array(); - if ($handle = opendir($dir)) { - while (false !== ($listItem = readdir($handle))) { - if ('.' != $listItem && '..' != $listItem) { - if (is_file($dir . '/' . $listItem) === true) { - $list1[] = 'File:[' . $listItem . ']'; - } elseif (is_dir($dir . '/' . $listItem) === true) { - $list1[] = 'Folder:[' . $listItem . ']'; - } - } - } - - closedir($handle); - } - - $list2 = array(); - if ($handle = opendir($dir)) { - while (false !== ($listItem = readdir($handle))) { - if ('.' != $listItem && '..' != $listItem) { - if (is_file($dir . '/' . $listItem) === true) { - $list2[] = 'File:[' . $listItem . ']'; - } elseif (is_dir($dir . '/' . $listItem) === true) { - $list2[] = 'Folder:[' . $listItem . ']'; - } - } - } - - closedir($handle); - } - - $this->assertEquals($list1, $list2); - $this->assertEquals(2, count($list1)); - $this->assertEquals(2, count($list2)); - } - - /** - * assure that a directory iteration works as expected - * - * @param \Closure $dotFilesSwitch - * @param string[] $expectedDirectories - * @test - * @dataProvider provideSwitchWithExpectations - */ - public function directoryIterationShouldBeIndependent(\Closure $dotFilesSwitch, array $expectedDirectories) - { - $dotFilesSwitch(); - $list1 = array(); - $list2 = array(); - $handle1 = opendir($this->fooURL); - if (false !== ($listItem = readdir($handle1))) { - $list1[] = $listItem; - } - - $handle2 = opendir($this->fooURL); - if (false !== ($listItem = readdir($handle2))) { - $list2[] = $listItem; - } - - if (false !== ($listItem = readdir($handle1))) { - $list1[] = $listItem; - } - - if (false !== ($listItem = readdir($handle2))) { - $list2[] = $listItem; - } - - closedir($handle1); - closedir($handle2); - $this->assertEquals($list1, $list2); - $this->assertEquals(2, count($list1)); - $this->assertEquals(2, count($list2)); - } - - /** - * @test - * @group issue_50 - */ - public function recursiveDirectoryIterationWithDotsEnabled() - { - vfsStream::enableDotfiles(); - vfsStream::setup(); - $structure = array( - 'Core' => array( - 'AbstractFactory' => array( - 'test.php' => 'some text content', - 'other.php' => 'Some more text content', - 'Invalid.csv' => 'Something else', - ), - 'AnEmptyFolder' => array(), - 'badlocation.php' => 'some bad content', - ) - ); - $root = vfsStream::create($structure); - $rootPath = vfsStream::url($root->getName()); - - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootPath), - \RecursiveIteratorIterator::CHILD_FIRST); - $pathes = array(); - foreach ($iterator as $fullFileName => $fileSPLObject) { - $pathes[] = $fullFileName; - } - - $this->assertEquals(array('vfs://root'.DIRECTORY_SEPARATOR.'.', - 'vfs://root'.DIRECTORY_SEPARATOR.'..', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'.', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'.', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'..', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'test.php', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'other.php', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'Invalid.csv', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder'.DIRECTORY_SEPARATOR.'.', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder'.DIRECTORY_SEPARATOR.'..', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'badlocation.php', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core' - ), - $pathes - ); - } - - /** - * @test - * @group issue_50 - */ - public function recursiveDirectoryIterationWithDotsDisabled() - { - vfsStream::disableDotfiles(); - vfsStream::setup(); - $structure = array( - 'Core' => array( - 'AbstractFactory' => array( - 'test.php' => 'some text content', - 'other.php' => 'Some more text content', - 'Invalid.csv' => 'Something else', - ), - 'AnEmptyFolder' => array(), - 'badlocation.php' => 'some bad content', - ) - ); - $root = vfsStream::create($structure); - $rootPath = vfsStream::url($root->getName()); - - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootPath), - \RecursiveIteratorIterator::CHILD_FIRST); - $pathes = array(); - foreach ($iterator as $fullFileName => $fileSPLObject) { - $pathes[] = $fullFileName; - } - - $this->assertEquals(array('vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'test.php', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'other.php', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'Invalid.csv', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'badlocation.php', - 'vfs://root'.DIRECTORY_SEPARATOR.'Core' - ), - $pathes - ); - } -} \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/Issue104TestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/Issue104TestCase.php deleted file mode 100644 index 89ae146..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/Issue104TestCase.php +++ /dev/null @@ -1,52 +0,0 @@ - array( - 'schema.xsd' => ' - - ', - ) - ); - vfsStream::setup('root', null, $structure); - $doc = new \DOMDocument(); - $this->assertTrue($doc->load(vfsStream::url('root/foo bar/schema.xsd'))); - } - - /** - * @test - */ - public function vfsStreamCanHandleUrlEncodedPath() - { - $content = ' - - '; - $structure = array('foo bar' => array( - 'schema.xsd' => $content, - ) - ); - vfsStream::setup('root', null, $structure); - $this->assertEquals( - $content, - file_get_contents(vfsStream::url('root/foo%20bar/schema.xsd')) - ); - } -} - diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/PermissionsTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/PermissionsTestCase.php deleted file mode 100644 index 56767ac..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/PermissionsTestCase.php +++ /dev/null @@ -1,118 +0,0 @@ - array('test.file' => '')); - $this->root = vfsStream::setup('root', null, $structure); - } - - /** - * @test - * @group issue_52 - */ - public function canNotChangePermissionWhenDirectoryNotWriteable() - { - $this->root->getChild('test_directory')->chmod(0444); - $this->assertFalse(@chmod(vfsStream::url('root/test_directory/test.file'), 0777)); - } - - /** - * @test - * @group issue_53 - */ - public function canNotChangePermissionWhenFileNotOwned() - { - $this->root->getChild('test_directory')->getChild('test.file')->chown(vfsStream::OWNER_USER_1); - $this->assertFalse(@chmod(vfsStream::url('root/test_directory/test.file'), 0777)); - } - - /** - * @test - * @group issue_52 - */ - public function canNotChangeOwnerWhenDirectoryNotWriteable() - { - $this->root->getChild('test_directory')->chmod(0444); - $this->assertFalse(@chown(vfsStream::url('root/test_directory/test.file'), vfsStream::OWNER_USER_2)); - } - - /** - * @test - * @group issue_53 - */ - public function canNotChangeOwnerWhenFileNotOwned() - { - $this->root->getChild('test_directory')->getChild('test.file')->chown(vfsStream::OWNER_USER_1); - $this->assertFalse(@chown(vfsStream::url('root/test_directory/test.file'), vfsStream::OWNER_USER_2)); - } - - /** - * @test - * @group issue_52 - */ - public function canNotChangeGroupWhenDirectoryNotWriteable() - { - $this->root->getChild('test_directory')->chmod(0444); - $this->assertFalse(@chgrp(vfsStream::url('root/test_directory/test.file'), vfsStream::GROUP_USER_2)); - } - - /** - * @test - * @group issue_53 - */ - public function canNotChangeGroupWhenFileNotOwned() - { - $this->root->getChild('test_directory')->getChild('test.file')->chown(vfsStream::OWNER_USER_1); - $this->assertFalse(@chgrp(vfsStream::url('root/test_directory/test.file'), vfsStream::GROUP_USER_2)); - } - - /** - * @test - * @group issue_107 - * @expectedException PHPUnit_Framework_Error - * @expectedExceptionMessage Can not create new file in non-writable path root - * @requires PHP 5.4 - * @since 1.5.0 - */ - public function touchOnNonWriteableDirectoryTriggersError() - { - $this->root->chmod(0555); - touch($this->root->url() . '/touch.txt'); - } - - /** - * @test - * @group issue_107 - * @requires PHP 5.4 - * @since 1.5.0 - */ - public function touchOnNonWriteableDirectoryDoesNotCreateFile() - { - $this->root->chmod(0555); - $this->assertFalse(@touch($this->root->url() . '/touch.txt')); - $this->assertFalse($this->root->hasChild('touch.txt')); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/QuotaTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/QuotaTestCase.php deleted file mode 100644 index 7007183..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/QuotaTestCase.php +++ /dev/null @@ -1,81 +0,0 @@ -quota = new Quota(10); - } - - /** - * @test - */ - public function unlimitedQuotaIsNotLimited() - { - $this->assertFalse(Quota::unlimited()->isLimited()); - } - - /** - * @test - */ - public function limitedQuotaIsLimited() - { - $this->assertTrue($this->quota->isLimited()); - } - - /** - * @test - */ - public function unlimitedQuotaHasAlwaysSpaceLeft() - { - $this->assertEquals(303, Quota::unlimited()->spaceLeft(303)); - } - - /** - * @test - */ - public function hasNoSpaceLeftWhenUsedSpaceIsLargerThanQuota() - { - $this->assertEquals(0, $this->quota->spaceLeft(11)); - } - - /** - * @test - */ - public function hasNoSpaceLeftWhenUsedSpaceIsEqualToQuota() - { - $this->assertEquals(0, $this->quota->spaceLeft(10)); - } - - /** - * @test - */ - public function hasSpaceLeftWhenUsedSpaceIsLowerThanQuota() - { - $this->assertEquals(1, $this->quota->spaceLeft(9)); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/UnlinkTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/UnlinkTestCase.php deleted file mode 100644 index 4f9fb17..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/UnlinkTestCase.php +++ /dev/null @@ -1,58 +0,0 @@ - array('test.file' => '')); - $root = vfsStream::setup('root', null, $structure); - $root->getChild('test_directory')->chmod(0777); - $root->getChild('test_directory')->getChild('test.file')->chmod(0444); - $this->assertTrue(@unlink(vfsStream::url('root/test_directory/test.file'))); - } - - /** - * @test - * @group issue_51 - */ - public function canNotRemoveWritableFileFromNonWritableDirectory() - { - $structure = array('test_directory' => array('test.file' => '')); - $root = vfsStream::setup('root', null, $structure); - $root->getChild('test_directory')->chmod(0444); - $root->getChild('test_directory')->getChild('test.file')->chmod(0777); - $this->assertFalse(@unlink(vfsStream::url('root/test_directory/test.file'))); - } - - /** - * @test - * @since 1.4.0 - * @group issue_68 - */ - public function unlinkNonExistingFileTriggersError() - { - vfsStream::setup(); - try { - $this->assertFalse(unlink('vfs://root/foo.txt')); - } catch (\PHPUnit_Framework_Error $fe) { - $this->assertEquals('unlink(vfs://root/foo.txt): No such file or directory', $fe->getMessage()); - } - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/LargeFileContentTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/LargeFileContentTestCase.php deleted file mode 100644 index c7a7458..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/LargeFileContentTestCase.php +++ /dev/null @@ -1,225 +0,0 @@ -largeFileContent = new LargeFileContent(100); - } - - /** - * @test - */ - public function hasSizeOriginallyGiven() - { - $this->assertEquals(100, $this->largeFileContent->size()); - } - - /** - * @test - */ - public function contentIsFilledUpWithSpacesIfNoDataWritten() - { - $this->assertEquals( - str_repeat(' ', 100), - $this->largeFileContent->content() - ); - } - - /** - * @test - */ - public function readReturnsSpacesWhenNothingWrittenAtOffset() - { - $this->assertEquals( - str_repeat(' ', 10), - $this->largeFileContent->read(10) - ); - } - - /** - * @test - */ - public function readReturnsContentFilledWithSpaces() - { - $this->largeFileContent->write('foobarbaz'); - $this->largeFileContent->seek(0, SEEK_SET); - $this->assertEquals( - 'foobarbaz ', - $this->largeFileContent->read(10) - ); - } - - /** - * @test - */ - public function writesDataAtStartWhenOffsetNotMoved() - { - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals( - 'foobarbaz' . str_repeat(' ', 91), - $this->largeFileContent->content() - ); - } - - /** - * @test - */ - public function writeDataAtStartDoesNotIncreaseSize() - { - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals(100, $this->largeFileContent->size()); - } - - /** - * @test - */ - public function writesDataAtOffsetWhenOffsetMoved() - { - $this->largeFileContent->seek(50, SEEK_SET); - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals( - str_repeat(' ', 50) . 'foobarbaz' . str_repeat(' ', 41), - $this->largeFileContent->content() - ); - } - - /** - * @test - */ - public function writeDataInBetweenDoesNotIncreaseSize() - { - $this->largeFileContent->seek(50, SEEK_SET); - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals(100, $this->largeFileContent->size()); - } - - /** - * @test - */ - public function writesDataOverEndWhenOffsetAndDataLengthLargerThanSize() - { - $this->largeFileContent->seek(95, SEEK_SET); - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals( - str_repeat(' ', 95) . 'foobarbaz', - $this->largeFileContent->content() - ); - } - - /** - * @test - */ - public function writeDataOverLastOffsetIncreasesSize() - { - $this->largeFileContent->seek(95, SEEK_SET); - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals(104, $this->largeFileContent->size()); - } - - /** - * @test - */ - public function writesDataAfterEndWhenOffsetAfterEnd() - { - $this->largeFileContent->seek(0, SEEK_END); - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals( - str_repeat(' ', 100) . 'foobarbaz', - $this->largeFileContent->content() - ); - } - - /** - * @test - */ - public function writeDataAfterLastOffsetIncreasesSize() - { - $this->largeFileContent->seek(0, SEEK_END); - $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); - $this->assertEquals(109, $this->largeFileContent->size()); - } - - /** - * @test - */ - public function truncateReducesSize() - { - $this->assertTrue($this->largeFileContent->truncate(50)); - $this->assertEquals(50, $this->largeFileContent->size()); - } - - /** - * @test - */ - public function truncateRemovesWrittenContentAfterOffset() - { - $this->largeFileContent->seek(45, SEEK_SET); - $this->largeFileContent->write('foobarbaz'); - $this->assertTrue($this->largeFileContent->truncate(50)); - $this->assertEquals( - str_repeat(' ', 45) . 'fooba', - $this->largeFileContent->content() - ); - } - - /** - * @test - */ - public function createInstanceWithKilobytes() - { - $this->assertEquals( - 100 * 1024, - LargeFileContent::withKilobytes(100) - ->size() - ); - } - - /** - * @test - */ - public function createInstanceWithMegabytes() - { - $this->assertEquals( - 100 * 1024 * 1024, - LargeFileContent::withMegabytes(100) - ->size() - ); - } - - /** - * @test - */ - public function createInstanceWithGigabytes() - { - $this->assertEquals( - 100 * 1024 * 1024 * 1024, - LargeFileContent::withGigabytes(100) - ->size() - ); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/StringBasedFileContentTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/StringBasedFileContentTestCase.php deleted file mode 100644 index d0e15ed..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/StringBasedFileContentTestCase.php +++ /dev/null @@ -1,230 +0,0 @@ -stringBasedFileContent = new StringBasedFileContent('foobarbaz'); - } - - /** - * @test - */ - public function hasContentOriginallySet() - { - $this->assertEquals('foobarbaz', $this->stringBasedFileContent->content()); - } - - /** - * @test - */ - public function hasNotReachedEofAfterCreation() - { - $this->assertFalse($this->stringBasedFileContent->eof()); - } - - /** - * @test - */ - public function sizeEqualsLengthOfGivenString() - { - $this->assertEquals(9, $this->stringBasedFileContent->size()); - } - - /** - * @test - */ - public function readReturnsSubstringWithRequestedLength() - { - $this->assertEquals('foo', $this->stringBasedFileContent->read(3)); - } - - /** - * @test - */ - public function readMovesOffset() - { - $this->assertEquals('foo', $this->stringBasedFileContent->read(3)); - $this->assertEquals('bar', $this->stringBasedFileContent->read(3)); - $this->assertEquals('baz', $this->stringBasedFileContent->read(3)); - } - - /** - * @test - */ - public function reaMoreThanSizeReturnsWholeContent() - { - $this->assertEquals('foobarbaz', $this->stringBasedFileContent->read(10)); - } - - /** - * @test - */ - public function readAfterEndReturnsEmptyString() - { - $this->stringBasedFileContent->read(9); - $this->assertEquals('', $this->stringBasedFileContent->read(3)); - } - - /** - * @test - */ - public function readDoesNotChangeSize() - { - $this->stringBasedFileContent->read(3); - $this->assertEquals(9, $this->stringBasedFileContent->size()); - } - - /** - * @test - */ - public function readLessThenSizeDoesNotReachEof() - { - $this->stringBasedFileContent->read(3); - $this->assertFalse($this->stringBasedFileContent->eof()); - } - - /** - * @test - */ - public function readSizeReachesEof() - { - $this->stringBasedFileContent->read(9); - $this->assertTrue($this->stringBasedFileContent->eof()); - } - - /** - * @test - */ - public function readMoreThanSizeReachesEof() - { - $this->stringBasedFileContent->read(10); - $this->assertTrue($this->stringBasedFileContent->eof()); - } - - /** - * @test - */ - public function seekWithInvalidOptionReturnsFalse() - { - $this->assertFalse($this->stringBasedFileContent->seek(0, 55)); - } - - /** - * @test - */ - public function canSeekToGivenOffset() - { - $this->assertTrue($this->stringBasedFileContent->seek(5, SEEK_SET)); - $this->assertEquals('rbaz', $this->stringBasedFileContent->read(10)); - } - - /** - * @test - */ - public function canSeekFromCurrentOffset() - { - $this->assertTrue($this->stringBasedFileContent->seek(5, SEEK_SET)); - $this->assertTrue($this->stringBasedFileContent->seek(2, SEEK_CUR)); - $this->assertEquals('az', $this->stringBasedFileContent->read(10)); - } - - /** - * @test - */ - public function canSeekToEnd() - { - $this->assertTrue($this->stringBasedFileContent->seek(0, SEEK_END)); - $this->assertEquals('', $this->stringBasedFileContent->read(10)); - } - - /** - * @test - */ - public function writeOverwritesExistingContentWhenOffsetNotAtEof() - { - $this->assertEquals(3, $this->stringBasedFileContent->write('bar')); - $this->assertEquals('barbarbaz', $this->stringBasedFileContent->content()); - } - - /** - * @test - */ - public function writeAppendsContentWhenOffsetAtEof() - { - $this->assertTrue($this->stringBasedFileContent->seek(0, SEEK_END)); - $this->assertEquals(3, $this->stringBasedFileContent->write('bar')); - $this->assertEquals('foobarbazbar', $this->stringBasedFileContent->content()); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - */ - public function truncateRemovesSuperflouosContent() - { - $this->assertTrue($this->stringBasedFileContent->truncate(6)); - $this->assertEquals('foobar', $this->stringBasedFileContent->content()); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - */ - public function truncateDecreasesSize() - { - $this->assertTrue($this->stringBasedFileContent->truncate(6)); - $this->assertEquals(6, $this->stringBasedFileContent->size()); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - */ - public function truncateToGreaterSizeAddsZeroBytes() - { - $this->assertTrue($this->stringBasedFileContent->truncate(25)); - $this->assertEquals( - "foobarbaz\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - $this->stringBasedFileContent->content() - ); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - */ - public function truncateToGreaterSizeIncreasesSize() - { - $this->assertTrue($this->stringBasedFileContent->truncate(25)); - $this->assertEquals(25, $this->stringBasedFileContent->size()); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/proxy/vfsStreamWrapperRecordingProxy.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/proxy/vfsStreamWrapperRecordingProxy.php deleted file mode 100644 index 899931d..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/proxy/vfsStreamWrapperRecordingProxy.php +++ /dev/null @@ -1,326 +0,0 @@ - - */ - public static function getMethodCalls($path) - { - if (isset(self::$calledMethods[$path]) === true) { - return self::$calledMethods[$path]; - } - - return array(); - } - - /** - * helper method for setting up vfsStream with the proxy - * - * @param string $rootDirName optional name of root directory - * @param int $permissions optional file permissions of root directory - * @return vfsStreamDirectory - * @throws vfsStreamException - */ - public static function setup($rootDirName = 'root', $permissions = null) - { - self::$root = vfsStream::newDirectory($rootDirName, $permissions); - if (true === self::$registered) { - return self::$root; - } - - if (@stream_wrapper_register(vfsStream::SCHEME, __CLASS__) === false) { - throw new vfsStreamException('A handler has already been registered for the ' . vfsStream::SCHEME . ' protocol.'); - } - - self::$registered = true; - return self::$root; - } - - /** - * open the stream - * - * @param string $path the path to open - * @param string $mode mode for opening - * @param string $options options for opening - * @param string $opened_path full path that was actually opened - * @return bool - */ - public function stream_open($path, $mode, $options, $opened_path) - { - $this->path = $path; - self::recordMethodCall('stream_open', $this->path); - return parent::stream_open($path, $mode, $options, $opened_path); - } - - /** - * closes the stream - */ - public function stream_close() - { - self::recordMethodCall('stream_close', $this->path); - return parent::stream_close(); - } - - /** - * read the stream up to $count bytes - * - * @param int $count amount of bytes to read - * @return string - */ - public function stream_read($count) - { - self::recordMethodCall('stream_read', $this->path); - return parent::stream_read($count); - } - - /** - * writes data into the stream - * - * @param string $data - * @return int amount of bytes written - */ - public function stream_write($data) - { - self::recordMethodCall('stream_write', $this->path); - return parent::stream_write($data); - } - - /** - * checks whether stream is at end of file - * - * @return bool - */ - public function stream_eof() - { - self::recordMethodCall('stream_eof', $this->path); - return parent::stream_eof(); - } - - /** - * returns the current position of the stream - * - * @return int - */ - public function stream_tell() - { - self::recordMethodCall('stream_tell', $this->path); - return parent::stream_tell(); - } - - /** - * seeks to the given offset - * - * @param int $offset - * @param int $whence - * @return bool - */ - public function stream_seek($offset, $whence) - { - self::recordMethodCall('stream_seek', $this->path); - return parent::stream_seek($offset, $whence); - } - - /** - * flushes unstored data into storage - * - * @return bool - */ - public function stream_flush() - { - self::recordMethodCall('stream_flush', $this->path); - return parent::stream_flush(); - } - - /** - * returns status of stream - * - * @return array - */ - public function stream_stat() - { - self::recordMethodCall('stream_stat', $this->path); - return parent::stream_stat(); - } - - /** - * retrieve the underlaying resource - * - * @param int $cast_as - * @return bool - */ - public function stream_cast($cast_as) - { - self::recordMethodCall('stream_cast', $this->path); - return parent::stream_cast($cast_as); - } - - /** - * set lock status for stream - * - * @param int $operation - * @return bool - */ - public function stream_lock($operation) - { - self::recordMethodCall('stream_link', $this->path); - return parent::stream_lock($operation); - } - - /** - * remove the data under the given path - * - * @param string $path - * @return bool - */ - public function unlink($path) - { - self::recordMethodCall('unlink', $path); - return parent::unlink($path); - } - - /** - * rename from one path to another - * - * @param string $path_from - * @param string $path_to - * @return bool - */ - public function rename($path_from, $path_to) - { - self::recordMethodCall('rename', $path_from); - return parent::rename($path_from, $path_to); - } - - /** - * creates a new directory - * - * @param string $path - * @param int $mode - * @param int $options - * @return bool - */ - public function mkdir($path, $mode, $options) - { - self::recordMethodCall('mkdir', $path); - return parent::mkdir($path, $mode, $options); - } - - /** - * removes a directory - * - * @param string $path - * @param int $options - * @return bool - */ - public function rmdir($path, $options) - { - self::recordMethodCall('rmdir', $path); - return parent::rmdir($path, $options); - } - - /** - * opens a directory - * - * @param string $path - * @param int $options - * @return bool - */ - public function dir_opendir($path, $options) - { - $this->path = $path; - self::recordMethodCall('dir_opendir', $this->path); - return parent::dir_opendir($path, $options); - } - - /** - * reads directory contents - * - * @return string - */ - public function dir_readdir() - { - self::recordMethodCall('dir_readdir', $this->path); - return parent::dir_readdir(); - } - - /** - * reset directory iteration - * - * @return bool - */ - public function dir_rewinddir() - { - self::recordMethodCall('dir_rewinddir', $this->path); - return parent::dir_rewinddir(); - } - - /** - * closes directory - * - * @return bool - */ - public function dir_closedir() - { - self::recordMethodCall('dir_closedir', $this->path); - return parent::dir_closedir(); - } - - /** - * returns status of url - * - * @param string $path path of url to return status for - * @param int $flags flags set by the stream API - * @return array - */ - public function url_stat($path, $flags) - { - self::recordMethodCall('url_stat', $path); - return parent::url_stat($path, $flags); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamAbstractContentTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamAbstractContentTestCase.php deleted file mode 100644 index 9bb6079..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamAbstractContentTestCase.php +++ /dev/null @@ -1,1054 +0,0 @@ -assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function executePermissionsForUser() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0100); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function executePermissionsForGroup() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0010); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function executePermissionsForOther() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0001); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function writePermissionsForUser() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0200); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function writePermissionsForGroup() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0020); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function writePermissionsForOther() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0002); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function executeAndWritePermissionsForUser() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0300); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function executeAndWritePermissionsForGroup() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0030); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function executeAndWritePermissionsForOther() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0003); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readPermissionsForUser() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0400); - $this->assertTrue($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readPermissionsForGroup() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0040); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readPermissionsForOther() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0004); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readAndExecutePermissionsForUser() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0500); - $this->assertTrue($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readAndExecutePermissionsForGroup() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0050); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readAndExecutePermissionsForOther() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0005); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readAndWritePermissionsForUser() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0600); - $this->assertTrue($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readAndWritePermissionsForGroup() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0060); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function readAndWritePermissionsForOther() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0006); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function allPermissionsForUser() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0700); - $this->assertTrue($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertTrue($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function allPermissionsForGroup() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0070); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - -1 - ) - ); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function allPermissionsForOther() - { - $abstractContent = new TestvfsStreamAbstractContent('foo', 0007); - $this->assertFalse($abstractContent->isReadable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isReadable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isReadable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isWritable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isWritable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isWritable(-1, - -1 - ) - ); - $this->assertFalse($abstractContent->isExecutable(vfsStream::getCurrentUser(), - vfsStream::getCurrentGroup() - ) - ); - $this->assertFalse($abstractContent->isExecutable(-1, - vfsStream::getCurrentGroup() - ) - ); - $this->assertTrue($abstractContent->isExecutable(-1, - -1 - ) - ); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamBlockTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamBlockTestCase.php deleted file mode 100644 index 33222f7..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamBlockTestCase.php +++ /dev/null @@ -1,89 +0,0 @@ -block = new vfsStreamBlock('foo'); - } - - /** - * test default values and methods - * - * @test - */ - public function defaultValues() - { - $this->assertEquals(vfsStreamContent::TYPE_BLOCK, $this->block->getType()); - $this->assertEquals('foo', $this->block->getName()); - $this->assertTrue($this->block->appliesTo('foo')); - $this->assertFalse($this->block->appliesTo('foo/bar')); - $this->assertFalse($this->block->appliesTo('bar')); - } - - /** - * tests how external functions see this object - * - * @test - */ - public function external() - { - $root = vfsStream::setup('root'); - $root->addChild(vfsStream::newBlock('foo')); - $this->assertEquals('block', filetype(vfsStream::url('root/foo'))); - } - - /** - * tests adding a complex structure - * - * @test - */ - public function addStructure() - { - $structure = array( - 'topLevel' => array( - 'thisIsAFile' => 'file contents', - '[blockDevice]' => 'block contents' - ) - ); - - $root = vfsStream::create($structure); - - $this->assertSame('block', filetype(vfsStream::url('root/topLevel/blockDevice'))); - } - - /** - * tests that a blank name for a block device throws an exception - * @test - * @expectedException org\bovigo\vfs\vfsStreamException - */ - public function createWithEmptyName() - { - $structure = array( - 'topLevel' => array( - 'thisIsAFile' => 'file contents', - '[]' => 'block contents' - ) - ); - - $root = vfsStream::create($structure); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php deleted file mode 100644 index e1b4fe1..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php +++ /dev/null @@ -1,112 +0,0 @@ -dir = new vfsStreamDirectory('foo'); - $this->mockChild1 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $this->mockChild1->expects($this->any()) - ->method('getName') - ->will($this->returnValue('bar')); - $this->dir->addChild($this->mockChild1); - $this->mockChild2 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $this->mockChild2->expects($this->any()) - ->method('getName') - ->will($this->returnValue('baz')); - $this->dir->addChild($this->mockChild2); - } - - /** - * clean up test environment - */ - public function tearDown() - { - vfsStream::enableDotfiles(); - } - - /** - * @return array - */ - public function provideSwitchWithExpectations() - { - return array(array(function() { vfsStream::disableDotfiles(); }, - array() - ), - array(function() { vfsStream::enableDotfiles(); }, - array('.', '..') - ) - ); - } - - private function getDirName($dir) - { - if (is_string($dir)) { - return $dir; - } - - - return $dir->getName(); - } - - /** - * @param \Closure $dotFilesSwitch - * @param array $dirNames - * @test - * @dataProvider provideSwitchWithExpectations - */ - public function iteration(\Closure $dotFilesSwitch, array $dirs) - { - $dirs[] = $this->mockChild1; - $dirs[] = $this->mockChild2; - $dotFilesSwitch(); - $dirIterator = $this->dir->getIterator(); - foreach ($dirs as $dir) { - $this->assertEquals($this->getDirName($dir), $dirIterator->key()); - $this->assertTrue($dirIterator->valid()); - if (!is_string($dir)) { - $this->assertSame($dir, $dirIterator->current()); - } - - $dirIterator->next(); - } - - $this->assertFalse($dirIterator->valid()); - $this->assertNull($dirIterator->key()); - $this->assertNull($dirIterator->current()); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamDirectoryIssue18TestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamDirectoryIssue18TestCase.php deleted file mode 100644 index 89cde1c..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamDirectoryIssue18TestCase.php +++ /dev/null @@ -1,81 +0,0 @@ -rootDirectory = vfsStream::newDirectory('/'); - $this->rootDirectory->addChild(vfsStream::newDirectory('var/log/app')); - $dir = $this->rootDirectory->getChild('var/log/app'); - $dir->addChild(vfsStream::newDirectory('app1')); - $dir->addChild(vfsStream::newDirectory('app2')); - $dir->addChild(vfsStream::newDirectory('foo')); - } - - /** - * @test - */ - public function shouldContainThreeSubdirectories() - { - $this->assertEquals(3, - count($this->rootDirectory->getChild('var/log/app')->getChildren()) - ); - } - - /** - * @test - */ - public function shouldContainSubdirectoryFoo() - { - $this->assertTrue($this->rootDirectory->getChild('var/log/app')->hasChild('foo')); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', - $this->rootDirectory->getChild('var/log/app')->getChild('foo') - ); - } - - /** - * @test - */ - public function shouldContainSubdirectoryApp1() - { - $this->assertTrue($this->rootDirectory->getChild('var/log/app')->hasChild('app1')); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', - $this->rootDirectory->getChild('var/log/app')->getChild('app1') - ); - } - - /** - * @test - */ - public function shouldContainSubdirectoryApp2() - { - $this->assertTrue($this->rootDirectory->getChild('var/log/app')->hasChild('app2')); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', - $this->rootDirectory->getChild('var/log/app')->getChild('app2') - ); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamDirectoryTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamDirectoryTestCase.php deleted file mode 100644 index f8b9384..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamDirectoryTestCase.php +++ /dev/null @@ -1,335 +0,0 @@ -dir = new vfsStreamDirectory('foo'); - } - - /** - * assure that a directory seperator inside the name throws an exception - * - * @test - * @expectedException org\bovigo\vfs\vfsStreamException - */ - public function invalidCharacterInName() - { - $dir = new vfsStreamDirectory('foo/bar'); - } - - /** - * test default values and methods - * - * @test - */ - public function defaultValues() - { - $this->assertEquals(vfsStreamContent::TYPE_DIR, $this->dir->getType()); - $this->assertEquals('foo', $this->dir->getName()); - $this->assertTrue($this->dir->appliesTo('foo')); - $this->assertTrue($this->dir->appliesTo('foo/bar')); - $this->assertFalse($this->dir->appliesTo('bar')); - $this->assertEquals(array(), $this->dir->getChildren()); - } - - /** - * test renaming the directory - * - * @test - */ - public function rename() - { - $this->dir->rename('bar'); - $this->assertEquals('bar', $this->dir->getName()); - $this->assertFalse($this->dir->appliesTo('foo')); - $this->assertFalse($this->dir->appliesTo('foo/bar')); - $this->assertTrue($this->dir->appliesTo('bar')); - } - - /** - * renaming the directory to an invalid name throws a vfsStreamException - * - * @test - * @expectedException org\bovigo\vfs\vfsStreamException - */ - public function renameToInvalidNameThrowsvfsStreamException() - { - $this->dir->rename('foo/baz'); - } - - /** - * @test - * @since 0.10.0 - */ - public function hasNoChildrenByDefault() - { - $this->assertFalse($this->dir->hasChildren()); - } - - /** - * @test - * @since 0.10.0 - */ - public function hasChildrenReturnsTrueIfAtLeastOneChildPresent() - { - $mockChild = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild->expects($this->any()) - ->method('appliesTo') - ->will($this->returnValue(false)); - $mockChild->expects($this->any()) - ->method('getName') - ->will($this->returnValue('baz')); - $this->dir->addChild($mockChild); - $this->assertTrue($this->dir->hasChildren()); - } - - /** - * @test - */ - public function hasChildReturnsFalseForNonExistingChild() - { - $this->assertFalse($this->dir->hasChild('bar')); - } - - /** - * @test - */ - public function getChildReturnsNullForNonExistingChild() - { - $this->assertNull($this->dir->getChild('bar')); - } - - /** - * @test - */ - public function removeChildReturnsFalseForNonExistingChild() - { - $this->assertFalse($this->dir->removeChild('bar')); - } - - /** - * @test - */ - public function nonExistingChild() - { - $mockChild = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild->expects($this->any()) - ->method('appliesTo') - ->will($this->returnValue(false)); - $mockChild->expects($this->any()) - ->method('getName') - ->will($this->returnValue('baz')); - $this->dir->addChild($mockChild); - $this->assertFalse($this->dir->removeChild('bar')); - } - - /** - * test that adding, handling and removing of a child works as expected - * - * @test - */ - public function childHandling() - { - $mockChild = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild->expects($this->any()) - ->method('getType') - ->will($this->returnValue(vfsStreamContent::TYPE_FILE)); - $mockChild->expects($this->any()) - ->method('getName') - ->will($this->returnValue('bar')); - $mockChild->expects($this->any()) - ->method('appliesTo') - ->with($this->equalTo('bar')) - ->will($this->returnValue(true)); - $mockChild->expects($this->once()) - ->method('size') - ->will($this->returnValue(5)); - $this->dir->addChild($mockChild); - $this->assertTrue($this->dir->hasChild('bar')); - $bar = $this->dir->getChild('bar'); - $this->assertSame($mockChild, $bar); - $this->assertEquals(array($mockChild), $this->dir->getChildren()); - $this->assertEquals(0, $this->dir->size()); - $this->assertEquals(5, $this->dir->sizeSummarized()); - $this->assertTrue($this->dir->removeChild('bar')); - $this->assertEquals(array(), $this->dir->getChildren()); - $this->assertEquals(0, $this->dir->size()); - $this->assertEquals(0, $this->dir->sizeSummarized()); - } - - /** - * test that adding, handling and removing of a child works as expected - * - * @test - */ - public function childHandlingWithSubdirectory() - { - $mockChild = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild->expects($this->any()) - ->method('getType') - ->will($this->returnValue(vfsStreamContent::TYPE_FILE)); - $mockChild->expects($this->any()) - ->method('getName') - ->will($this->returnValue('bar')); - $mockChild->expects($this->once()) - ->method('size') - ->will($this->returnValue(5)); - $subdir = new vfsStreamDirectory('subdir'); - $subdir->addChild($mockChild); - $this->dir->addChild($subdir); - $this->assertTrue($this->dir->hasChild('subdir')); - $this->assertSame($subdir, $this->dir->getChild('subdir')); - $this->assertEquals(array($subdir), $this->dir->getChildren()); - $this->assertEquals(0, $this->dir->size()); - $this->assertEquals(5, $this->dir->sizeSummarized()); - $this->assertTrue($this->dir->removeChild('subdir')); - $this->assertEquals(array(), $this->dir->getChildren()); - $this->assertEquals(0, $this->dir->size()); - $this->assertEquals(0, $this->dir->sizeSummarized()); - } - - /** - * dd - * - * @test - * @group regression - * @group bug_5 - */ - public function addChildReplacesChildWithSameName_Bug_5() - { - $mockChild1 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild1->expects($this->any()) - ->method('getType') - ->will($this->returnValue(vfsStreamContent::TYPE_FILE)); - $mockChild1->expects($this->any()) - ->method('getName') - ->will($this->returnValue('bar')); - $mockChild2 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild2->expects($this->any()) - ->method('getType') - ->will($this->returnValue(vfsStreamContent::TYPE_FILE)); - $mockChild2->expects($this->any()) - ->method('getName') - ->will($this->returnValue('bar')); - $this->dir->addChild($mockChild1); - $this->assertTrue($this->dir->hasChild('bar')); - $this->assertSame($mockChild1, $this->dir->getChild('bar')); - $this->dir->addChild($mockChild2); - $this->assertTrue($this->dir->hasChild('bar')); - $this->assertSame($mockChild2, $this->dir->getChild('bar')); - } - - /** - * When testing for a nested path, verify that directory separators are respected properly - * so that subdir1/subdir2 is not considered equal to subdir1Xsubdir2. - * - * @test - * @group bug_24 - * @group regression - */ - public function explicitTestForSeparatorWithNestedPaths_Bug_24() - { - $mockChild = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild->expects($this->any()) - ->method('getType') - ->will($this->returnValue(vfsStreamContent::TYPE_FILE)); - $mockChild->expects($this->any()) - ->method('getName') - ->will($this->returnValue('bar')); - - $subdir1 = new vfsStreamDirectory('subdir1'); - $this->dir->addChild($subdir1); - - $subdir2 = new vfsStreamDirectory('subdir2'); - $subdir1->addChild($subdir2); - - $subdir2->addChild($mockChild); - - $this->assertTrue($this->dir->hasChild('subdir1'), "Level 1 path with separator exists"); - $this->assertTrue($this->dir->hasChild('subdir1/subdir2'), "Level 2 path with separator exists"); - $this->assertTrue($this->dir->hasChild('subdir1/subdir2/bar'), "Level 3 path with separator exists"); - $this->assertFalse($this->dir->hasChild('subdir1.subdir2'), "Path with period does not exist"); - $this->assertFalse($this->dir->hasChild('subdir1.subdir2/bar'), "Nested path with period does not exist"); - } - - - /** - * setting and retrieving permissions for a directory - * - * @test - * @group permissions - */ - public function permissions() - { - $this->assertEquals(0777, $this->dir->getPermissions()); - $this->assertSame($this->dir, $this->dir->chmod(0755)); - $this->assertEquals(0755, $this->dir->getPermissions()); - } - - /** - * setting and retrieving permissions for a directory - * - * @test - * @group permissions - */ - public function permissionsSet() - { - $this->dir = new vfsStreamDirectory('foo', 0755); - $this->assertEquals(0755, $this->dir->getPermissions()); - $this->assertSame($this->dir, $this->dir->chmod(0700)); - $this->assertEquals(0700, $this->dir->getPermissions()); - } - - /** - * setting and retrieving owner of a file - * - * @test - * @group permissions - */ - public function owner() - { - $this->assertEquals(vfsStream::getCurrentUser(), $this->dir->getUser()); - $this->assertTrue($this->dir->isOwnedByUser(vfsStream::getCurrentUser())); - $this->assertSame($this->dir, $this->dir->chown(vfsStream::OWNER_USER_1)); - $this->assertEquals(vfsStream::OWNER_USER_1, $this->dir->getUser()); - $this->assertTrue($this->dir->isOwnedByUser(vfsStream::OWNER_USER_1)); - } - - /** - * setting and retrieving owner group of a file - * - * @test - * @group permissions - */ - public function group() - { - $this->assertEquals(vfsStream::getCurrentGroup(), $this->dir->getGroup()); - $this->assertTrue($this->dir->isOwnedByGroup(vfsStream::getCurrentGroup())); - $this->assertSame($this->dir, $this->dir->chgrp(vfsStream::GROUP_USER_1)); - $this->assertEquals(vfsStream::GROUP_USER_1, $this->dir->getGroup()); - $this->assertTrue($this->dir->isOwnedByGroup(vfsStream::GROUP_USER_1)); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamExLockTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamExLockTestCase.php deleted file mode 100644 index 9763560..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamExLockTestCase.php +++ /dev/null @@ -1,56 +0,0 @@ -at($root); - - } - - /** - * This test verifies the current behaviour where vfsStream URLs do not work - * with file_put_contents() and LOCK_EX. The test is intended to break once - * PHP changes this so we get notified about the change. - * - * @test - */ - public function filePutContentsLockShouldReportError() - { - @file_put_contents(vfsStream::url('root/testfile'), "some string\n", LOCK_EX); - $php_error = error_get_last(); - $this->assertEquals("file_put_contents(): Exclusive locks may only be set for regular files", $php_error['message']); - } - - /** - * @test - */ - public function flockSouldPass() - { - $fp = fopen(vfsStream::url('root/testfile'), 'w'); - flock($fp, LOCK_EX); - fwrite($fp, "another string\n"); - flock($fp, LOCK_UN); - fclose($fp); - $this->assertEquals("another string\n", file_get_contents(vfsStream::url('root/testfile'))); - } -} - diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php deleted file mode 100644 index 5fe15d0..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php +++ /dev/null @@ -1,306 +0,0 @@ -file = new vfsStreamFile('foo'); - } - - /** - * test default values and methods - * - * @test - */ - public function defaultValues() - { - $this->assertEquals(vfsStreamContent::TYPE_FILE, $this->file->getType()); - $this->assertEquals('foo', $this->file->getName()); - $this->assertTrue($this->file->appliesTo('foo')); - $this->assertFalse($this->file->appliesTo('foo/bar')); - $this->assertFalse($this->file->appliesTo('bar')); - } - - /** - * test setting and getting the content of a file - * - * @test - */ - public function content() - { - $this->assertNull($this->file->getContent()); - $this->assertSame($this->file, $this->file->setContent('bar')); - $this->assertEquals('bar', $this->file->getContent()); - $this->assertSame($this->file, $this->file->withContent('baz')); - $this->assertEquals('baz', $this->file->getContent()); - } - - /** - * test renaming the directory - * - * @test - */ - public function rename() - { - $this->file->rename('bar'); - $this->assertEquals('bar', $this->file->getName()); - $this->assertFalse($this->file->appliesTo('foo')); - $this->assertFalse($this->file->appliesTo('foo/bar')); - $this->assertTrue($this->file->appliesTo('bar')); - } - - /** - * test reading contents from the file - * - * @test - */ - public function readEmptyFile() - { - $this->assertTrue($this->file->eof()); - $this->assertEquals(0, $this->file->size()); - $this->assertEquals('', $this->file->read(5)); - $this->assertEquals(5, $this->file->getBytesRead()); - $this->assertTrue($this->file->eof()); - } - - /** - * test reading contents from the file - * - * @test - */ - public function read() - { - $this->file->setContent('foobarbaz'); - $this->assertFalse($this->file->eof()); - $this->assertEquals(9, $this->file->size()); - $this->assertEquals('foo', $this->file->read(3)); - $this->assertEquals(3, $this->file->getBytesRead()); - $this->assertFalse($this->file->eof()); - $this->assertEquals(9, $this->file->size()); - $this->assertEquals('bar', $this->file->read(3)); - $this->assertEquals(6, $this->file->getBytesRead()); - $this->assertFalse($this->file->eof()); - $this->assertEquals(9, $this->file->size()); - $this->assertEquals('baz', $this->file->read(3)); - $this->assertEquals(9, $this->file->getBytesRead()); - $this->assertEquals(9, $this->file->size()); - $this->assertTrue($this->file->eof()); - $this->assertEquals('', $this->file->read(3)); - } - - /** - * test seeking to offset - * - * @test - */ - public function seekEmptyFile() - { - $this->assertFalse($this->file->seek(0, 55)); - $this->assertTrue($this->file->seek(0, SEEK_SET)); - $this->assertEquals(0, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(5, SEEK_SET)); - $this->assertEquals(5, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(0, SEEK_CUR)); - $this->assertEquals(5, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(2, SEEK_CUR)); - $this->assertEquals(7, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(0, SEEK_END)); - $this->assertEquals(0, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(2, SEEK_END)); - $this->assertEquals(2, $this->file->getBytesRead()); - } - - /** - * test seeking to offset - * - * @test - */ - public function seekRead() - { - $this->file->setContent('foobarbaz'); - $this->assertFalse($this->file->seek(0, 55)); - $this->assertTrue($this->file->seek(0, SEEK_SET)); - $this->assertEquals('foobarbaz', $this->file->readUntilEnd()); - $this->assertEquals(0, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(5, SEEK_SET)); - $this->assertEquals('rbaz', $this->file->readUntilEnd()); - $this->assertEquals(5, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(0, SEEK_CUR)); - $this->assertEquals('rbaz', $this->file->readUntilEnd()); - $this->assertEquals(5, $this->file->getBytesRead(), 5); - $this->assertTrue($this->file->seek(2, SEEK_CUR)); - $this->assertEquals('az', $this->file->readUntilEnd()); - $this->assertEquals(7, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(0, SEEK_END)); - $this->assertEquals('', $this->file->readUntilEnd()); - $this->assertEquals(9, $this->file->getBytesRead()); - $this->assertTrue($this->file->seek(2, SEEK_END)); - $this->assertEquals('', $this->file->readUntilEnd()); - $this->assertEquals(11, $this->file->getBytesRead()); - } - - /** - * test writing data into the file - * - * @test - */ - public function writeEmptyFile() - { - $this->assertEquals(3, $this->file->write('foo')); - $this->assertEquals('foo', $this->file->getContent()); - $this->assertEquals(3, $this->file->size()); - $this->assertEquals(3, $this->file->write('bar')); - $this->assertEquals('foobar', $this->file->getContent()); - $this->assertEquals(6, $this->file->size()); - } - - /** - * test writing data into the file - * - * @test - */ - public function write() - { - $this->file->setContent('foobarbaz'); - $this->assertTrue($this->file->seek(3, SEEK_SET)); - $this->assertEquals(3, $this->file->write('foo')); - $this->assertEquals('foofoobaz', $this->file->getContent()); - $this->assertEquals(9, $this->file->size()); - $this->assertEquals(3, $this->file->write('bar')); - $this->assertEquals('foofoobar', $this->file->getContent()); - $this->assertEquals(9, $this->file->size()); - } - - /** - * setting and retrieving permissions for a file - * - * @test - * @group permissions - */ - public function permissions() - { - $this->assertEquals(0666, $this->file->getPermissions()); - $this->assertSame($this->file, $this->file->chmod(0644)); - $this->assertEquals(0644, $this->file->getPermissions()); - } - - /** - * setting and retrieving permissions for a file - * - * @test - * @group permissions - */ - public function permissionsSet() - { - $this->file = new vfsStreamFile('foo', 0644); - $this->assertEquals(0644, $this->file->getPermissions()); - $this->assertSame($this->file, $this->file->chmod(0600)); - $this->assertEquals(0600, $this->file->getPermissions()); - } - - /** - * setting and retrieving owner of a file - * - * @test - * @group permissions - */ - public function owner() - { - $this->assertEquals(vfsStream::getCurrentUser(), $this->file->getUser()); - $this->assertTrue($this->file->isOwnedByUser(vfsStream::getCurrentUser())); - $this->assertSame($this->file, $this->file->chown(vfsStream::OWNER_USER_1)); - $this->assertEquals(vfsStream::OWNER_USER_1, $this->file->getUser()); - $this->assertTrue($this->file->isOwnedByUser(vfsStream::OWNER_USER_1)); - } - - /** - * setting and retrieving owner group of a file - * - * @test - * @group permissions - */ - public function group() - { - $this->assertEquals(vfsStream::getCurrentGroup(), $this->file->getGroup()); - $this->assertTrue($this->file->isOwnedByGroup(vfsStream::getCurrentGroup())); - $this->assertSame($this->file, $this->file->chgrp(vfsStream::GROUP_USER_1)); - $this->assertEquals(vfsStream::GROUP_USER_1, $this->file->getGroup()); - $this->assertTrue($this->file->isOwnedByGroup(vfsStream::GROUP_USER_1)); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - */ - public function truncateRemovesSuperflouosContent() - { - $this->assertEquals(11, $this->file->write("lorem ipsum")); - $this->assertTrue($this->file->truncate(5)); - $this->assertEquals(5, $this->file->size()); - $this->assertEquals('lorem', $this->file->getContent()); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - */ - public function truncateToGreaterSizeAddsZeroBytes() - { - $this->assertEquals(11, $this->file->write("lorem ipsum")); - $this->assertTrue($this->file->truncate(25)); - $this->assertEquals(25, $this->file->size()); - $this->assertEquals("lorem ipsum\0\0\0\0\0\0\0\0\0\0\0\0\0\0", $this->file->getContent()); - } - - /** - * @test - * @group issue_79 - * @since 1.3.0 - */ - public function withContentAcceptsAnyFileContentInstance() - { - $mockFileContent = $this->getMock('org\bovigo\vfs\content\FileContent'); - $mockFileContent->expects($this->once()) - ->method('content') - ->will($this->returnValue('foobarbaz')); - $this->assertEquals( - 'foobarbaz', - $this->file->withContent($mockFileContent) - ->getContent() - ); - } - - /** - * @test - * @group issue_79 - * @expectedException \InvalidArgumentException - * @since 1.3.0 - */ - public function withContentThrowsInvalidArgumentExceptionWhenContentIsNoStringAndNoFileContent() - { - $this->file->withContent(313); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamGlobTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamGlobTestCase.php deleted file mode 100644 index 24884ed..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamGlobTestCase.php +++ /dev/null @@ -1,29 +0,0 @@ -assertEmpty(glob(vfsStream::url('example'), GLOB_MARK)); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamResolveIncludePathTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamResolveIncludePathTestCase.php deleted file mode 100644 index 106dae6..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamResolveIncludePathTestCase.php +++ /dev/null @@ -1,62 +0,0 @@ -backupIncludePath = get_include_path(); - vfsStream::setup(); - mkdir('vfs://root/a/path', 0777, true); - set_include_path('vfs://root/a' . PATH_SEPARATOR . $this->backupIncludePath); - } - - /** - * clean up test environment - */ - public function tearDown() - { - set_include_path($this->backupIncludePath); - } - - /** - * @test - */ - public function knownFileCanBeResolved() - { - file_put_contents('vfs://root/a/path/knownFile.php', ''); - $this->assertEquals('vfs://root/a/path/knownFile.php', stream_resolve_include_path('path/knownFile.php')); - } - - /** - * @test - */ - public function unknownFileCanNotBeResolvedYieldsFalse() - { - $this->assertFalse(@stream_resolve_include_path('path/unknownFile.php')); - } -} -?> diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php deleted file mode 100644 index 530d664..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php +++ /dev/null @@ -1,728 +0,0 @@ -assertEquals('vfs://foo', vfsStream::url('foo')); - $this->assertEquals('vfs://foo/bar.baz', vfsStream::url('foo/bar.baz')); - $this->assertEquals('vfs://foo/bar.baz', vfsStream::url('foo\bar.baz')); - } - - /** - * assure that url2path conversion works correct - * - * @test - */ - public function path() - { - $this->assertEquals('foo', vfsStream::path('vfs://foo')); - $this->assertEquals('foo/bar.baz', vfsStream::path('vfs://foo/bar.baz')); - $this->assertEquals('foo/bar.baz', vfsStream::path('vfs://foo\bar.baz')); - } - - /** - * windows directory separators are converted into default separator - * - * @author Gabriel Birke - * @test - */ - public function pathConvertsWindowsDirectorySeparators() - { - $this->assertEquals('foo/bar', vfsStream::path('vfs://foo\\bar')); - } - - /** - * trailing whitespace should be removed - * - * @author Gabriel Birke - * @test - */ - public function pathRemovesTrailingWhitespace() - { - $this->assertEquals('foo/bar', vfsStream::path('vfs://foo/bar ')); - } - - /** - * trailing slashes are removed - * - * @author Gabriel Birke - * @test - */ - public function pathRemovesTrailingSlash() - { - $this->assertEquals('foo/bar', vfsStream::path('vfs://foo/bar/')); - } - - /** - * trailing slash and whitespace should be removed - * - * @author Gabriel Birke - * @test - */ - public function pathRemovesTrailingSlashAndWhitespace() - { - $this->assertEquals('foo/bar', vfsStream::path('vfs://foo/bar/ ')); - } - - /** - * double slashes should be replaced by single slash - * - * @author Gabriel Birke - * @test - */ - public function pathRemovesDoubleSlashes() - { - // Regular path - $this->assertEquals('my/path', vfsStream::path('vfs://my/path')); - // Path with double slashes - $this->assertEquals('my/path', vfsStream::path('vfs://my//path')); - } - - /** - * test to create a new file - * - * @test - */ - public function newFile() - { - $file = vfsStream::newFile('filename.txt'); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamFile', $file); - $this->assertEquals('filename.txt', $file->getName()); - $this->assertEquals(0666, $file->getPermissions()); - } - - /** - * test to create a new file with non-default permissions - * - * @test - * @group permissions - */ - public function newFileWithDifferentPermissions() - { - $file = vfsStream::newFile('filename.txt', 0644); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamFile', $file); - $this->assertEquals('filename.txt', $file->getName()); - $this->assertEquals(0644, $file->getPermissions()); - } - - /** - * test to create a new directory structure - * - * @test - */ - public function newSingleDirectory() - { - $foo = vfsStream::newDirectory('foo'); - $this->assertEquals('foo', $foo->getName()); - $this->assertEquals(0, count($foo->getChildren())); - $this->assertEquals(0777, $foo->getPermissions()); - } - - /** - * test to create a new directory structure with non-default permissions - * - * @test - * @group permissions - */ - public function newSingleDirectoryWithDifferentPermissions() - { - $foo = vfsStream::newDirectory('foo', 0755); - $this->assertEquals('foo', $foo->getName()); - $this->assertEquals(0, count($foo->getChildren())); - $this->assertEquals(0755, $foo->getPermissions()); - } - - /** - * test to create a new directory structure - * - * @test - */ - public function newDirectoryStructure() - { - $foo = vfsStream::newDirectory('foo/bar/baz'); - $this->assertEquals('foo', $foo->getName()); - $this->assertEquals(0777, $foo->getPermissions()); - $this->assertTrue($foo->hasChild('bar')); - $this->assertTrue($foo->hasChild('bar/baz')); - $this->assertFalse($foo->hasChild('baz')); - $bar = $foo->getChild('bar'); - $this->assertEquals('bar', $bar->getName()); - $this->assertEquals(0777, $bar->getPermissions()); - $this->assertTrue($bar->hasChild('baz')); - $baz1 = $bar->getChild('baz'); - $this->assertEquals('baz', $baz1->getName()); - $this->assertEquals(0777, $baz1->getPermissions()); - $baz2 = $foo->getChild('bar/baz'); - $this->assertSame($baz1, $baz2); - } - - /** - * test that correct directory structure is created - * - * @test - */ - public function newDirectoryWithSlashAtStart() - { - $foo = vfsStream::newDirectory('/foo/bar/baz', 0755); - $this->assertEquals('foo', $foo->getName()); - $this->assertEquals(0755, $foo->getPermissions()); - $this->assertTrue($foo->hasChild('bar')); - $this->assertTrue($foo->hasChild('bar/baz')); - $this->assertFalse($foo->hasChild('baz')); - $bar = $foo->getChild('bar'); - $this->assertEquals('bar', $bar->getName()); - $this->assertEquals(0755, $bar->getPermissions()); - $this->assertTrue($bar->hasChild('baz')); - $baz1 = $bar->getChild('baz'); - $this->assertEquals('baz', $baz1->getName()); - $this->assertEquals(0755, $baz1->getPermissions()); - $baz2 = $foo->getChild('bar/baz'); - $this->assertSame($baz1, $baz2); - } - - /** - * @test - * @group setup - * @since 0.7.0 - */ - public function setupRegistersStreamWrapperAndCreatesRootDirectoryWithDefaultNameAndPermissions() - { - $root = vfsStream::setup(); - $this->assertSame($root, vfsStreamWrapper::getRoot()); - $this->assertEquals('root', $root->getName()); - $this->assertEquals(0777, $root->getPermissions()); - } - - /** - * @test - * @group setup - * @since 0.7.0 - */ - public function setupRegistersStreamWrapperAndCreatesRootDirectoryWithGivenNameAndDefaultPermissions() - { - $root = vfsStream::setup('foo'); - $this->assertSame($root, vfsStreamWrapper::getRoot()); - $this->assertEquals('foo', $root->getName()); - $this->assertEquals(0777, $root->getPermissions()); - } - - /** - * @test - * @group setup - * @since 0.7.0 - */ - public function setupRegistersStreamWrapperAndCreatesRootDirectoryWithGivenNameAndPermissions() - { - $root = vfsStream::setup('foo', 0444); - $this->assertSame($root, vfsStreamWrapper::getRoot()); - $this->assertEquals('foo', $root->getName()); - $this->assertEquals(0444, $root->getPermissions()); - } - - /** - * @test - * @group issue_14 - * @group issue_20 - * @since 0.10.0 - */ - public function setupWithEmptyArrayIsEqualToSetup() - { - $root = vfsStream::setup('example', - 0755, - array() - ); - $this->assertEquals('example', $root->getName()); - $this->assertEquals(0755, $root->getPermissions()); - $this->assertFalse($root->hasChildren()); - } - - /** - * @test - * @group issue_14 - * @group issue_20 - * @since 0.10.0 - */ - public function setupArraysAreTurnedIntoSubdirectories() - { - $root = vfsStream::setup('root', - null, - array('test' => array()) - ); - $this->assertTrue($root->hasChildren()); - $this->assertTrue($root->hasChild('test')); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', - $root->getChild('test') - ); - $this->assertFalse($root->getChild('test')->hasChildren()); - } - - /** - * @test - * @group issue_14 - * @group issue_20 - * @since 0.10.0 - */ - public function setupStringsAreTurnedIntoFilesWithContent() - { - $root = vfsStream::setup('root', - null, - array('test.txt' => 'some content') - ); - $this->assertTrue($root->hasChildren()); - $this->assertTrue($root->hasChild('test.txt')); - $this->assertVfsFile($root->getChild('test.txt'), 'some content'); - } - - /** - * @test - * @group issue_14 - * @group issue_20 - * @since 0.10.0 - */ - public function setupWorksRecursively() - { - $root = vfsStream::setup('root', - null, - array('test' => array('foo' => array('test.txt' => 'hello'), - 'baz.txt' => 'world' - ) - ) - ); - $this->assertTrue($root->hasChildren()); - $this->assertTrue($root->hasChild('test')); - $test = $root->getChild('test'); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', $test); - $this->assertTrue($test->hasChildren()); - $this->assertTrue($test->hasChild('baz.txt')); - $this->assertVfsFile($test->getChild('baz.txt'), 'world'); - - $this->assertTrue($test->hasChild('foo')); - $foo = $test->getChild('foo'); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', $foo); - $this->assertTrue($foo->hasChildren()); - $this->assertTrue($foo->hasChild('test.txt')); - $this->assertVfsFile($foo->getChild('test.txt'), 'hello'); - } - - /** - * @test - * @group issue_17 - * @group issue_20 - */ - public function setupCastsNumericDirectoriesToStrings() - { - $root = vfsStream::setup('root', - null, - array(2011 => array ('test.txt' => 'some content')) - ); - $this->assertTrue($root->hasChild('2011')); - - $directory = $root->getChild('2011'); - $this->assertVfsFile($directory->getChild('test.txt'), 'some content'); - - $this->assertTrue(file_exists('vfs://root/2011/test.txt')); - } - - /** - * @test - * @group issue_20 - * @since 0.11.0 - */ - public function createArraysAreTurnedIntoSubdirectories() - { - $baseDir = vfsStream::create(array('test' => array()), new vfsStreamDirectory('baseDir')); - $this->assertTrue($baseDir->hasChildren()); - $this->assertTrue($baseDir->hasChild('test')); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', - $baseDir->getChild('test') - ); - $this->assertFalse($baseDir->getChild('test')->hasChildren()); - } - - /** - * @test - * @group issue_20 - * @since 0.11.0 - */ - public function createArraysAreTurnedIntoSubdirectoriesOfRoot() - { - $root = vfsStream::setup(); - $this->assertSame($root, vfsStream::create(array('test' => array()))); - $this->assertTrue($root->hasChildren()); - $this->assertTrue($root->hasChild('test')); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', - $root->getChild('test') - ); - $this->assertFalse($root->getChild('test')->hasChildren()); - } - - /** - * @test - * @group issue_20 - * @expectedException \InvalidArgumentException - * @since 0.11.0 - */ - public function createThrowsExceptionIfNoBaseDirGivenAndNoRootSet() - { - vfsStream::create(array('test' => array())); - } - - /** - * @test - * @group issue_20 - * @since 0.11.0 - */ - public function createWorksRecursively() - { - $baseDir = vfsStream::create(array('test' => array('foo' => array('test.txt' => 'hello'), - 'baz.txt' => 'world' - ) - ), - new vfsStreamDirectory('baseDir') - ); - $this->assertTrue($baseDir->hasChildren()); - $this->assertTrue($baseDir->hasChild('test')); - $test = $baseDir->getChild('test'); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', $test); - $this->assertTrue($test->hasChildren()); - $this->assertTrue($test->hasChild('baz.txt')); - $this->assertVfsFile($test->getChild('baz.txt'), 'world'); - - $this->assertTrue($test->hasChild('foo')); - $foo = $test->getChild('foo'); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', $foo); - $this->assertTrue($foo->hasChildren()); - $this->assertTrue($foo->hasChild('test.txt')); - $this->assertVfsFile($foo->getChild('test.txt'), 'hello'); - } - - /** - * @test - * @group issue_20 - * @since 0.11.0 - */ - public function createWorksRecursivelyWithRoot() - { - $root = vfsStream::setup(); - $this->assertSame($root, - vfsStream::create(array('test' => array('foo' => array('test.txt' => 'hello'), - 'baz.txt' => 'world' - ) - ) - ) - ); - $this->assertTrue($root->hasChildren()); - $this->assertTrue($root->hasChild('test')); - $test = $root->getChild('test'); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', $test); - $this->assertTrue($test->hasChildren()); - $this->assertTrue($test->hasChild('baz.txt')); - $this->assertVfsFile($test->getChild('baz.txt'), 'world'); - - $this->assertTrue($test->hasChild('foo')); - $foo = $test->getChild('foo'); - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamDirectory', $foo); - $this->assertTrue($foo->hasChildren()); - $this->assertTrue($foo->hasChild('test.txt')); - $this->assertVfsFile($foo->getChild('test.txt'), 'hello'); - } - - /** - * @test - * @group issue_20 - * @since 0.10.0 - */ - public function createStringsAreTurnedIntoFilesWithContent() - { - $baseDir = vfsStream::create(array('test.txt' => 'some content'), new vfsStreamDirectory('baseDir')); - $this->assertTrue($baseDir->hasChildren()); - $this->assertTrue($baseDir->hasChild('test.txt')); - $this->assertVfsFile($baseDir->getChild('test.txt'), 'some content'); - } - - /** - * @test - * @group issue_20 - * @since 0.11.0 - */ - public function createStringsAreTurnedIntoFilesWithContentWithRoot() - { - $root = vfsStream::setup(); - $this->assertSame($root, - vfsStream::create(array('test.txt' => 'some content')) - ); - $this->assertTrue($root->hasChildren()); - $this->assertTrue($root->hasChild('test.txt')); - $this->assertVfsFile($root->getChild('test.txt'), 'some content'); - } - - /** - * @test - * @group issue_20 - * @since 0.11.0 - */ - public function createCastsNumericDirectoriesToStrings() - { - $baseDir = vfsStream::create(array(2011 => array ('test.txt' => 'some content')), new vfsStreamDirectory('baseDir')); - $this->assertTrue($baseDir->hasChild('2011')); - - $directory = $baseDir->getChild('2011'); - $this->assertVfsFile($directory->getChild('test.txt'), 'some content'); - } - - /** - * @test - * @group issue_20 - * @since 0.11.0 - */ - public function createCastsNumericDirectoriesToStringsWithRoot() - { - $root = vfsStream::setup(); - $this->assertSame($root, - vfsStream::create(array(2011 => array ('test.txt' => 'some content'))) - ); - $this->assertTrue($root->hasChild('2011')); - - $directory = $root->getChild('2011'); - $this->assertVfsFile($directory->getChild('test.txt'), 'some content'); - } - - /** - * helper function for assertions on vfsStreamFile - * - * @param vfsStreamFile $file - * @param string $content - */ - protected function assertVfsFile(vfsStreamFile $file, $content) - { - $this->assertInstanceOf('org\\bovigo\\vfs\\vfsStreamFile', - $file - ); - $this->assertEquals($content, - $file->getContent() - ); - } - - /** - * @test - * @group issue_10 - * @since 0.10.0 - */ - public function inspectWithContentGivesContentToVisitor() - { - $mockContent = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockVisitor = $this->getMock('org\\bovigo\\vfs\\visitor\\vfsStreamVisitor'); - $mockVisitor->expects($this->once()) - ->method('visit') - ->with($this->equalTo($mockContent)) - ->will($this->returnValue($mockVisitor)); - $this->assertSame($mockVisitor, vfsStream::inspect($mockVisitor, $mockContent)); - } - - /** - * @test - * @group issue_10 - * @since 0.10.0 - */ - public function inspectWithoutContentGivesRootToVisitor() - { - $root = vfsStream::setup(); - $mockVisitor = $this->getMock('org\\bovigo\\vfs\\visitor\\vfsStreamVisitor'); - $mockVisitor->expects($this->once()) - ->method('visitDirectory') - ->with($this->equalTo($root)) - ->will($this->returnValue($mockVisitor)); - $this->assertSame($mockVisitor, vfsStream::inspect($mockVisitor)); - } - - /** - * @test - * @group issue_10 - * @expectedException \InvalidArgumentException - * @since 0.10.0 - */ - public function inspectWithoutContentAndWithoutRootThrowsInvalidArgumentException() - { - $mockVisitor = $this->getMock('org\\bovigo\\vfs\\visitor\\vfsStreamVisitor'); - $mockVisitor->expects($this->never()) - ->method('visit'); - $mockVisitor->expects($this->never()) - ->method('visitDirectory'); - vfsStream::inspect($mockVisitor); - } - - /** - * returns path to file system copy resource directory - * - * @return string - */ - protected function getFileSystemCopyDir() - { - return realpath(dirname(__FILE__) . '/../../../../resources/filesystemcopy'); - } - - /** - * @test - * @group issue_4 - * @expectedException \InvalidArgumentException - * @since 0.11.0 - */ - public function copyFromFileSystemThrowsExceptionIfNoBaseDirGivenAndNoRootSet() - { - vfsStream::copyFromFileSystem($this->getFileSystemCopyDir()); - } - - /** - * @test - * @group issue_4 - * @since 0.11.0 - */ - public function copyFromEmptyFolder() - { - $baseDir = vfsStream::copyFromFileSystem($this->getFileSystemCopyDir() . '/emptyFolder', - vfsStream::newDirectory('test') - ); - $baseDir->removeChild('.gitignore'); - $this->assertFalse($baseDir->hasChildren()); - } - - /** - * @test - * @group issue_4 - * @since 0.11.0 - */ - public function copyFromEmptyFolderWithRoot() - { - $root = vfsStream::setup(); - $this->assertEquals($root, - vfsStream::copyFromFileSystem($this->getFileSystemCopyDir() . '/emptyFolder') - ); - $root->removeChild('.gitignore'); - $this->assertFalse($root->hasChildren()); - } - - /** - * @test - * @group issue_4 - * @since 0.11.0 - */ - public function copyFromWithSubFolders() - { - $baseDir = vfsStream::copyFromFileSystem($this->getFileSystemCopyDir(), - vfsStream::newDirectory('test'), - 3 - ); - $this->assertTrue($baseDir->hasChildren()); - $this->assertTrue($baseDir->hasChild('emptyFolder')); - $this->assertTrue($baseDir->hasChild('withSubfolders')); - $subfolderDir = $baseDir->getChild('withSubfolders'); - $this->assertTrue($subfolderDir->hasChild('subfolder1')); - $this->assertTrue($subfolderDir->getChild('subfolder1')->hasChild('file1.txt')); - $this->assertVfsFile($subfolderDir->getChild('subfolder1/file1.txt'), ' '); - $this->assertTrue($subfolderDir->hasChild('subfolder2')); - $this->assertTrue($subfolderDir->hasChild('aFile.txt')); - $this->assertVfsFile($subfolderDir->getChild('aFile.txt'), 'foo'); - } - - /** - * @test - * @group issue_4 - * @since 0.11.0 - */ - public function copyFromWithSubFoldersWithRoot() - { - $root = vfsStream::setup(); - $this->assertEquals($root, - vfsStream::copyFromFileSystem($this->getFileSystemCopyDir(), - null, - 3 - ) - ); - $this->assertTrue($root->hasChildren()); - $this->assertTrue($root->hasChild('emptyFolder')); - $this->assertTrue($root->hasChild('withSubfolders')); - $subfolderDir = $root->getChild('withSubfolders'); - $this->assertTrue($subfolderDir->hasChild('subfolder1')); - $this->assertTrue($subfolderDir->getChild('subfolder1')->hasChild('file1.txt')); - $this->assertVfsFile($subfolderDir->getChild('subfolder1/file1.txt'), ' '); - $this->assertTrue($subfolderDir->hasChild('subfolder2')); - $this->assertTrue($subfolderDir->hasChild('aFile.txt')); - $this->assertVfsFile($subfolderDir->getChild('aFile.txt'), 'foo'); - } - - /** - * @test - * @group issue_4 - * @group issue_29 - * @since 0.11.2 - */ - public function copyFromPreservesFilePermissions() - { - if (DIRECTORY_SEPARATOR !== '/') { - $this->markTestSkipped('Only applicable on Linux style systems.'); - } - - $copyDir = $this->getFileSystemCopyDir(); - $root = vfsStream::setup(); - $this->assertEquals($root, - vfsStream::copyFromFileSystem($copyDir, - null - ) - ); - $this->assertEquals(fileperms($copyDir . '/withSubfolders') - vfsStreamContent::TYPE_DIR, - $root->getChild('withSubfolders') - ->getPermissions() - ); - $this->assertEquals(fileperms($copyDir . '/withSubfolders/aFile.txt') - vfsStreamContent::TYPE_FILE, - $root->getChild('withSubfolders/aFile.txt') - ->getPermissions() - ); - } - - /** - * To test this the max file size is reduced to something reproduceable. - * - * @test - * @group issue_91 - * @since 1.5.0 - */ - public function copyFromFileSystemMocksLargeFiles() - { - if (DIRECTORY_SEPARATOR !== '/') { - $this->markTestSkipped('Only applicable on Linux style systems.'); - } - - $copyDir = $this->getFileSystemCopyDir(); - $root = vfsStream::setup(); - vfsStream::copyFromFileSystem($copyDir, $root, 3); - $this->assertEquals( - ' ', - $root->getChild('withSubfolders/subfolder1/file1.txt')->getContent() - ); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamUmaskTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamUmaskTestCase.php deleted file mode 100644 index 342af31..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamUmaskTestCase.php +++ /dev/null @@ -1,195 +0,0 @@ -assertEquals(vfsStream::umask(), - vfsStream::umask() - ); - $this->assertEquals(0000, - vfsStream::umask() - ); - } - - /** - * @test - */ - public function changingUmaskSettingReturnsOldUmaskSetting() - { - $this->assertEquals(0000, - vfsStream::umask(0022) - ); - $this->assertEquals(0022, - vfsStream::umask() - ); - } - - /** - * @test - */ - public function createFileWithDefaultUmaskSetting() - { - $file = new vfsStreamFile('foo'); - $this->assertEquals(0666, $file->getPermissions()); - } - - /** - * @test - */ - public function createFileWithDifferentUmaskSetting() - { - vfsStream::umask(0022); - $file = new vfsStreamFile('foo'); - $this->assertEquals(0644, $file->getPermissions()); - } - - /** - * @test - */ - public function createDirectoryWithDefaultUmaskSetting() - { - $directory = new vfsStreamDirectory('foo'); - $this->assertEquals(0777, $directory->getPermissions()); - } - - /** - * @test - */ - public function createDirectoryWithDifferentUmaskSetting() - { - vfsStream::umask(0022); - $directory = new vfsStreamDirectory('foo'); - $this->assertEquals(0755, $directory->getPermissions()); - } - - /** - * @test - */ - public function createFileUsingStreamWithDefaultUmaskSetting() - { - $root = vfsStream::setup(); - file_put_contents(vfsStream::url('root/newfile.txt'), 'file content'); - $this->assertEquals(0666, $root->getChild('newfile.txt')->getPermissions()); - } - - /** - * @test - */ - public function createFileUsingStreamWithDifferentUmaskSetting() - { - $root = vfsStream::setup(); - vfsStream::umask(0022); - file_put_contents(vfsStream::url('root/newfile.txt'), 'file content'); - $this->assertEquals(0644, $root->getChild('newfile.txt')->getPermissions()); - } - - /** - * @test - */ - public function createDirectoryUsingStreamWithDefaultUmaskSetting() - { - $root = vfsStream::setup(); - mkdir(vfsStream::url('root/newdir')); - $this->assertEquals(0777, $root->getChild('newdir')->getPermissions()); - } - - /** - * @test - */ - public function createDirectoryUsingStreamWithDifferentUmaskSetting() - { - $root = vfsStream::setup(); - vfsStream::umask(0022); - mkdir(vfsStream::url('root/newdir')); - $this->assertEquals(0755, $root->getChild('newdir')->getPermissions()); - } - - /** - * @test - */ - public function createDirectoryUsingStreamWithExplicit0() - { - $root = vfsStream::setup(); - vfsStream::umask(0022); - mkdir(vfsStream::url('root/newdir'), null); - $this->assertEquals(0000, $root->getChild('newdir')->getPermissions()); - } - - /** - * @test - * - */ - public function createDirectoryUsingStreamWithDifferentUmaskSettingButExplicit0777() - { - $root = vfsStream::setup(); - vfsStream::umask(0022); - mkdir(vfsStream::url('root/newdir'), 0777); - $this->assertEquals(0755, $root->getChild('newdir')->getPermissions()); - } - - /** - * @test - */ - public function createDirectoryUsingStreamWithDifferentUmaskSettingButExplicitModeRequestedByCall() - { - $root = vfsStream::setup(); - vfsStream::umask(0022); - mkdir(vfsStream::url('root/newdir'), 0700); - $this->assertEquals(0700, $root->getChild('newdir')->getPermissions()); - } - - /** - * @test - */ - public function defaultUmaskSettingDoesNotInfluenceSetup() - { - $root = vfsStream::setup(); - $this->assertEquals(0777, $root->getPermissions()); - } - - /** - * @test - */ - public function umaskSettingShouldBeRespectedBySetup() - { - vfsStream::umask(0022); - $root = vfsStream::setup(); - $this->assertEquals(0755, $root->getPermissions()); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperAlreadyRegisteredTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperAlreadyRegisteredTestCase.php deleted file mode 100644 index c7f78dc..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperAlreadyRegisteredTestCase.php +++ /dev/null @@ -1,63 +0,0 @@ -getMock('org\\bovigo\\vfs\\vfsStreamWrapper'); - stream_wrapper_register(vfsStream::SCHEME, get_class($mock)); - } - - /** - * clean up test environment - */ - public function tearDown() - { - TestvfsStreamWrapper::unregister(); - } - - /** - * registering the stream wrapper when another stream wrapper is already - * registered for the vfs scheme should throw an exception - * - * @test - * @expectedException org\bovigo\vfs\vfsStreamException - */ - public function registerOverAnotherStreamWrapper() - { - vfsStreamWrapper::register(); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperBaseTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperBaseTestCase.php deleted file mode 100644 index 52ec40c..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperBaseTestCase.php +++ /dev/null @@ -1,99 +0,0 @@ -fooURL = vfsStream::url('foo'); - $this->barURL = vfsStream::url('foo/bar'); - $this->baz1URL = vfsStream::url('foo/bar/baz1'); - $this->baz2URL = vfsStream::url('foo/baz2'); - $this->foo = new vfsStreamDirectory('foo'); - $this->bar = new vfsStreamDirectory('bar'); - $this->baz1 = vfsStream::newFile('baz1') - ->lastModified(300) - ->lastAccessed(300) - ->lastAttributeModified(300) - ->withContent('baz 1'); - $this->baz2 = vfsStream::newFile('baz2') - ->withContent('baz2') - ->lastModified(400) - ->lastAccessed(400) - ->lastAttributeModified(400); - $this->bar->addChild($this->baz1); - $this->foo->addChild($this->bar); - $this->foo->addChild($this->baz2); - $this->foo->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - $this->bar->lastModified(200) - ->lastAccessed(100) - ->lastAttributeModified(100); - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot($this->foo); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php deleted file mode 100644 index 1fd2a2d..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php +++ /dev/null @@ -1,73 +0,0 @@ -root = vfsStream::setup(); - } - - /** - * @test - */ - public function fileCanBeAccessedUsingWinDirSeparator() - { - vfsStream::newFile('foo/bar/baz.txt') - ->at($this->root) - ->withContent('test'); - $this->assertEquals('test', file_get_contents('vfs://root/foo\bar\baz.txt')); - } - - - /** - * @test - */ - public function directoryCanBeCreatedUsingWinDirSeparator() - { - mkdir('vfs://root/dir\bar\foo', true, 0777); - $this->assertTrue($this->root->hasChild('dir')); - $this->assertTrue($this->root->getChild('dir')->hasChild('bar')); - $this->assertTrue($this->root->getChild('dir/bar')->hasChild('foo')); - } - - /** - * @test - */ - public function directoryExitsTestUsingTrailingWinDirSeparator() - { - $structure = array( - 'dir' => array( - 'bar' => array( - ) - ) - ); - vfsStream::create($structure, $this->root); - - $this->assertTrue(file_exists(vfsStream::url('root/').'dir\\')); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirTestCase.php deleted file mode 100644 index 6e2f44b..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirTestCase.php +++ /dev/null @@ -1,488 +0,0 @@ -assertFalse(mkdir(vfsStream::url('another'))); - $this->assertEquals(2, count($this->foo->getChildren())); - $this->assertSame($this->foo, vfsStreamWrapper::getRoot()); - } - - /** - * mkdir() should not overwrite existing root - * - * @test - */ - public function mkdirNoNewRootRecursively() - { - $this->assertFalse(mkdir(vfsStream::url('another/more'), 0777, true)); - $this->assertEquals(2, count($this->foo->getChildren())); - $this->assertSame($this->foo, vfsStreamWrapper::getRoot()); - } - - /** - * assert that mkdir() creates the correct directory structure - * - * @test - * @group permissions - */ - public function mkdirNonRecursively() - { - $this->assertFalse(mkdir($this->barURL . '/another/more')); - $this->assertEquals(2, count($this->foo->getChildren())); - $this->assertTrue(mkdir($this->fooURL . '/another')); - $this->assertEquals(3, count($this->foo->getChildren())); - $this->assertEquals(0777, $this->foo->getChild('another')->getPermissions()); - } - - /** - * assert that mkdir() creates the correct directory structure - * - * @test - * @group permissions - */ - public function mkdirRecursively() - { - $this->assertTrue(mkdir($this->fooURL . '/another/more', 0777, true)); - $this->assertEquals(3, count($this->foo->getChildren())); - $another = $this->foo->getChild('another'); - $this->assertTrue($another->hasChild('more')); - $this->assertEquals(0777, $this->foo->getChild('another')->getPermissions()); - $this->assertEquals(0777, $this->foo->getChild('another')->getChild('more')->getPermissions()); - } - - /** - * @test - * @group issue_9 - * @since 0.9.0 - */ - public function mkdirWithDots() - { - $this->assertTrue(mkdir($this->fooURL . '/another/../more/.', 0777, true)); - $this->assertEquals(3, count($this->foo->getChildren())); - $this->assertTrue($this->foo->hasChild('more')); - } - - /** - * no root > new directory becomes root - * - * @test - * @group permissions - */ - public function mkdirWithoutRootCreatesNewRoot() - { - vfsStreamWrapper::register(); - $this->assertTrue(@mkdir(vfsStream::url('foo'))); - $this->assertEquals(vfsStreamContent::TYPE_DIR, vfsStreamWrapper::getRoot()->getType()); - $this->assertEquals('foo', vfsStreamWrapper::getRoot()->getName()); - $this->assertEquals(0777, vfsStreamWrapper::getRoot()->getPermissions()); - } - - /** - * trying to create a subdirectory of a file should not work - * - * @test - */ - public function mkdirOnFileReturnsFalse() - { - $this->assertFalse(mkdir($this->baz1URL . '/another/more', 0777, true)); - } - - /** - * assert that mkdir() creates the correct directory structure - * - * @test - * @group permissions - */ - public function mkdirNonRecursivelyDifferentPermissions() - { - $this->assertTrue(mkdir($this->fooURL . '/another', 0755)); - $this->assertEquals(0755, $this->foo->getChild('another')->getPermissions()); - } - - /** - * assert that mkdir() creates the correct directory structure - * - * @test - * @group permissions - */ - public function mkdirRecursivelyDifferentPermissions() - { - $this->assertTrue(mkdir($this->fooURL . '/another/more', 0755, true)); - $this->assertEquals(3, count($this->foo->getChildren())); - $another = $this->foo->getChild('another'); - $this->assertTrue($another->hasChild('more')); - $this->assertEquals(0755, $this->foo->getChild('another')->getPermissions()); - $this->assertEquals(0755, $this->foo->getChild('another')->getChild('more')->getPermissions()); - } - - /** - * assert that mkdir() creates the correct directory structure - * - * @test - * @group permissions - */ - public function mkdirRecursivelyUsesDefaultPermissions() - { - $this->foo->chmod(0700); - $this->assertTrue(mkdir($this->fooURL . '/another/more', 0777, true)); - $this->assertEquals(3, count($this->foo->getChildren())); - $another = $this->foo->getChild('another'); - $this->assertTrue($another->hasChild('more')); - $this->assertEquals(0777, $this->foo->getChild('another')->getPermissions()); - $this->assertEquals(0777, $this->foo->getChild('another')->getChild('more')->getPermissions()); - } - - /** - * no root > new directory becomes root - * - * @test - * @group permissions - */ - public function mkdirWithoutRootCreatesNewRootDifferentPermissions() - { - vfsStreamWrapper::register(); - $this->assertTrue(@mkdir(vfsStream::url('foo'), 0755)); - $this->assertEquals(vfsStreamContent::TYPE_DIR, vfsStreamWrapper::getRoot()->getType()); - $this->assertEquals('foo', vfsStreamWrapper::getRoot()->getName()); - $this->assertEquals(0755, vfsStreamWrapper::getRoot()->getPermissions()); - } - - /** - * no root > new directory becomes root - * - * @test - * @group permissions - */ - public function mkdirWithoutRootCreatesNewRootWithDefaultPermissions() - { - vfsStreamWrapper::register(); - $this->assertTrue(@mkdir(vfsStream::url('foo'))); - $this->assertEquals(vfsStreamContent::TYPE_DIR, vfsStreamWrapper::getRoot()->getType()); - $this->assertEquals('foo', vfsStreamWrapper::getRoot()->getName()); - $this->assertEquals(0777, vfsStreamWrapper::getRoot()->getPermissions()); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function mkdirDirCanNotCreateNewDirInNonWritingDirectory() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); - vfsStreamWrapper::getRoot()->addChild(new vfsStreamDirectory('restrictedFolder', 0000)); - $this->assertFalse(is_writable(vfsStream::url('root/restrictedFolder/'))); - $this->assertFalse(mkdir(vfsStream::url('root/restrictedFolder/newFolder'))); - $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('restrictedFolder/newFolder')); - } - - /** - * @test - * @group issue_28 - */ - public function mkDirShouldNotOverwriteExistingDirectories() - { - vfsStream::setup('root'); - $dir = vfsStream::url('root/dir'); - $this->assertTrue(mkdir($dir)); - $this->assertFalse(@mkdir($dir)); - } - - /** - * @test - * @group issue_28 - * @expectedException PHPUnit_Framework_Error - * @expectedExceptionMessage mkdir(): Path vfs://root/dir exists - */ - public function mkDirShouldNotOverwriteExistingDirectoriesAndTriggerE_USER_WARNING() - { - vfsStream::setup('root'); - $dir = vfsStream::url('root/dir'); - $this->assertTrue(mkdir($dir)); - $this->assertFalse(mkdir($dir)); - } - - /** - * @test - * @group issue_28 - */ - public function mkDirShouldNotOverwriteExistingFiles() - { - $root = vfsStream::setup('root'); - vfsStream::newFile('test.txt')->at($root); - $this->assertFalse(@mkdir(vfsStream::url('root/test.txt'))); - } - - /** - * @test - * @group issue_28 - * @expectedException PHPUnit_Framework_Error - * @expectedExceptionMessage mkdir(): Path vfs://root/test.txt exists - */ - public function mkDirShouldNotOverwriteExistingFilesAndTriggerE_USER_WARNING() - { - $root = vfsStream::setup('root'); - vfsStream::newFile('test.txt')->at($root); - $this->assertFalse(mkdir(vfsStream::url('root/test.txt'))); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function canNotIterateOverNonReadableDirectory() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0000)); - $this->assertFalse(@opendir(vfsStream::url('root'))); - $this->assertFalse(@dir(vfsStream::url('root'))); - } - - /** - * assert is_dir() returns correct result - * - * @test - */ - public function is_dir() - { - $this->assertTrue(is_dir($this->fooURL)); - $this->assertTrue(is_dir($this->fooURL . '/.')); - $this->assertTrue(is_dir($this->barURL)); - $this->assertTrue(is_dir($this->barURL . '/.')); - $this->assertFalse(is_dir($this->baz1URL)); - $this->assertFalse(is_dir($this->baz2URL)); - $this->assertFalse(is_dir($this->fooURL . '/another')); - $this->assertFalse(is_dir(vfsStream::url('another'))); - } - - /** - * can not unlink without root - * - * @test - */ - public function canNotUnlinkDirectoryWithoutRoot() - { - vfsStreamWrapper::register(); - $this->assertFalse(@rmdir(vfsStream::url('foo'))); - } - - /** - * rmdir() can not remove files - * - * @test - */ - public function rmdirCanNotRemoveFiles() - { - $this->assertFalse(rmdir($this->baz1URL)); - $this->assertFalse(rmdir($this->baz2URL)); - } - - /** - * rmdir() can not remove a non-existing directory - * - * @test - */ - public function rmdirCanNotRemoveNonExistingDirectory() - { - $this->assertFalse(rmdir($this->fooURL . '/another')); - } - - /** - * rmdir() can not remove non-empty directories - * - * @test - */ - public function rmdirCanNotRemoveNonEmptyDirectory() - { - $this->assertFalse(rmdir($this->fooURL)); - $this->assertFalse(rmdir($this->barURL)); - } - - /** - * @test - */ - public function rmdirCanRemoveEmptyDirectory() - { - vfsStream::newDirectory('empty')->at($this->foo); - $this->assertTrue($this->foo->hasChild('empty')); - $this->assertTrue(rmdir($this->fooURL . '/empty')); - $this->assertFalse($this->foo->hasChild('empty')); - } - - /** - * @test - */ - public function rmdirCanRemoveEmptyDirectoryWithDot() - { - vfsStream::newDirectory('empty')->at($this->foo); - $this->assertTrue($this->foo->hasChild('empty')); - $this->assertTrue(rmdir($this->fooURL . '/empty/.')); - $this->assertFalse($this->foo->hasChild('empty')); - } - - /** - * rmdir() can remove empty directories - * - * @test - */ - public function rmdirCanRemoveEmptyRoot() - { - $this->foo->removeChild('bar'); - $this->foo->removeChild('baz2'); - $this->assertTrue(rmdir($this->fooURL)); - $this->assertFalse(file_exists($this->fooURL)); // make sure statcache was cleared - $this->assertNull(vfsStreamWrapper::getRoot()); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function rmdirDirCanNotRemoveDirFromNonWritingDirectory() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0000)); - vfsStreamWrapper::getRoot()->addChild(new vfsStreamDirectory('nonRemovableFolder')); - $this->assertFalse(is_writable(vfsStream::url('root'))); - $this->assertFalse(rmdir(vfsStream::url('root/nonRemovableFolder'))); - $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('nonRemovableFolder')); - } - - /** - * @test - * @group permissions - * @group bug_17 - */ - public function issue17() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0770)); - vfsStreamWrapper::getRoot()->chgrp(vfsStream::GROUP_USER_1) - ->chown(vfsStream::OWNER_USER_1); - $this->assertFalse(mkdir(vfsStream::url('root/doesNotWork'))); - $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('doesNotWork')); - } - - /** - * @test - * @group bug_19 - */ - public function accessWithDoubleDotReturnsCorrectContent() - { - $this->assertEquals('baz2', - file_get_contents(vfsStream::url('foo/bar/../baz2')) - ); - } - - /** - * @test - * @group bug_115 - */ - public function accessWithExcessDoubleDotsReturnsCorrectContent() - { - $this->assertEquals('baz2', - file_get_contents(vfsStream::url('foo/../../../../bar/../baz2')) - ); - } - - /** - * @test - * @group bug_115 - */ - public function alwaysResolvesRootDirectoryAsOwnParentWithDoubleDot() - { - vfsStreamWrapper::getRoot()->chown(vfsStream::OWNER_USER_1); - - $this->assertTrue(is_dir(vfsStream::url('foo/..'))); - $stat = stat(vfsStream::url('foo/..')); - $this->assertEquals( - vfsStream::OWNER_USER_1, - $stat['uid'] - ); - } - - - /** - * @test - * @since 0.11.0 - * @group issue_23 - */ - public function unlinkCanNotRemoveNonEmptyDirectory() - { - try { - $this->assertFalse(unlink($this->barURL)); - } catch (\PHPUnit_Framework_Error $fe) { - $this->assertEquals('unlink(vfs://foo/bar): Operation not permitted', $fe->getMessage()); - } - - $this->assertTrue($this->foo->hasChild('bar')); - $this->assertFileExists($this->barURL); - } - - /** - * @test - * @since 0.11.0 - * @group issue_23 - */ - public function unlinkCanNotRemoveEmptyDirectory() - { - vfsStream::newDirectory('empty')->at($this->foo); - try { - $this->assertTrue(unlink($this->fooURL . '/empty')); - } catch (\PHPUnit_Framework_Error $fe) { - $this->assertEquals('unlink(vfs://foo/empty): Operation not permitted', $fe->getMessage()); - } - - $this->assertTrue($this->foo->hasChild('empty')); - $this->assertFileExists($this->fooURL . '/empty'); - } - - /** - * @test - * @group issue_32 - */ - public function canCreateFolderOfSameNameAsParentFolder() - { - $root = vfsStream::setup('testFolder'); - mkdir(vfsStream::url('testFolder') . '/testFolder/subTestFolder', 0777, true); - $this->assertTrue(file_exists(vfsStream::url('testFolder/testFolder/subTestFolder/.'))); - } - - /** - * @test - * @group issue_32 - */ - public function canRetrieveFolderOfSameNameAsParentFolder() - { - $root = vfsStream::setup('testFolder'); - mkdir(vfsStream::url('testFolder') . '/testFolder/subTestFolder', 0777, true); - $this->assertTrue($root->hasChild('testFolder')); - $this->assertNotNull($root->getChild('testFolder')); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTestCase.php deleted file mode 100644 index 5bcb37a..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTestCase.php +++ /dev/null @@ -1,458 +0,0 @@ -assertEquals('baz2', file_get_contents($this->baz2URL)); - $this->assertEquals('baz 1', file_get_contents($this->baz1URL)); - $this->assertFalse(@file_get_contents($this->barURL)); - $this->assertFalse(@file_get_contents($this->fooURL)); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function file_get_contentsNonReadableFile() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); - vfsStream::newFile('new.txt', 0000)->at(vfsStreamWrapper::getRoot())->withContent('content'); - $this->assertEquals('', @file_get_contents(vfsStream::url('root/new.txt'))); - } - - /** - * assert that file_put_contents() delivers correct file contents - * - * @test - */ - public function file_put_contentsExistingFile() - { - $this->assertEquals(14, file_put_contents($this->baz2URL, 'baz is not bar')); - $this->assertEquals('baz is not bar', $this->baz2->getContent()); - $this->assertEquals(6, file_put_contents($this->baz1URL, 'foobar')); - $this->assertEquals('foobar', $this->baz1->getContent()); - $this->assertFalse(@file_put_contents($this->barURL, 'This does not work.')); - $this->assertFalse(@file_put_contents($this->fooURL, 'This does not work, too.')); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function file_put_contentsExistingFileNonWritableDirectory() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0000)); - vfsStream::newFile('new.txt')->at(vfsStreamWrapper::getRoot())->withContent('content'); - $this->assertEquals(15, @file_put_contents(vfsStream::url('root/new.txt'), 'This does work.')); - $this->assertEquals('This does work.', file_get_contents(vfsStream::url('root/new.txt'))); - - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function file_put_contentsExistingNonWritableFile() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); - vfsStream::newFile('new.txt', 0400)->at(vfsStreamWrapper::getRoot())->withContent('content'); - $this->assertFalse(@file_put_contents(vfsStream::url('root/new.txt'), 'This does not work.')); - $this->assertEquals('content', file_get_contents(vfsStream::url('root/new.txt'))); - } - - /** - * assert that file_put_contents() delivers correct file contents - * - * @test - */ - public function file_put_contentsNonExistingFile() - { - $this->assertEquals(14, file_put_contents($this->fooURL . '/baznot.bar', 'baz is not bar')); - $this->assertEquals(3, count($this->foo->getChildren())); - $this->assertEquals(14, file_put_contents($this->barURL . '/baznot.bar', 'baz is not bar')); - $this->assertEquals(2, count($this->bar->getChildren())); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function file_put_contentsNonExistingFileNonWritableDirectory() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0000)); - $this->assertFalse(@file_put_contents(vfsStream::url('root/new.txt'), 'This does not work.')); - $this->assertFalse(file_exists(vfsStream::url('root/new.txt'))); - - } - - /** - * using a file pointer should work without any problems - * - * @test - */ - public function usingFilePointer() - { - $fp = fopen($this->baz1URL, 'r'); - $this->assertEquals(0, ftell($fp)); - $this->assertFalse(feof($fp)); - $this->assertEquals(0, fseek($fp, 2)); - $this->assertEquals(2, ftell($fp)); - $this->assertEquals(0, fseek($fp, 1, SEEK_CUR)); - $this->assertEquals(3, ftell($fp)); - $this->assertEquals(0, fseek($fp, 1, SEEK_END)); - $this->assertEquals(6, ftell($fp)); - $this->assertTrue(feof($fp)); - $this->assertEquals(0, fseek($fp, 2)); - $this->assertFalse(feof($fp)); - $this->assertEquals(2, ftell($fp)); - $this->assertEquals('z', fread($fp, 1)); - $this->assertEquals(3, ftell($fp)); - $this->assertEquals(' 1', fread($fp, 8092)); - $this->assertEquals(5, ftell($fp)); - $this->assertTrue(fclose($fp)); - } - - /** - * assert is_file() returns correct result - * - * @test - */ - public function is_file() - { - $this->assertFalse(is_file($this->fooURL)); - $this->assertFalse(is_file($this->barURL)); - $this->assertTrue(is_file($this->baz1URL)); - $this->assertTrue(is_file($this->baz2URL)); - $this->assertFalse(is_file($this->fooURL . '/another')); - $this->assertFalse(is_file(vfsStream::url('another'))); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function issue13CanNotOverwriteFiles() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - file_put_contents($vfsFile, 'd'); - $this->assertEquals('d', file_get_contents($vfsFile)); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function appendContentIfOpenedWithModeA() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - $fp = fopen($vfsFile, 'ab'); - fwrite($fp, 'd'); - fclose($fp); - $this->assertEquals('testd', file_get_contents($vfsFile)); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canOverwriteNonExistingFileWithModeX() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - $fp = fopen($vfsFile, 'xb'); - fwrite($fp, 'test'); - fclose($fp); - $this->assertEquals('test', file_get_contents($vfsFile)); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotOverwriteExistingFileWithModeX() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - $this->assertFalse(@fopen($vfsFile, 'xb')); - $this->assertEquals('test', file_get_contents($vfsFile)); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotOpenNonExistingFileReadonly() - { - $this->assertFalse(@fopen(vfsStream::url('foo/doesNotExist.txt'), 'rb')); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotOpenNonExistingFileReadAndWrite() - { - $this->assertFalse(@fopen(vfsStream::url('foo/doesNotExist.txt'), 'rb+')); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotOpenWithIllegalMode() - { - $this->assertFalse(@fopen($this->baz2URL, 'invalid')); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotWriteToReadOnlyFile() - { - $fp = fopen($this->baz2URL, 'rb'); - $this->assertEquals('baz2', fread($fp, 4096)); - $this->assertEquals(0, fwrite($fp, 'foo')); - fclose($fp); - $this->assertEquals('baz2', file_get_contents($this->baz2URL)); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotReadFromWriteOnlyFileWithModeW() - { - $fp = fopen($this->baz2URL, 'wb'); - $this->assertEquals('', fread($fp, 4096)); - $this->assertEquals(3, fwrite($fp, 'foo')); - fseek($fp, 0); - $this->assertEquals('', fread($fp, 4096)); - fclose($fp); - $this->assertEquals('foo', file_get_contents($this->baz2URL)); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotReadFromWriteOnlyFileWithModeA() - { - $fp = fopen($this->baz2URL, 'ab'); - $this->assertEquals('', fread($fp, 4096)); - $this->assertEquals(3, fwrite($fp, 'foo')); - fseek($fp, 0); - $this->assertEquals('', fread($fp, 4096)); - fclose($fp); - $this->assertEquals('baz2foo', file_get_contents($this->baz2URL)); - } - - /** - * @test - * @group issue7 - * @group issue13 - */ - public function canNotReadFromWriteOnlyFileWithModeX() - { - $vfsFile = vfsStream::url('foo/modeXtest.txt'); - $fp = fopen($vfsFile, 'xb'); - $this->assertEquals('', fread($fp, 4096)); - $this->assertEquals(3, fwrite($fp, 'foo')); - fseek($fp, 0); - $this->assertEquals('', fread($fp, 4096)); - fclose($fp); - $this->assertEquals('foo', file_get_contents($vfsFile)); - } - - /** - * @test - * @group permissions - * @group bug_15 - */ - public function canNotRemoveFileFromDirectoryWithoutWritePermissions() - { - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(new vfsStreamDirectory('root', 0000)); - vfsStream::newFile('new.txt')->at(vfsStreamWrapper::getRoot()); - $this->assertFalse(unlink(vfsStream::url('root/new.txt'))); - $this->assertTrue(file_exists(vfsStream::url('root/new.txt'))); - } - - /** - * @test - * @group issue_30 - */ - public function truncatesFileWhenOpenedWithModeW() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - $fp = fopen($vfsFile, 'wb'); - $this->assertEquals('', file_get_contents($vfsFile)); - fclose($fp); - } - - /** - * @test - * @group issue_30 - */ - public function createsNonExistingFileWhenOpenedWithModeC() - { - $vfsFile = vfsStream::url('foo/tobecreated.txt'); - $fp = fopen($vfsFile, 'cb'); - fwrite($fp, 'some content'); - $this->assertTrue($this->foo->hasChild('tobecreated.txt')); - fclose($fp); - $this->assertEquals('some content', file_get_contents($vfsFile)); - } - - /** - * @test - * @group issue_30 - */ - public function createsNonExistingFileWhenOpenedWithModeCplus() - { - $vfsFile = vfsStream::url('foo/tobecreated.txt'); - $fp = fopen($vfsFile, 'cb+'); - fwrite($fp, 'some content'); - $this->assertTrue($this->foo->hasChild('tobecreated.txt')); - fclose($fp); - $this->assertEquals('some content', file_get_contents($vfsFile)); - } - - /** - * @test - * @group issue_30 - */ - public function doesNotTruncateFileWhenOpenedWithModeC() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - $fp = fopen($vfsFile, 'cb'); - $this->assertEquals('test', file_get_contents($vfsFile)); - fclose($fp); - } - - /** - * @test - * @group issue_30 - */ - public function setsPointerToStartWhenOpenedWithModeC() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - $fp = fopen($vfsFile, 'cb'); - $this->assertEquals(0, ftell($fp)); - fclose($fp); - } - - /** - * @test - * @group issue_30 - */ - public function doesNotTruncateFileWhenOpenedWithModeCplus() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - $fp = fopen($vfsFile, 'cb+'); - $this->assertEquals('test', file_get_contents($vfsFile)); - fclose($fp); - } - - /** - * @test - * @group issue_30 - */ - public function setsPointerToStartWhenOpenedWithModeCplus() - { - $vfsFile = vfsStream::url('foo/overwrite.txt'); - file_put_contents($vfsFile, 'test'); - $fp = fopen($vfsFile, 'cb+'); - $this->assertEquals(0, ftell($fp)); - fclose($fp); - } - - /** - * @test - */ - public function cannotOpenExistingNonwritableFileWithModeA() - { - $this->baz1->chmod(0400); - $this->assertFalse(@fopen($this->baz1URL, 'a')); - } - - /** - * @test - */ - public function cannotOpenExistingNonwritableFileWithModeW() - { - $this->baz1->chmod(0400); - $this->assertFalse(@fopen($this->baz1URL, 'w')); - } - - /** - * @test - */ - public function cannotOpenNonReadableFileWithModeR() - { - $this->baz1->chmod(0); - $this->assertFalse(@fopen($this->baz1URL, 'r')); - } - - /** - * @test - */ - public function cannotRenameToNonWritableDir() - { - $this->bar->chmod(0); - $this->assertFalse(@rename($this->baz2URL, vfsStream::url('foo/bar/baz3'))); - } - - /** - * @test - * @group issue_38 - */ - public function cannotReadFileFromNonReadableDir() - { - $this->markTestSkipped("Issue #38."); - $this->bar->chmod(0); - $this->assertFalse(@file_get_contents($this->baz1URL)); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTimesTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTimesTestCase.php deleted file mode 100644 index ebe0a52..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTimesTestCase.php +++ /dev/null @@ -1,315 +0,0 @@ -lastModified(50) - ->lastAccessed(50) - ->lastAttributeModified(50); - $this->fooUrl = vfsStream::url('root/foo.txt'); - $this->barUrl = vfsStream::url('root/bar'); - $this->bazUrl = vfsStream::url('root/bar/baz.txt'); - } - - /** - * helper assertion for the tests - * - * @param string $url url to check - * @param vfsStreamContent $content content to compare - */ - protected function assertFileTimesEqualStreamTimes($url, vfsStreamContent $content) - { - $this->assertEquals(filemtime($url), $content->filemtime()); - $this->assertEquals(fileatime($url), $content->fileatime()); - $this->assertEquals(filectime($url), $content->filectime()); - } - - /** - * @test - * @group issue_7 - * @group issue_26 - */ - public function openFileChangesAttributeTimeOnly() - { - $file = vfsStream::newFile('foo.txt') - ->withContent('test') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - fclose(fopen($this->fooUrl, 'rb')); - $this->assertGreaterThan(time() - 2, fileatime($this->fooUrl)); - $this->assertLessThanOrEqual(time(), fileatime($this->fooUrl)); - $this->assertLessThanOrEqual(100, filemtime($this->fooUrl)); - $this->assertEquals(100, filectime($this->fooUrl)); - $this->assertFileTimesEqualStreamTimes($this->fooUrl, $file); - } - - /** - * @test - * @group issue_7 - * @group issue_26 - */ - public function fileGetContentsChangesAttributeTimeOnly() - { - $file = vfsStream::newFile('foo.txt') - ->withContent('test') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - file_get_contents($this->fooUrl); - $this->assertGreaterThan(time() - 2, fileatime($this->fooUrl)); - $this->assertLessThanOrEqual(time(), fileatime($this->fooUrl)); - $this->assertLessThanOrEqual(100, filemtime($this->fooUrl)); - $this->assertEquals(100, filectime($this->fooUrl)); - $this->assertFileTimesEqualStreamTimes($this->fooUrl, $file); - } - - /** - * @test - * @group issue_7 - * @group issue_26 - */ - public function openFileWithTruncateChangesAttributeAndModificationTime() - { - $file = vfsStream::newFile('foo.txt') - ->withContent('test') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - fclose(fopen($this->fooUrl, 'wb')); - $this->assertGreaterThan(time() - 2, filemtime($this->fooUrl)); - $this->assertGreaterThan(time() - 2, fileatime($this->fooUrl)); - $this->assertLessThanOrEqual(time(), filemtime($this->fooUrl)); - $this->assertLessThanOrEqual(time(), fileatime($this->fooUrl)); - $this->assertEquals(100, filectime($this->fooUrl)); - $this->assertFileTimesEqualStreamTimes($this->fooUrl, $file); - } - - /** - * @test - * @group issue_7 - */ - public function readFileChangesAccessTime() - { - $file = vfsStream::newFile('foo.txt') - ->withContent('test') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - $fp = fopen($this->fooUrl, 'rb'); - $openTime = time(); - sleep(2); - fread($fp, 1024); - fclose($fp); - $this->assertLessThanOrEqual($openTime, filemtime($this->fooUrl)); - $this->assertLessThanOrEqual($openTime + 3, fileatime($this->fooUrl)); - $this->assertEquals(100, filectime($this->fooUrl)); - $this->assertFileTimesEqualStreamTimes($this->fooUrl, $file); - } - - /** - * @test - * @group issue_7 - */ - public function writeFileChangesModificationTime() - { - $file = vfsStream::newFile('foo.txt') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - $fp = fopen($this->fooUrl, 'wb'); - $openTime = time(); - sleep(2); - fwrite($fp, 'test'); - fclose($fp); - $this->assertLessThanOrEqual($openTime + 3, filemtime($this->fooUrl)); - $this->assertLessThanOrEqual($openTime, fileatime($this->fooUrl)); - $this->assertEquals(100, filectime($this->fooUrl)); - $this->assertFileTimesEqualStreamTimes($this->fooUrl, $file); - - } - - /** - * @test - * @group issue_7 - */ - public function createNewFileSetsAllTimesToCurrentTime() - { - file_put_contents($this->fooUrl, 'test'); - $this->assertLessThanOrEqual(time(), filemtime($this->fooUrl)); - $this->assertEquals(fileatime($this->fooUrl), filectime($this->fooUrl)); - $this->assertEquals(fileatime($this->fooUrl), filemtime($this->fooUrl)); - $this->assertFileTimesEqualStreamTimes($this->fooUrl, vfsStreamWrapper::getRoot()->getChild('foo.txt')); - } - - /** - * @test - * @group issue_7 - */ - public function createNewFileChangesAttributeAndModificationTimeOfContainingDirectory() - { - $dir = vfsStream::newDirectory('bar') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - file_put_contents($this->bazUrl, 'test'); - $this->assertLessThanOrEqual(time(), filemtime($this->barUrl)); - $this->assertLessThanOrEqual(time(), filectime($this->barUrl)); - $this->assertEquals(100, fileatime($this->barUrl)); - $this->assertFileTimesEqualStreamTimes($this->barUrl, $dir); - } - - /** - * @test - * @group issue_7 - */ - public function addNewFileNameWithLinkFunctionChangesAttributeTimeOfOriginalFile() - { - $this->markTestSkipped('Links are currently not supported by vfsStream.'); - } - - /** - * @test - * @group issue_7 - */ - public function addNewFileNameWithLinkFunctionChangesAttributeAndModificationTimeOfDirectoryContainingLink() - { - $this->markTestSkipped('Links are currently not supported by vfsStream.'); - } - - /** - * @test - * @group issue_7 - */ - public function removeFileChangesAttributeAndModificationTimeOfContainingDirectory() - { - $dir = vfsStream::newDirectory('bar') - ->at(vfsStreamWrapper::getRoot()); - $file = vfsStream::newFile('baz.txt') - ->at($dir) - ->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - $dir->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - unlink($this->bazUrl); - $this->assertLessThanOrEqual(time(), filemtime($this->barUrl)); - $this->assertLessThanOrEqual(time(), filectime($this->barUrl)); - $this->assertEquals(100, fileatime($this->barUrl)); - $this->assertFileTimesEqualStreamTimes($this->barUrl, $dir); - } - - /** - * @test - * @group issue_7 - */ - public function renameFileChangesAttributeAndModificationTimeOfAffectedDirectories() - { - $target = vfsStream::newDirectory('target') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(200) - ->lastAccessed(200) - ->lastAttributeModified(200); - $source = vfsStream::newDirectory('bar') - ->at(vfsStreamWrapper::getRoot()); - $file = vfsStream::newFile('baz.txt') - ->at($source) - ->lastModified(300) - ->lastAccessed(300) - ->lastAttributeModified(300); - $source->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - rename($this->bazUrl, vfsStream::url('root/target/baz.txt')); - $this->assertLessThanOrEqual(time(), filemtime($this->barUrl)); - $this->assertLessThanOrEqual(time(), filectime($this->barUrl)); - $this->assertEquals(100, fileatime($this->barUrl)); - $this->assertFileTimesEqualStreamTimes($this->barUrl, $source); - $this->assertLessThanOrEqual(time(), filemtime(vfsStream::url('root/target'))); - $this->assertLessThanOrEqual(time(), filectime(vfsStream::url('root/target'))); - $this->assertEquals(200, fileatime(vfsStream::url('root/target'))); - $this->assertFileTimesEqualStreamTimes(vfsStream::url('root/target'), $target); - } - - /** - * @test - * @group issue_7 - */ - public function renameFileDoesNotChangeFileTimesOfFileItself() - { - $target = vfsStream::newDirectory('target') - ->at(vfsStreamWrapper::getRoot()) - ->lastModified(200) - ->lastAccessed(200) - ->lastAttributeModified(200); - $source = vfsStream::newDirectory('bar') - ->at(vfsStreamWrapper::getRoot()); - $file = vfsStream::newFile('baz.txt') - ->at($source) - ->lastModified(300) - ->lastAccessed(300) - ->lastAttributeModified(300); - $source->lastModified(100) - ->lastAccessed(100) - ->lastAttributeModified(100); - rename($this->bazUrl, vfsStream::url('root/target/baz.txt')); - $this->assertEquals(300, filemtime(vfsStream::url('root/target/baz.txt'))); - $this->assertEquals(300, filectime(vfsStream::url('root/target/baz.txt'))); - $this->assertEquals(300, fileatime(vfsStream::url('root/target/baz.txt'))); - $this->assertFileTimesEqualStreamTimes(vfsStream::url('root/target/baz.txt'), $file); - } - - /** - * @test - * @group issue_7 - */ - public function changeFileAttributesChangesAttributeTimeOfFileItself() - { - $this->markTestSkipped('Changing file attributes via stream wrapper for self-defined streams is not supported by PHP.'); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFlockTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFlockTestCase.php deleted file mode 100644 index 1b329dc..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFlockTestCase.php +++ /dev/null @@ -1,440 +0,0 @@ -root = vfsStream::setup(); - } - - /** - * @test - */ - public function fileIsNotLockedByDefault() - { - $this->assertFalse(vfsStream::newFile('foo.txt')->isLocked()); - } - - /** - * @test - */ - public function streamIsNotLockedByDefault() - { - file_put_contents(vfsStream::url('root/foo.txt'), 'content'); - $this->assertFalse($this->root->getChild('foo.txt')->isLocked()); - } - - /** - * @test - */ - public function canAquireSharedLock() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertTrue(flock($fp, LOCK_SH)); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp); - - } - - /** - * @test - */ - public function canAquireSharedLockWithNonBlockingFlockCall() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertTrue(flock($fp, LOCK_SH | LOCK_NB)); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp); - - } - - /** - * @test - */ - public function canAquireEclusiveLock() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertTrue(flock($fp, LOCK_EX)); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @test - */ - public function canAquireEclusiveLockWithNonBlockingFlockCall() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertTrue(flock($fp, LOCK_EX | LOCK_NB)); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @test - */ - public function canRemoveLock() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_EX); - $this->assertTrue(flock($fp, LOCK_UN)); - $this->assertFalse($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canRemoveLockWhenNotLocked() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertTrue(flock($fp, LOCK_UN)); - $this->assertFalse($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertFalse($file->hasSharedLock($fp)); - $this->assertFalse($file->hasExclusiveLock()); - $this->assertFalse($file->hasExclusiveLock($fp)); - fclose($fp); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canRemoveSharedLockWithoutRemovingSharedLockOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp1, LOCK_SH); - $file->lock($fp2, LOCK_SH); - $this->assertTrue(flock($fp1, LOCK_UN)); - $this->assertTrue($file->hasSharedLock()); - $this->assertFalse($file->hasSharedLock($fp1)); - $this->assertTrue($file->hasSharedLock($fp2)); - fclose($fp1); - fclose($fp2); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canNotRemoveSharedLockAcquiredOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp1, LOCK_SH); - $this->assertTrue(flock($fp2, LOCK_UN)); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp1); - fclose($fp2); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canNotRemoveExlusiveLockAcquiredOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp1, LOCK_EX); - $this->assertTrue(flock($fp2, LOCK_UN)); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - fclose($fp1); - fclose($fp2); - } - - /** - * @test - */ - public function canRemoveLockWithNonBlockingFlockCall() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_EX); - $this->assertTrue(flock($fp, LOCK_UN | LOCK_NB)); - $this->assertFalse($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canNotAquireExclusiveLockIfAlreadyExclusivelyLockedOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp1, LOCK_EX); - $this->assertFalse(flock($fp2, LOCK_EX + LOCK_NB)); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - $this->assertTrue($file->hasExclusiveLock($fp1)); - $this->assertFalse($file->hasExclusiveLock($fp2)); - fclose($fp1); - fclose($fp2); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canAquireExclusiveLockIfAlreadySelfExclusivelyLocked() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_EX); - $this->assertTrue(flock($fp, LOCK_EX + LOCK_NB)); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canNotAquireExclusiveLockIfAlreadySharedLockedOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp1, LOCK_SH); - $this->assertFalse(flock($fp2, LOCK_EX)); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp1); - fclose($fp2); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canAquireExclusiveLockIfAlreadySelfSharedLocked() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_SH); - $this->assertTrue(flock($fp, LOCK_EX)); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canNotAquireSharedLockIfAlreadyExclusivelyLockedOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp1, LOCK_EX); - $this->assertFalse(flock($fp2, LOCK_SH + LOCK_NB)); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - fclose($fp1); - fclose($fp2); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canAquireSharedLockIfAlreadySelfExclusivelyLocked() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_EX); - $this->assertTrue(flock($fp, LOCK_SH + LOCK_NB)); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canAquireSharedLockIfAlreadySelfSharedLocked() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_SH); - $this->assertTrue(flock($fp, LOCK_SH)); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function canAquireSharedLockIfAlreadySharedLockedOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp1, LOCK_SH); - $this->assertTrue(flock($fp2, LOCK_SH)); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertTrue($file->hasSharedLock($fp1)); - $this->assertTrue($file->hasSharedLock($fp2)); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp1); - fclose($fp2); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/31 - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_31 - * @group issue_40 - */ - public function removesExclusiveLockOnStreamClose() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_EX); - fclose($fp); - $this->assertFalse($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/31 - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_31 - * @group issue_40 - */ - public function removesSharedLockOnStreamClose() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp, LOCK_SH); - fclose($fp); - $this->assertFalse($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertFalse($file->hasExclusiveLock()); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function notRemovesExclusiveLockOnStreamCloseIfExclusiveLockAcquiredOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp2, LOCK_EX); - fclose($fp1); - $this->assertTrue($file->isLocked()); - $this->assertFalse($file->hasSharedLock()); - $this->assertTrue($file->hasExclusiveLock()); - $this->assertTrue($file->hasExclusiveLock($fp2)); - fclose($fp2); - } - - /** - * @see https://github.com/mikey179/vfsStream/issues/40 - * @test - * @group issue_40 - */ - public function notRemovesSharedLockOnStreamCloseIfSharedLockAcquiredOnOtherFileHandler() - { - $file = vfsStream::newFile('foo.txt')->at($this->root); - $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $file->lock($fp2, LOCK_SH); - fclose($fp1); - $this->assertTrue($file->isLocked()); - $this->assertTrue($file->hasSharedLock()); - $this->assertTrue($file->hasSharedLock($fp2)); - $this->assertFalse($file->hasExclusiveLock()); - fclose($fp2); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperLargeFileTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperLargeFileTestCase.php deleted file mode 100644 index ca1a3f5..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperLargeFileTestCase.php +++ /dev/null @@ -1,77 +0,0 @@ -largeFile = vfsStream::newFile('large.txt') - ->withContent(LargeFileContent::withGigabytes(100)) - ->at($root); - } - - /** - * @test - */ - public function hasLargeFileSize() - { - $this->assertEquals( - 100 * 1024 * 1024 * 1024, - filesize($this->largeFile->url()) - ); - } - - /** - * @test - */ - public function canReadFromLargeFile() - { - $fp = fopen($this->largeFile->url(), 'rb'); - $data = fread($fp, 15); - fclose($fp); - $this->assertEquals(str_repeat(' ', 15), $data); - } - - /** - * @test - */ - public function canWriteIntoLargeFile() - { - $fp = fopen($this->largeFile->url(), 'rb+'); - fseek($fp, 100 * 1024 * 1024, SEEK_SET); - fwrite($fp, 'foobarbaz'); - fclose($fp); - $this->largeFile->seek((100 * 1024 * 1024) - 3, SEEK_SET); - $this->assertEquals( - ' foobarbaz ', - $this->largeFile->read(15) - ); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperQuotaTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperQuotaTestCase.php deleted file mode 100644 index afaeb47..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperQuotaTestCase.php +++ /dev/null @@ -1,224 +0,0 @@ -root = vfsStream::setup(); - vfsStream::setQuota(10); - } - - /** - * @test - */ - public function writeLessThanQuotaWritesEverything() - { - $this->assertEquals(9, file_put_contents(vfsStream::url('root/file.txt'), '123456789')); - $this->assertEquals('123456789', $this->root->getChild('file.txt')->getContent()); - } - - /** - * @test - */ - public function writeUpToQotaWritesEverything() - { - $this->assertEquals(10, file_put_contents(vfsStream::url('root/file.txt'), '1234567890')); - $this->assertEquals('1234567890', $this->root->getChild('file.txt')->getContent()); - } - - /** - * @test - */ - public function writeMoreThanQotaWritesOnlyUpToQuota() - { - try { - file_put_contents(vfsStream::url('root/file.txt'), '12345678901'); - } catch (\PHPUnit_Framework_Error $e) { - $this->assertEquals('file_put_contents(): Only 10 of 11 bytes written, possibly out of free disk space', - $e->getMessage() - ); - } - - $this->assertEquals('1234567890', $this->root->getChild('file.txt')->getContent()); - } - - /** - * @test - */ - public function considersAllFilesForQuota() - { - vfsStream::newFile('foo.txt') - ->withContent('foo') - ->at(vfsStream::newDirectory('bar') - ->at($this->root) - ); - try { - file_put_contents(vfsStream::url('root/file.txt'), '12345678901'); - } catch (\PHPUnit_Framework_Error $e) { - $this->assertEquals('file_put_contents(): Only 7 of 11 bytes written, possibly out of free disk space', - $e->getMessage() - ); - } - - $this->assertEquals('1234567', $this->root->getChild('file.txt')->getContent()); - } - - /** - * @test - * @group issue_33 - */ - public function truncateToLessThanQuotaWritesEverything() - { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - - if (strstr(PHP_VERSION, 'hiphop') !== false) { - $this->markTestSkipped('Not supported on hhvm'); - } - - $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); - $this->assertTrue(ftruncate($fp, 9)); - fclose($fp); - $this->assertEquals(9, - $this->root->getChild('file.txt')->size() - ); - $this->assertEquals("\0\0\0\0\0\0\0\0\0", - $this->root->getChild('file.txt')->getContent() - ); - } - - /** - * @test - * @group issue_33 - */ - public function truncateUpToQotaWritesEverything() - { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - - if (strstr(PHP_VERSION, 'hiphop') !== false) { - $this->markTestSkipped('Not supported on hhvm'); - } - - $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); - $this->assertTrue(ftruncate($fp, 10)); - fclose($fp); - $this->assertEquals(10, - $this->root->getChild('file.txt')->size() - ); - $this->assertEquals("\0\0\0\0\0\0\0\0\0\0", - $this->root->getChild('file.txt')->getContent() - ); - } - - /** - * @test - * @group issue_33 - */ - public function truncateToMoreThanQotaWritesOnlyUpToQuota() - { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - - if (strstr(PHP_VERSION, 'hiphop') !== false) { - $this->markTestSkipped('Not supported on hhvm'); - } - - $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); - $this->assertTrue(ftruncate($fp, 11)); - fclose($fp); - $this->assertEquals(10, - $this->root->getChild('file.txt')->size() - ); - $this->assertEquals("\0\0\0\0\0\0\0\0\0\0", - $this->root->getChild('file.txt')->getContent() - ); - } - - /** - * @test - * @group issue_33 - */ - public function truncateConsidersAllFilesForQuota() - { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - - if (strstr(PHP_VERSION, 'hiphop') !== false) { - $this->markTestSkipped('Not supported on hhvm'); - } - - vfsStream::newFile('bar.txt') - ->withContent('bar') - ->at(vfsStream::newDirectory('bar') - ->at($this->root) - ); - $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); - $this->assertTrue(ftruncate($fp, 11)); - fclose($fp); - $this->assertEquals(7, - $this->root->getChild('file.txt')->size() - ); - $this->assertEquals("\0\0\0\0\0\0\0", - $this->root->getChild('file.txt')->getContent() - ); - } - - /** - * @test - * @group issue_33 - */ - public function canNotTruncateToGreaterLengthWhenDiscQuotaReached() - { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - - if (strstr(PHP_VERSION, 'hiphop') !== false) { - $this->markTestSkipped('Not supported on hhvm'); - } - - vfsStream::newFile('bar.txt') - ->withContent('1234567890') - ->at(vfsStream::newDirectory('bar') - ->at($this->root) - ); - $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); - $this->assertFalse(ftruncate($fp, 11)); - fclose($fp); - $this->assertEquals(0, - $this->root->getChild('file.txt')->size() - ); - $this->assertEquals('', - $this->root->getChild('file.txt')->getContent() - ); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperSetOptionTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperSetOptionTestCase.php deleted file mode 100644 index aa86bd3..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperSetOptionTestCase.php +++ /dev/null @@ -1,76 +0,0 @@ -root = vfsStream::setup(); - vfsStream::newFile('foo.txt')->at($this->root); - } - - /** - * @test - */ - public function setBlockingDoesNotWork() - { - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertFalse(stream_set_blocking($fp, 1)); - fclose($fp); - } - - /** - * @test - */ - public function removeBlockingDoesNotWork() - { - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertFalse(stream_set_blocking($fp, 0)); - fclose($fp); - } - - /** - * @test - */ - public function setTimeoutDoesNotWork() - { - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertFalse(stream_set_timeout($fp, 1)); - fclose($fp); - } - - /** - * @test - */ - public function setWriteBufferDoesNotWork() - { - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $this->assertEquals(-1, stream_set_write_buffer($fp, 512)); - fclose($fp); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperStreamSelectTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperStreamSelectTestCase.php deleted file mode 100644 index c2aec99..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperStreamSelectTestCase.php +++ /dev/null @@ -1,35 +0,0 @@ -at($root)->withContent('testContent'); - - $fp = fopen(vfsStream::url('root/foo.txt'), 'rb'); - $readarray = array($fp); - $writearray = array(); - $exceptarray = array(); - stream_select($readarray, $writearray, $exceptarray, 1); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php deleted file mode 100644 index 3dd4e51..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php +++ /dev/null @@ -1,770 +0,0 @@ -assertSame($this->foo, vfsStreamWrapper::getRoot()); - vfsStreamWrapper::register(); - $this->assertNull(vfsStreamWrapper::getRoot()); - } - - /** - * @test - * @since 0.11.0 - */ - public function setRootReturnsRoot() - { - vfsStreamWrapper::register(); - $root = vfsStream::newDirectory('root'); - $this->assertSame($root, vfsStreamWrapper::setRoot($root)); - } - - /** - * assure that filesize is returned correct - * - * @test - */ - public function filesize() - { - $this->assertEquals(0, filesize($this->fooURL)); - $this->assertEquals(0, filesize($this->fooURL . '/.')); - $this->assertEquals(0, filesize($this->barURL)); - $this->assertEquals(0, filesize($this->barURL . '/.')); - $this->assertEquals(4, filesize($this->baz2URL)); - $this->assertEquals(5, filesize($this->baz1URL)); - } - - /** - * assert that file_exists() delivers correct result - * - * @test - */ - public function file_exists() - { - $this->assertTrue(file_exists($this->fooURL)); - $this->assertTrue(file_exists($this->fooURL . '/.')); - $this->assertTrue(file_exists($this->barURL)); - $this->assertTrue(file_exists($this->barURL . '/.')); - $this->assertTrue(file_exists($this->baz1URL)); - $this->assertTrue(file_exists($this->baz2URL)); - $this->assertFalse(file_exists($this->fooURL . '/another')); - $this->assertFalse(file_exists(vfsStream::url('another'))); - } - - /** - * assert that filemtime() delivers correct result - * - * @test - */ - public function filemtime() - { - $this->assertEquals(100, filemtime($this->fooURL)); - $this->assertEquals(100, filemtime($this->fooURL . '/.')); - $this->assertEquals(200, filemtime($this->barURL)); - $this->assertEquals(200, filemtime($this->barURL . '/.')); - $this->assertEquals(300, filemtime($this->baz1URL)); - $this->assertEquals(400, filemtime($this->baz2URL)); - } - - /** - * @test - * @group issue_23 - */ - public function unlinkRemovesFilesOnly() - { - $this->assertTrue(unlink($this->baz2URL)); - $this->assertFalse(file_exists($this->baz2URL)); // make sure statcache was cleared - $this->assertEquals(array($this->bar), $this->foo->getChildren()); - $this->assertFalse(@unlink($this->fooURL . '/another')); - $this->assertFalse(@unlink(vfsStream::url('another'))); - $this->assertEquals(array($this->bar), $this->foo->getChildren()); - } - - /** - * @test - * @group issue_49 - */ - public function unlinkReturnsFalseWhenFileDoesNotExist() - { - vfsStream::setup()->addChild(vfsStream::newFile('foo.blubb')); - $this->assertFalse(@unlink(vfsStream::url('foo.blubb2'))); - } - - /** - * @test - * @group issue_49 - */ - public function unlinkReturnsFalseWhenFileDoesNotExistAndFileWithSameNameExistsInRoot() - { - vfsStream::setup()->addChild(vfsStream::newFile('foo.blubb')); - $this->assertFalse(@unlink(vfsStream::url('foo.blubb'))); - } - - /** - * assert dirname() returns correct directory name - * - * @test - */ - public function dirname() - { - $this->assertEquals($this->fooURL, dirname($this->barURL)); - $this->assertEquals($this->barURL, dirname($this->baz1URL)); - # returns "vfs:" instead of "." - # however this seems not to be fixable because dirname() does not - # call the stream wrapper - #$this->assertEquals(dirname(vfsStream::url('doesNotExist')), '.'); - } - - /** - * assert basename() returns correct file name - * - * @test - */ - public function basename() - { - $this->assertEquals('bar', basename($this->barURL)); - $this->assertEquals('baz1', basename($this->baz1URL)); - $this->assertEquals('doesNotExist', basename(vfsStream::url('doesNotExist'))); - } - - /** - * assert is_readable() works correct - * - * @test - */ - public function is_readable() - { - $this->assertTrue(is_readable($this->fooURL)); - $this->assertTrue(is_readable($this->fooURL . '/.')); - $this->assertTrue(is_readable($this->barURL)); - $this->assertTrue(is_readable($this->barURL . '/.')); - $this->assertTrue(is_readable($this->baz1URL)); - $this->assertTrue(is_readable($this->baz2URL)); - $this->assertFalse(is_readable($this->fooURL . '/another')); - $this->assertFalse(is_readable(vfsStream::url('another'))); - - $this->foo->chmod(0222); - $this->assertFalse(is_readable($this->fooURL)); - - $this->baz1->chmod(0222); - $this->assertFalse(is_readable($this->baz1URL)); - } - - /** - * assert is_writable() works correct - * - * @test - */ - public function is_writable() - { - $this->assertTrue(is_writable($this->fooURL)); - $this->assertTrue(is_writable($this->fooURL . '/.')); - $this->assertTrue(is_writable($this->barURL)); - $this->assertTrue(is_writable($this->barURL . '/.')); - $this->assertTrue(is_writable($this->baz1URL)); - $this->assertTrue(is_writable($this->baz2URL)); - $this->assertFalse(is_writable($this->fooURL . '/another')); - $this->assertFalse(is_writable(vfsStream::url('another'))); - - $this->foo->chmod(0444); - $this->assertFalse(is_writable($this->fooURL)); - - $this->baz1->chmod(0444); - $this->assertFalse(is_writable($this->baz1URL)); - } - - /** - * assert is_executable() works correct - * - * @test - */ - public function is_executable() - { - $this->assertFalse(is_executable($this->baz1URL)); - $this->baz1->chmod(0766); - $this->assertTrue(is_executable($this->baz1URL)); - $this->assertFalse(is_executable($this->baz2URL)); - } - - /** - * assert is_executable() works correct - * - * @test - */ - public function directoriesAndNonExistingFilesAreNeverExecutable() - { - $this->assertFalse(is_executable($this->fooURL)); - $this->assertFalse(is_executable($this->fooURL . '/.')); - $this->assertFalse(is_executable($this->barURL)); - $this->assertFalse(is_executable($this->barURL . '/.')); - $this->assertFalse(is_executable($this->fooURL . '/another')); - $this->assertFalse(is_executable(vfsStream::url('another'))); - } - - /** - * file permissions - * - * @test - * @group permissions - */ - public function chmod() - { - $this->assertEquals(40777, decoct(fileperms($this->fooURL))); - $this->assertEquals(40777, decoct(fileperms($this->fooURL . '/.'))); - $this->assertEquals(40777, decoct(fileperms($this->barURL))); - $this->assertEquals(40777, decoct(fileperms($this->barURL . '/.'))); - $this->assertEquals(100666, decoct(fileperms($this->baz1URL))); - $this->assertEquals(100666, decoct(fileperms($this->baz2URL))); - - $this->foo->chmod(0755); - $this->bar->chmod(0700); - $this->baz1->chmod(0644); - $this->baz2->chmod(0600); - $this->assertEquals(40755, decoct(fileperms($this->fooURL))); - $this->assertEquals(40755, decoct(fileperms($this->fooURL . '/.'))); - $this->assertEquals(40700, decoct(fileperms($this->barURL))); - $this->assertEquals(40700, decoct(fileperms($this->barURL . '/.'))); - $this->assertEquals(100644, decoct(fileperms($this->baz1URL))); - $this->assertEquals(100600, decoct(fileperms($this->baz2URL))); - } - - /** - * @test - * @group issue_11 - * @group permissions - */ - public function chmodModifiesPermissions() - { - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertFalse(@chmod($this->fooURL, 0755)); - $this->assertFalse(@chmod($this->barURL, 0711)); - $this->assertFalse(@chmod($this->baz1URL, 0644)); - $this->assertFalse(@chmod($this->baz2URL, 0664)); - $this->assertEquals(40777, decoct(fileperms($this->fooURL))); - $this->assertEquals(40777, decoct(fileperms($this->barURL))); - $this->assertEquals(100666, decoct(fileperms($this->baz1URL))); - $this->assertEquals(100666, decoct(fileperms($this->baz2URL))); - } else { - $this->assertTrue(chmod($this->fooURL, 0755)); - $this->assertTrue(chmod($this->barURL, 0711)); - $this->assertTrue(chmod($this->baz1URL, 0644)); - $this->assertTrue(chmod($this->baz2URL, 0664)); - $this->assertEquals(40755, decoct(fileperms($this->fooURL))); - $this->assertEquals(40711, decoct(fileperms($this->barURL))); - $this->assertEquals(100644, decoct(fileperms($this->baz1URL))); - $this->assertEquals(100664, decoct(fileperms($this->baz2URL))); - } - } - - /** - * @test - * @group permissions - */ - public function fileownerIsCurrentUserByDefault() - { - $this->assertEquals(vfsStream::getCurrentUser(), fileowner($this->fooURL)); - $this->assertEquals(vfsStream::getCurrentUser(), fileowner($this->fooURL . '/.')); - $this->assertEquals(vfsStream::getCurrentUser(), fileowner($this->barURL)); - $this->assertEquals(vfsStream::getCurrentUser(), fileowner($this->barURL . '/.')); - $this->assertEquals(vfsStream::getCurrentUser(), fileowner($this->baz1URL)); - $this->assertEquals(vfsStream::getCurrentUser(), fileowner($this->baz2URL)); - } - - /** - * @test - * @group issue_11 - * @group permissions - */ - public function chownChangesUser() - { - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->foo->chown(vfsStream::OWNER_USER_1); - $this->bar->chown(vfsStream::OWNER_USER_1); - $this->baz1->chown(vfsStream::OWNER_USER_2); - $this->baz2->chown(vfsStream::OWNER_USER_2); - } else { - chown($this->fooURL, vfsStream::OWNER_USER_1); - chown($this->barURL, vfsStream::OWNER_USER_1); - chown($this->baz1URL, vfsStream::OWNER_USER_2); - chown($this->baz2URL, vfsStream::OWNER_USER_2); - } - - $this->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->fooURL)); - $this->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->fooURL . '/.')); - $this->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->barURL)); - $this->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->barURL . '/.')); - $this->assertEquals(vfsStream::OWNER_USER_2, fileowner($this->baz1URL)); - $this->assertEquals(vfsStream::OWNER_USER_2, fileowner($this->baz2URL)); - } - - /** - * @test - * @group issue_11 - * @group permissions - */ - public function chownDoesNotWorkOnVfsStreamUrls() - { - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertFalse(@chown($this->fooURL, vfsStream::OWNER_USER_2)); - $this->assertEquals(vfsStream::getCurrentUser(), fileowner($this->fooURL)); - } - } - - /** - * @test - * @group issue_11 - * @group permissions - */ - public function groupIsCurrentGroupByDefault() - { - $this->assertEquals(vfsStream::getCurrentGroup(), filegroup($this->fooURL)); - $this->assertEquals(vfsStream::getCurrentGroup(), filegroup($this->fooURL . '/.')); - $this->assertEquals(vfsStream::getCurrentGroup(), filegroup($this->barURL)); - $this->assertEquals(vfsStream::getCurrentGroup(), filegroup($this->barURL . '/.')); - $this->assertEquals(vfsStream::getCurrentGroup(), filegroup($this->baz1URL)); - $this->assertEquals(vfsStream::getCurrentGroup(), filegroup($this->baz2URL)); - } - - /** - * @test - * @group issue_11 - * @group permissions - */ - public function chgrp() - { - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->foo->chgrp(vfsStream::GROUP_USER_1); - $this->bar->chgrp(vfsStream::GROUP_USER_1); - $this->baz1->chgrp(vfsStream::GROUP_USER_2); - $this->baz2->chgrp(vfsStream::GROUP_USER_2); - } else { - chgrp($this->fooURL, vfsStream::GROUP_USER_1); - chgrp($this->barURL, vfsStream::GROUP_USER_1); - chgrp($this->baz1URL, vfsStream::GROUP_USER_2); - chgrp($this->baz2URL, vfsStream::GROUP_USER_2); - } - - $this->assertEquals(vfsStream::GROUP_USER_1, filegroup($this->fooURL)); - $this->assertEquals(vfsStream::GROUP_USER_1, filegroup($this->fooURL . '/.')); - $this->assertEquals(vfsStream::GROUP_USER_1, filegroup($this->barURL)); - $this->assertEquals(vfsStream::GROUP_USER_1, filegroup($this->barURL . '/.')); - $this->assertEquals(vfsStream::GROUP_USER_2, filegroup($this->baz1URL)); - $this->assertEquals(vfsStream::GROUP_USER_2, filegroup($this->baz2URL)); - } - - /** - * @test - * @group issue_11 - * @group permissions - */ - public function chgrpDoesNotWorkOnVfsStreamUrls() - { - if (version_compare(phpversion(), '5.4.0', '<')) { - $this->assertFalse(@chgrp($this->fooURL, vfsStream::GROUP_USER_2)); - $this->assertEquals(vfsStream::getCurrentGroup(), filegroup($this->fooURL)); - } - } - - /** - * @test - * @author Benoit Aubuchon - */ - public function renameDirectory() - { - // move foo/bar to foo/baz3 - $baz3URL = vfsStream::url('foo/baz3'); - $this->assertTrue(rename($this->barURL, $baz3URL)); - $this->assertFileExists($baz3URL); - $this->assertFileNotExists($this->barURL); - } - - /** - * @test - */ - public function renameDirectoryWithDots() - { - // move foo/bar to foo/baz3 - $baz3URL = vfsStream::url('foo/baz3'); - $this->assertTrue(rename($this->barURL . '/.', $baz3URL)); - $this->assertFileExists($baz3URL); - $this->assertFileNotExists($this->barURL); - } - - /** - * @test - * @group issue_9 - * @since 0.9.0 - */ - public function renameDirectoryWithDotsInTarget() - { - // move foo/bar to foo/baz3 - $baz3URL = vfsStream::url('foo/../baz3/.'); - $this->assertTrue(rename($this->barURL . '/.', $baz3URL)); - $this->assertFileExists($baz3URL); - $this->assertFileNotExists($this->barURL); - } - - /** - * @test - * @author Benoit Aubuchon - */ - public function renameDirectoryOverwritingExistingFile() - { - // move foo/bar to foo/baz2 - $this->assertTrue(rename($this->barURL, $this->baz2URL)); - $this->assertFileExists(vfsStream::url('foo/baz2/baz1')); - $this->assertFileNotExists($this->barURL); - } - - /** - * @test - * @expectedException PHPUnit_Framework_Error - */ - public function renameFileIntoFile() - { - // foo/baz2 is a file, so it can not be turned into a directory - $baz3URL = vfsStream::url('foo/baz2/baz3'); - $this->assertTrue(rename($this->baz1URL, $baz3URL)); - $this->assertFileExists($baz3URL); - $this->assertFileNotExists($this->baz1URL); - } - - /** - * @test - * @author Benoit Aubuchon - */ - public function renameFileToDirectory() - { - // move foo/bar/baz1 to foo/baz3 - $baz3URL = vfsStream::url('foo/baz3'); - $this->assertTrue(rename($this->baz1URL, $baz3URL)); - $this->assertFileExists($this->barURL); - $this->assertFileExists($baz3URL); - $this->assertFileNotExists($this->baz1URL); - } - - /** - * assert that trying to rename from a non existing file trigger a warning - * - * @expectedException PHPUnit_Framework_Error - * @test - */ - public function renameOnSourceFileNotFound() - { - rename(vfsStream::url('notfound'), $this->baz1URL); - } - /** - * assert that trying to rename to a directory that is not found trigger a warning - - * @expectedException PHPUnit_Framework_Error - * @test - */ - public function renameOnDestinationDirectoryFileNotFound() - { - rename($this->baz1URL, vfsStream::url('foo/notfound/file2')); - } - /** - * stat() and fstat() should return the same result - * - * @test - */ - public function statAndFstatReturnSameResult() - { - $fp = fopen($this->baz2URL, 'r'); - $this->assertEquals(stat($this->baz2URL), - fstat($fp) - ); - fclose($fp); - } - - /** - * stat() returns full data - * - * @test - */ - public function statReturnsFullDataForFiles() - { - $this->assertEquals(array(0 => 0, - 1 => 0, - 2 => 0100666, - 3 => 0, - 4 => vfsStream::getCurrentUser(), - 5 => vfsStream::getCurrentGroup(), - 6 => 0, - 7 => 4, - 8 => 400, - 9 => 400, - 10 => 400, - 11 => -1, - 12 => -1, - 'dev' => 0, - 'ino' => 0, - 'mode' => 0100666, - 'nlink' => 0, - 'uid' => vfsStream::getCurrentUser(), - 'gid' => vfsStream::getCurrentGroup(), - 'rdev' => 0, - 'size' => 4, - 'atime' => 400, - 'mtime' => 400, - 'ctime' => 400, - 'blksize' => -1, - 'blocks' => -1 - ), - stat($this->baz2URL) - ); - } - - /** - * @test - */ - public function statReturnsFullDataForDirectories() - { - $this->assertEquals(array(0 => 0, - 1 => 0, - 2 => 0040777, - 3 => 0, - 4 => vfsStream::getCurrentUser(), - 5 => vfsStream::getCurrentGroup(), - 6 => 0, - 7 => 0, - 8 => 100, - 9 => 100, - 10 => 100, - 11 => -1, - 12 => -1, - 'dev' => 0, - 'ino' => 0, - 'mode' => 0040777, - 'nlink' => 0, - 'uid' => vfsStream::getCurrentUser(), - 'gid' => vfsStream::getCurrentGroup(), - 'rdev' => 0, - 'size' => 0, - 'atime' => 100, - 'mtime' => 100, - 'ctime' => 100, - 'blksize' => -1, - 'blocks' => -1 - ), - stat($this->fooURL) - ); - } - - /** - * @test - */ - public function statReturnsFullDataForDirectoriesWithDot() - { - $this->assertEquals(array(0 => 0, - 1 => 0, - 2 => 0040777, - 3 => 0, - 4 => vfsStream::getCurrentUser(), - 5 => vfsStream::getCurrentGroup(), - 6 => 0, - 7 => 0, - 8 => 100, - 9 => 100, - 10 => 100, - 11 => -1, - 12 => -1, - 'dev' => 0, - 'ino' => 0, - 'mode' => 0040777, - 'nlink' => 0, - 'uid' => vfsStream::getCurrentUser(), - 'gid' => vfsStream::getCurrentGroup(), - 'rdev' => 0, - 'size' => 0, - 'atime' => 100, - 'mtime' => 100, - 'ctime' => 100, - 'blksize' => -1, - 'blocks' => -1 - ), - stat($this->fooURL . '/.') - ); - } - - /** - * @test - * @expectedException PHPUnit_Framework_Error - */ - public function openFileWithoutDirectory() - { - vfsStreamWrapper::register(); - $this->assertFalse(file_get_contents(vfsStream::url('file.txt'))); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - * @requires PHP 5.4.0 - */ - public function truncateRemovesSuperflouosContent() - { - if (strstr(PHP_VERSION, 'hiphop') !== false) { - $this->markTestSkipped('Not supported on hhvm'); - } - - $handle = fopen($this->baz1URL, "r+"); - $this->assertTrue(ftruncate($handle, 0)); - $this->assertEquals(0, filesize($this->baz1URL)); - $this->assertEquals('', file_get_contents($this->baz1URL)); - fclose($handle); - } - - /** - * @test - * @group issue_33 - * @since 1.1.0 - * @requires PHP 5.4.0 - */ - public function truncateToGreaterSizeAddsZeroBytes() - { - if (strstr(PHP_VERSION, 'hiphop') !== false) { - $this->markTestSkipped('Not supported on hhvm'); - } - - $handle = fopen($this->baz1URL, "r+"); - $this->assertTrue(ftruncate($handle, 25)); - $this->assertEquals(25, filesize($this->baz1URL)); - $this->assertEquals("baz 1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - file_get_contents($this->baz1URL)); - fclose($handle); - } - - /** - * @test - * @group issue_11 - * @requires PHP 5.4.0 - */ - public function touchCreatesNonExistingFile() - { - $this->assertTrue(touch($this->fooURL . '/new.txt')); - $this->assertTrue($this->foo->hasChild('new.txt')); - } - - /** - * @test - * @group issue_11 - * @requires PHP 5.4.0 - */ - public function touchChangesAccessAndModificationTimeForFile() - { - $this->assertTrue(touch($this->baz1URL, 303, 313)); - $this->assertEquals(303, $this->baz1->filemtime()); - $this->assertEquals(313, $this->baz1->fileatime()); - } - - /** - * @test - * @group issue_11 - * @group issue_80 - * @requires PHP 5.4.0 - */ - public function touchChangesTimesToCurrentTimestampWhenNoTimesGiven() - { - $this->assertTrue(touch($this->baz1URL)); - $this->assertEquals(time(), $this->baz1->filemtime(), '', 1); - $this->assertEquals(time(), $this->baz1->fileatime(), '', 1); - } - - /** - * @test - * @group issue_11 - * @requires PHP 5.4.0 - */ - public function touchWithModifiedTimeChangesAccessAndModifiedTime() - { - $this->assertTrue(touch($this->baz1URL, 303)); - $this->assertEquals(303, $this->baz1->filemtime()); - $this->assertEquals(303, $this->baz1->fileatime()); - } - - /** - * @test - * @group issue_11 - * @requires PHP 5.4.0 - */ - public function touchChangesAccessAndModificationTimeForDirectory() - { - $this->assertTrue(touch($this->fooURL, 303, 313)); - $this->assertEquals(303, $this->foo->filemtime()); - $this->assertEquals(313, $this->foo->fileatime()); - } - - /** - * @test - * @group issue_34 - * @since 1.2.0 - */ - public function pathesAreCorrectlySet() - { - $this->assertEquals(vfsStream::path($this->fooURL), $this->foo->path()); - $this->assertEquals(vfsStream::path($this->barURL), $this->bar->path()); - $this->assertEquals(vfsStream::path($this->baz1URL), $this->baz1->path()); - $this->assertEquals(vfsStream::path($this->baz2URL), $this->baz2->path()); - } - - /** - * @test - * @group issue_34 - * @since 1.2.0 - */ - public function urlsAreCorrectlySet() - { - $this->assertEquals($this->fooURL, $this->foo->url()); - $this->assertEquals($this->barURL, $this->bar->url()); - $this->assertEquals($this->baz1URL, $this->baz1->url()); - $this->assertEquals($this->baz2URL, $this->baz2->url()); - } - - /** - * @test - * @group issue_34 - * @since 1.2.0 - */ - public function pathIsUpdatedAfterMove() - { - // move foo/bar/baz1 to foo/baz3 - $baz3URL = vfsStream::url('foo/baz3'); - $this->assertTrue(rename($this->baz1URL, $baz3URL)); - $this->assertEquals(vfsStream::path($baz3URL), $this->baz1->path()); - } - - /** - * @test - * @group issue_34 - * @since 1.2.0 - */ - public function urlIsUpdatedAfterMove() - { - // move foo/bar/baz1 to foo/baz3 - $baz3URL = vfsStream::url('foo/baz3'); - $this->assertTrue(rename($this->baz1URL, $baz3URL)); - $this->assertEquals($baz3URL, $this->baz1->url()); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperUnregisterTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperUnregisterTestCase.php deleted file mode 100644 index 2457304..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperUnregisterTestCase.php +++ /dev/null @@ -1,75 +0,0 @@ -assertNotContains(vfsStream::SCHEME, stream_get_wrappers()); - } - - /** - * Unregistering a third party wrapper for vfs:// fails. - * - * @test - * @expectedException org\bovigo\vfs\vfsStreamException - * @runInSeparateProcess - */ - public function unregisterThirdPartyVfsScheme() - { - // Unregister possible registered URL wrapper. - vfsStreamWrapper::unregister(); - - $mock = $this->getMock('org\\bovigo\\vfs\\vfsStreamWrapper'); - stream_wrapper_register(vfsStream::SCHEME, get_class($mock)); - - vfsStreamWrapper::unregister(); - } - - /** - * Unregistering when not in registered state will fail. - * - * @test - * @expectedException org\bovigo\vfs\vfsStreamException - * @runInSeparateProcess - */ - public function unregisterWhenNotInRegisteredState() - { - vfsStreamWrapper::register(); - stream_wrapper_unregister(vfsStream::SCHEME); - vfsStreamWrapper::unregister(); - } - - /** - * Unregistering while not registers won't fail. - * - * @test - */ - public function unregisterWhenNotRegistered() - { - // Unregister possible registered URL wrapper. - vfsStreamWrapper::unregister(); - - $this->assertNotContains(vfsStream::SCHEME, stream_get_wrappers()); - vfsStreamWrapper::unregister(); - } -} diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperWithoutRootTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperWithoutRootTestCase.php deleted file mode 100644 index fab0c13..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperWithoutRootTestCase.php +++ /dev/null @@ -1,64 +0,0 @@ - no directory to open - * - * @test - */ - public function canNotOpenDirectory() - { - $this->assertFalse(@dir(vfsStream::url('foo'))); - } - - /** - * can not unlink without root - * - * @test - */ - public function canNotUnlink() - { - $this->assertFalse(@unlink(vfsStream::url('foo'))); - } - - /** - * can not open a file without root - * - * @test - */ - public function canNotOpen() - { - $this->assertFalse(@fopen(vfsStream::url('foo'), 'r')); - } - - /** - * can not rename a file without root - * - * @test - */ - public function canNotRename() - { - $this->assertFalse(@rename(vfsStream::url('foo'), vfsStream::url('bar'))); - } -} -?> diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php deleted file mode 100644 index 6aedcec..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php +++ /dev/null @@ -1,53 +0,0 @@ -markTestSkipped('No ext/zip installed, skipping test.'); - } - - $this->markTestSkipped('Zip extension can not work with vfsStream urls.'); - - vfsStreamWrapper::register(); - vfsStreamWrapper::setRoot(vfsStream::newDirectory('root')); - - } - - /** - * @test - */ - public function createZipArchive() - { - $zip = new ZipArchive(); - $this->assertTrue($zip->open(vfsStream::url('root/test.zip'), ZipArchive::CREATE)); - $this->assertTrue($zip->addFromString("testfile1.txt", "#1 This is a test string added as testfile1.txt.\n")); - $this->assertTrue($zip->addFromString("testfile2.txt", "#2 This is a test string added as testfile2.txt.\n")); - $zip->setArchiveComment('a test'); - var_dump($zip); - $this->assertTrue($zip->close()); - var_dump($zip->getStatusString()); - var_dump($zip->close()); - var_dump($zip->getStatusString()); - var_dump($zip); - var_dump(file_exists(vfsStream::url('root/test.zip'))); - } -} -?> \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitorTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitorTestCase.php deleted file mode 100644 index d7bb49e..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitorTestCase.php +++ /dev/null @@ -1,99 +0,0 @@ -abstractVisitor = $this->getMock('org\\bovigo\\vfs\\visitor\\vfsStreamAbstractVisitor', - array('visitFile', 'visitDirectory') - ); - } - - /** - * @test - * @expectedException \InvalidArgumentException - */ - public function visitThrowsInvalidArgumentExceptionOnUnknownContentType() - { - $mockContent = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockContent->expects($this->any()) - ->method('getType') - ->will($this->returnValue('invalid')); - $this->assertSame($this->abstractVisitor, - $this->abstractVisitor->visit($mockContent) - ); - } - - /** - * @test - */ - public function visitWithFileCallsVisitFile() - { - $file = new vfsStreamFile('foo.txt'); - $this->abstractVisitor->expects($this->once()) - ->method('visitFile') - ->with($this->equalTo($file)); - $this->assertSame($this->abstractVisitor, - $this->abstractVisitor->visit($file) - ); - } - - /** - * tests that a block device eventually calls out to visit file - * - * @test - */ - public function visitWithBlockCallsVisitFile() - { - $block = new vfsStreamBlock('foo'); - $this->abstractVisitor->expects($this->once()) - ->method('visitFile') - ->with($this->equalTo($block)); - $this->assertSame($this->abstractVisitor, - $this->abstractVisitor->visit($block) - ); - } - - /** - * @test - */ - public function visitWithDirectoryCallsVisitDirectory() - { - $dir = new vfsStreamDirectory('bar'); - $this->abstractVisitor->expects($this->once()) - ->method('visitDirectory') - ->with($this->equalTo($dir)); - $this->assertSame($this->abstractVisitor, - $this->abstractVisitor->visit($dir) - ); - } -} -?> diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitorTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitorTestCase.php deleted file mode 100644 index 05a11ac..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitorTestCase.php +++ /dev/null @@ -1,103 +0,0 @@ -at(vfsStream::setup()); - $printVisitor = new vfsStreamPrintVisitor(fopen('vfs://root/foo.txt', 'wb')); - $this->assertSame($printVisitor, - $printVisitor->visitFile(vfsStream::newFile('bar.txt')) - ); - $this->assertEquals("- bar.txt\n", $output->getContent()); - } - - /** - * @test - */ - public function visitFileWritesBlockDeviceToStream() - { - $output = vfsStream::newFile('foo.txt') - ->at(vfsStream::setup()); - $printVisitor = new vfsStreamPrintVisitor(fopen('vfs://root/foo.txt', 'wb')); - $this->assertSame($printVisitor, - $printVisitor->visitBlockDevice(vfsStream::newBlock('bar')) - ); - $this->assertEquals("- [bar]\n", $output->getContent()); - } - - /** - * @test - */ - public function visitDirectoryWritesDirectoryNameToStream() - { - $output = vfsStream::newFile('foo.txt') - ->at(vfsStream::setup()); - $printVisitor = new vfsStreamPrintVisitor(fopen('vfs://root/foo.txt', 'wb')); - $this->assertSame($printVisitor, - $printVisitor->visitDirectory(vfsStream::newDirectory('baz')) - ); - $this->assertEquals("- baz\n", $output->getContent()); - } - - /** - * @test - */ - public function visitRecursiveDirectoryStructure() - { - $root = vfsStream::setup('root', - null, - array('test' => array('foo' => array('test.txt' => 'hello'), - 'baz.txt' => 'world' - ), - 'foo.txt' => '' - ) - ); - $printVisitor = new vfsStreamPrintVisitor(fopen('vfs://root/foo.txt', 'wb')); - $this->assertSame($printVisitor, - $printVisitor->visitDirectory($root) - ); - $this->assertEquals("- root\n - test\n - foo\n - test.txt\n - baz.txt\n - foo.txt\n", file_get_contents('vfs://root/foo.txt')); - } -} -?> diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitorTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitorTestCase.php deleted file mode 100644 index ad93a2c..0000000 --- a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitorTestCase.php +++ /dev/null @@ -1,86 +0,0 @@ -assertEquals(array('foo.txt' => 'test'), - $structureVisitor->visitFile(vfsStream::newFile('foo.txt') - ->withContent('test') - ) - ->getStructure() - ); - } - - /** - * @test - */ - public function visitFileCreatesStructureForBlock() - { - $structureVisitor = new vfsStreamStructureVisitor(); - $this->assertEquals(array('[foo]' => 'test'), - $structureVisitor->visitBlockDevice(vfsStream::newBlock('foo') - ->withContent('test') - ) - ->getStructure() - ); - } - - /** - * @test - */ - public function visitDirectoryCreatesStructureForDirectory() - { - $structureVisitor = new vfsStreamStructureVisitor(); - $this->assertEquals(array('baz' => array()), - $structureVisitor->visitDirectory(vfsStream::newDirectory('baz')) - ->getStructure() - ); - } - - /** - * @test - */ - public function visitRecursiveDirectoryStructure() - { - $root = vfsStream::setup('root', - null, - array('test' => array('foo' => array('test.txt' => 'hello'), - 'baz.txt' => 'world' - ), - 'foo.txt' => '' - ) - ); - $structureVisitor = new vfsStreamStructureVisitor(); - $this->assertEquals(array('root' => array('test' => array('foo' => array('test.txt' => 'hello'), - 'baz.txt' => 'world' - ), - 'foo.txt' => '' - ), - ), - $structureVisitor->visitDirectory($root) - ->getStructure() - ); - } -} -?> diff --git a/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/aFile.txt b/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/aFile.txt deleted file mode 100644 index 1910281..0000000 --- a/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/aFile.txt +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/subfolder1/file1.txt b/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/subfolder1/file1.txt deleted file mode 100644 index f6ea049..0000000 --- a/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/subfolder1/file1.txt +++ /dev/null @@ -1 +0,0 @@ -foobar \ No newline at end of file diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php deleted file mode 100644 index a6ca7b3..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php +++ /dev/null @@ -1,245 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Description - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DescriptionTest extends \PHPUnit_Framework_TestCase -{ - public function testConstruct() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame($fixture, $parsedContents[0]); - } - - public function testInlineTagParsing() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame('This is text for a ', $parsedContents[0]); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag\LinkTag', - $parsedContents[1] - ); - $this->assertSame( - ' that uses inline -tags.', - $parsedContents[2] - ); - } - - public function testInlineTagAtStartParsing() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - - $this->assertSame('', $parsedContents[0]); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag\LinkTag', - $parsedContents[1] - ); - $this->assertSame( - ' is text for a description that uses inline -tags.', - $parsedContents[2] - ); - } - - public function testNestedInlineTagParsing() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - - $this->assertSame( - 'This is text for a description with ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $parsedDescription = $parsedContents[1]->getParsedDescription(); - $this->assertCount(3, $parsedDescription); - $this->assertSame("inline tag with\n", $parsedDescription[0]); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag\LinkTag', - $parsedDescription[1] - ); - $this->assertSame(' in it', $parsedDescription[2]); - } - - public function testLiteralOpeningDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame($fixture, $parsedContents[0]); - } - - public function testNestedLiteralOpeningDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame( - 'This is text for a description containing ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $this->assertSame( - array('inline tag that has { that -is literal'), - $parsedContents[1]->getParsedDescription() - ); - } - - public function testLiteralClosingDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame( - 'This is text for a description with } that is not a tag.', - $parsedContents[0] - ); - } - - public function testNestedLiteralClosingDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame( - 'This is text for a description with ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $this->assertSame( - array('inline tag with } that is not an -inline tag'), - $parsedContents[1]->getParsedDescription() - ); - } - - public function testInlineTagEscapingSequence() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame( - 'This is text for a description with literal {@link}.', - $parsedContents[0] - ); - } - - public function testNestedInlineTagEscapingSequence() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame( - 'This is text for a description with an ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $this->assertSame( - array('inline tag with literal -{@link} in it'), - $parsedContents[1]->getParsedDescription() - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php deleted file mode 100644 index ff257aa..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\CoversTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class CoversTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\CoversTag can create - * a link for the covers doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exReference - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\CoversTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exReference - ) { - $tag = new CoversTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exReference, $tag->getReference()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exReference - return array( - array( - 'covers', - 'Foo::bar()', - 'Foo::bar()', - '', - 'Foo::bar()' - ), - array( - 'covers', - 'Foo::bar() Testing', - 'Foo::bar() Testing', - 'Testing', - 'Foo::bar()', - ), - array( - 'covers', - 'Foo::bar() Testing comments', - 'Foo::bar() Testing comments', - 'Testing comments', - 'Foo::bar()', - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php deleted file mode 100644 index 7a75e79..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DeprecatedTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @deprecated doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exVersion - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exVersion - ) { - $tag = new DeprecatedTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exVersion, $tag->getVersion()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exVersion - return array( - array( - 'deprecated', - '1.0 First release.', - '1.0 First release.', - 'First release.', - '1.0' - ), - array( - 'deprecated', - "1.0\nFirst release.", - "1.0\nFirst release.", - 'First release.', - '1.0' - ), - array( - 'deprecated', - "1.0\nFirst\nrelease.", - "1.0\nFirst\nrelease.", - "First\nrelease.", - '1.0' - ), - array( - 'deprecated', - 'Unfinished release', - 'Unfinished release', - 'Unfinished release', - '' - ), - array( - 'deprecated', - '1.0', - '1.0', - '', - '1.0' - ), - array( - 'deprecated', - 'GIT: $Id$', - 'GIT: $Id$', - '', - 'GIT: $Id$' - ), - array( - 'deprecated', - 'GIT: $Id$ Dev build', - 'GIT: $Id$ Dev build', - 'Dev build', - 'GIT: $Id$' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php deleted file mode 100644 index 519a61b..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php +++ /dev/null @@ -1,203 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ExampleTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can - * understand the @source DocBlock. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exStartingLine - * @param string $exLineCount - * @param string $exFilepath - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exStartingLine, - $exLineCount, - $exFilePath - ) { - $tag = new ExampleTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exStartingLine, $tag->getStartingLine()); - $this->assertEquals($exLineCount, $tag->getLineCount()); - $this->assertEquals($exFilePath, $tag->getFilePath()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, - // $content, - // $exContent, - // $exDescription, - // $exStartingLine, - // $exLineCount, - // $exFilePath - return array( - array( - 'example', - 'file.php', - 'file.php', - '', - 1, - null, - 'file.php' - ), - array( - 'example', - 'Testing comments', - 'Testing comments', - 'comments', - 1, - null, - 'Testing' - ), - array( - 'example', - 'file.php 2 Testing', - 'file.php 2 Testing', - 'Testing', - 2, - null, - 'file.php' - ), - array( - 'example', - 'file.php 2 3 Testing comments', - 'file.php 2 3 Testing comments', - 'Testing comments', - 2, - 3, - 'file.php' - ), - array( - 'example', - 'file.php 2 -1 Testing comments', - 'file.php 2 -1 Testing comments', - '-1 Testing comments', - 2, - null, - 'file.php' - ), - array( - 'example', - 'file.php -1 1 Testing comments', - 'file.php -1 1 Testing comments', - '-1 1 Testing comments', - 1, - null, - 'file.php' - ), - array( - 'example', - '"file with spaces.php" Testing comments', - '"file with spaces.php" Testing comments', - 'Testing comments', - 1, - null, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" 2 Testing comments', - '"file with spaces.php" 2 Testing comments', - 'Testing comments', - 2, - null, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" 2 3 Testing comments', - '"file with spaces.php" 2 3 Testing comments', - 'Testing comments', - 2, - 3, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" 2 -3 Testing comments', - '"file with spaces.php" 2 -3 Testing comments', - '-3 Testing comments', - 2, - null, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" -2 3 Testing comments', - '"file with spaces.php" -2 3 Testing comments', - '-2 3 Testing comments', - 1, - null, - 'file with spaces.php' - ), - array( - 'example', - 'file%20with%20spaces.php Testing comments', - 'file%20with%20spaces.php Testing comments', - 'Testing comments', - 1, - null, - 'file with spaces.php' - ), - array( - 'example', - 'folder/file%20with%20spaces.php Testing comments', - 'folder/file%20with%20spaces.php Testing comments', - 'Testing comments', - 1, - null, - 'folder/file with spaces.php' - ), - array( - 'example', - 'http://example.com/file%20with%20spaces.php Testing comments', - 'http://example.com/file%20with%20spaces.php Testing comments', - 'Testing comments', - 1, - null, - 'http://example.com/file%20with%20spaces.php' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php deleted file mode 100644 index 0c64ed0..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\LinkTag - * - * @author Ben Selby - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class LinkTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @link doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exLink - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exLink - ) { - $tag = new LinkTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exLink, $tag->getLink()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exLink - return array( - array( - 'link', - 'http://www.phpdoc.org/', - 'http://www.phpdoc.org/', - 'http://www.phpdoc.org/', - 'http://www.phpdoc.org/' - ), - array( - 'link', - 'http://www.phpdoc.org/ Testing', - 'http://www.phpdoc.org/ Testing', - 'Testing', - 'http://www.phpdoc.org/' - ), - array( - 'link', - 'http://www.phpdoc.org/ Testing comments', - 'http://www.phpdoc.org/ Testing comments', - 'Testing comments', - 'http://www.phpdoc.org/' - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php deleted file mode 100644 index efc3a15..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class MethodTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * @param string $signature The signature to test. - * @param bool $valid Whether the given signature is expected to - * be valid. - * @param string $expected_name The method name that is expected from this - * signature. - * @param string $expected_return The return type that is expected from this - * signature. - * @param bool $paramCount Number of parameters in the signature. - * @param string $description The short description mentioned in the - * signature. - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag - * @dataProvider getTestSignatures - * - * @return void - */ - public function testConstruct( - $signature, - $valid, - $expected_name, - $expected_return, - $expected_isStatic, - $paramCount, - $description - ) { - ob_start(); - $tag = new MethodTag('method', $signature); - $stdout = ob_get_clean(); - - $this->assertSame( - $valid, - empty($stdout), - 'No error should have been output if the signature is valid' - ); - - if (!$valid) { - return; - } - - $this->assertEquals($expected_name, $tag->getMethodName()); - $this->assertEquals($expected_return, $tag->getType()); - $this->assertEquals($description, $tag->getDescription()); - $this->assertEquals($expected_isStatic, $tag->isStatic()); - $this->assertCount($paramCount, $tag->getArguments()); - } - - public function getTestSignatures() - { - return array( - // TODO: Verify this case -// array( -// 'foo', -// false, 'foo', '', false, 0, '' -// ), - array( - 'foo()', - true, 'foo', 'void', false, 0, '' - ), - array( - 'foo() description', - true, 'foo', 'void', false, 0, 'description' - ), - array( - 'int foo()', - true, 'foo', 'int', false, 0, '' - ), - array( - 'int foo() description', - true, 'foo', 'int', false, 0, 'description' - ), - array( - 'int foo($a, $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - 'int foo() foo(int $a, int $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - 'int foo(int $a, int $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - 'null|int foo(int $a, int $b)', - true, 'foo', 'null|int', false, 2, '' - ), - array( - 'int foo(null|int $a, int $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - '\Exception foo() foo(Exception $a, Exception $b)', - true, 'foo', '\Exception', false, 2, '' - ), - array( - 'int foo() foo(Exception $a, Exception $b) description', - true, 'foo', 'int', false, 2, 'description' - ), - array( - 'int foo() foo(\Exception $a, \Exception $b) description', - true, 'foo', 'int', false, 2, 'description' - ), - array( - 'void()', - true, 'void', 'void', false, 0, '' - ), - array( - 'static foo()', - true, 'foo', 'static', false, 0, '' - ), - array( - 'static void foo()', - true, 'foo', 'void', true, 0, '' - ), - array( - 'static static foo()', - true, 'foo', 'static', true, 0, '' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php deleted file mode 100644 index 0e05382..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\ParamTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ParamTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ParamTag can - * understand the @param DocBlock. - * - * @param string $type - * @param string $content - * @param string $extractedType - * @param string $extractedTypes - * @param string $extractedVarName - * @param string $extractedDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag - * @dataProvider provideDataForConstructor - * - * @return void - */ - public function testConstructorParsesInputsIntoCorrectFields( - $type, - $content, - $extractedType, - $extractedTypes, - $extractedVarName, - $extractedDescription - ) { - $tag = new ParamTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($extractedType, $tag->getType()); - $this->assertEquals($extractedTypes, $tag->getTypes()); - $this->assertEquals($extractedVarName, $tag->getVariableName()); - $this->assertEquals($extractedDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParsesInputsIntoCorrectFields() - * - * @return array - */ - public function provideDataForConstructor() - { - return array( - array('param', 'int', 'int', array('int'), '', ''), - array('param', '$bob', '', array(), '$bob', ''), - array( - 'param', - 'int Number of bobs', - 'int', - array('int'), - '', - 'Number of bobs' - ), - array( - 'param', - 'int $bob', - 'int', - array('int'), - '$bob', - '' - ), - array( - 'param', - 'int $bob Number of bobs', - 'int', - array('int'), - '$bob', - 'Number of bobs' - ), - array( - 'param', - "int Description \n on multiple lines", - 'int', - array('int'), - '', - "Description \n on multiple lines" - ), - array( - 'param', - "int \n\$bob Variable name on a new line", - 'int', - array('int'), - '$bob', - "Variable name on a new line" - ), - array( - 'param', - "\nint \$bob Type on a new line", - 'int', - array('int'), - '$bob', - "Type on a new line" - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php deleted file mode 100644 index 9e2aec0..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\ReturnTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ReturnTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag can - * understand the @return DocBlock. - * - * @param string $type - * @param string $content - * @param string $extractedType - * @param string $extractedTypes - * @param string $extractedDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag - * @dataProvider provideDataForConstructor - * - * @return void - */ - public function testConstructorParsesInputsIntoCorrectFields( - $type, - $content, - $extractedType, - $extractedTypes, - $extractedDescription - ) { - $tag = new ReturnTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($extractedType, $tag->getType()); - $this->assertEquals($extractedTypes, $tag->getTypes()); - $this->assertEquals($extractedDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParsesInputsIntoCorrectFields() - * - * @return array - */ - public function provideDataForConstructor() - { - return array( - array('return', '', '', array(), ''), - array('return', 'int', 'int', array('int'), ''), - array( - 'return', - 'int Number of Bobs', - 'int', - array('int'), - 'Number of Bobs' - ), - array( - 'return', - 'int|double Number of Bobs', - 'int|double', - array('int', 'double'), - 'Number of Bobs' - ), - array( - 'return', - "int Number of \n Bobs", - 'int', - array('int'), - "Number of \n Bobs" - ), - array( - 'return', - " int Number of Bobs", - 'int', - array('int'), - "Number of Bobs" - ), - array( - 'return', - "int\nNumber of Bobs", - 'int', - array('int'), - "Number of Bobs" - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php deleted file mode 100644 index 6829b04..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SeeTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SeeTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link - * for the @see doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exReference - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\SeeTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exReference - ) { - $tag = new SeeTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exReference, $tag->getReference()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exReference - return array( - array( - 'see', - 'Foo::bar()', - 'Foo::bar()', - '', - 'Foo::bar()' - ), - array( - 'see', - 'Foo::bar() Testing', - 'Foo::bar() Testing', - 'Testing', - 'Foo::bar()', - ), - array( - 'see', - 'Foo::bar() Testing comments', - 'Foo::bar() Testing comments', - 'Testing comments', - 'Foo::bar()', - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php deleted file mode 100644 index 8caf25d..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SinceTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SinceTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @since doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exVersion - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\SinceTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exVersion - ) { - $tag = new SinceTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exVersion, $tag->getVersion()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exVersion - return array( - array( - 'since', - '1.0 First release.', - '1.0 First release.', - 'First release.', - '1.0' - ), - array( - 'since', - "1.0\nFirst release.", - "1.0\nFirst release.", - 'First release.', - '1.0' - ), - array( - 'since', - "1.0\nFirst\nrelease.", - "1.0\nFirst\nrelease.", - "First\nrelease.", - '1.0' - ), - array( - 'since', - 'Unfinished release', - 'Unfinished release', - 'Unfinished release', - '' - ), - array( - 'since', - '1.0', - '1.0', - '', - '1.0' - ), - array( - 'since', - 'GIT: $Id$', - 'GIT: $Id$', - '', - 'GIT: $Id$' - ), - array( - 'since', - 'GIT: $Id$ Dev build', - 'GIT: $Id$ Dev build', - 'Dev build', - 'GIT: $Id$' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php deleted file mode 100644 index 2a40e0a..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SourceTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SourceTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can - * understand the @source DocBlock. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exStartingLine - * @param string $exLineCount - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exStartingLine, - $exLineCount - ) { - $tag = new SourceTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exStartingLine, $tag->getStartingLine()); - $this->assertEquals($exLineCount, $tag->getLineCount()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exStartingLine, $exLineCount - return array( - array( - 'source', - '2', - '2', - '', - 2, - null - ), - array( - 'source', - 'Testing', - 'Testing', - 'Testing', - 1, - null - ), - array( - 'source', - '2 Testing', - '2 Testing', - 'Testing', - 2, - null - ), - array( - 'source', - '2 3 Testing comments', - '2 3 Testing comments', - 'Testing comments', - 2, - 3 - ), - array( - 'source', - '2 -1 Testing comments', - '2 -1 Testing comments', - '-1 Testing comments', - 2, - null - ), - array( - 'source', - '-1 1 Testing comments', - '-1 1 Testing comments', - '-1 1 Testing comments', - 1, - null - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php deleted file mode 100644 index 3c669d5..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\ThrowsTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ThrowsTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag can - * understand the @throws DocBlock. - * - * @param string $type - * @param string $content - * @param string $extractedType - * @param string $extractedTypes - * @param string $extractedDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag - * @dataProvider provideDataForConstructor - * - * @return void - */ - public function testConstructorParsesInputsIntoCorrectFields( - $type, - $content, - $extractedType, - $extractedTypes, - $extractedDescription - ) { - $tag = new ThrowsTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($extractedType, $tag->getType()); - $this->assertEquals($extractedTypes, $tag->getTypes()); - $this->assertEquals($extractedDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParsesInputsIntoCorrectFields() - * - * @return array - */ - public function provideDataForConstructor() - { - return array( - array('throws', '', '', array(), ''), - array('throws', 'int', 'int', array('int'), ''), - array( - 'throws', - 'int Number of Bobs', - 'int', - array('int'), - 'Number of Bobs' - ), - array( - 'throws', - 'int|double Number of Bobs', - 'int|double', - array('int', 'double'), - 'Number of Bobs' - ), - array( - 'throws', - "int Number of \n Bobs", - 'int', - array('int'), - "Number of \n Bobs" - ), - array( - 'throws', - " int Number of Bobs", - 'int', - array('int'), - "Number of Bobs" - ), - array( - 'throws', - "int\nNumber of Bobs", - 'int', - array('int'), - "Number of Bobs" - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php deleted file mode 100644 index 45868d7..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\UsesTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class UsesTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\UsesTag can create - * a link for the @uses doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exReference - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\UsesTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exReference - ) { - $tag = new UsesTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exReference, $tag->getReference()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exReference - return array( - array( - 'uses', - 'Foo::bar()', - 'Foo::bar()', - '', - 'Foo::bar()' - ), - array( - 'uses', - 'Foo::bar() Testing', - 'Foo::bar() Testing', - 'Testing', - 'Foo::bar()', - ), - array( - 'uses', - 'Foo::bar() Testing comments', - 'Foo::bar() Testing comments', - 'Testing comments', - 'Foo::bar()', - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php deleted file mode 100644 index 9ae2aa5..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VarTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can - * understand the @var doc block. - * - * @param string $type - * @param string $content - * @param string $exType - * @param string $exVariable - * @param string $exDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exType, - $exVariable, - $exDescription - ) { - $tag = new VarTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exType, $tag->getType()); - $this->assertEquals($exVariable, $tag->getVariableName()); - $this->assertEquals($exDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exType, $exVariable, $exDescription - return array( - array( - 'var', - 'int', - 'int', - '', - '' - ), - array( - 'var', - 'int $bob', - 'int', - '$bob', - '' - ), - array( - 'var', - 'int $bob Number of bobs', - 'int', - '$bob', - 'Number of bobs' - ), - array( - 'var', - '', - '', - '', - '' - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php deleted file mode 100644 index e145386..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VersionTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VersionTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @version doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exVersion - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\VersionTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exVersion - ) { - $tag = new VersionTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exVersion, $tag->getVersion()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exVersion - return array( - array( - 'version', - '1.0 First release.', - '1.0 First release.', - 'First release.', - '1.0' - ), - array( - 'version', - "1.0\nFirst release.", - "1.0\nFirst release.", - 'First release.', - '1.0' - ), - array( - 'version', - "1.0\nFirst\nrelease.", - "1.0\nFirst\nrelease.", - "First\nrelease.", - '1.0' - ), - array( - 'version', - 'Unfinished release', - 'Unfinished release', - 'Unfinished release', - '' - ), - array( - 'version', - '1.0', - '1.0', - '', - '1.0' - ), - array( - 'version', - 'GIT: $Id$', - 'GIT: $Id$', - '', - 'GIT: $Id$' - ), - array( - 'version', - 'GIT: $Id$ Dev build', - 'GIT: $Id$ Dev build', - 'Dev build', - 'GIT: $Id$' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php deleted file mode 100644 index 9e873ec..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php +++ /dev/null @@ -1,313 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; -use phpDocumentor\Reflection\DocBlock\Context; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class TagTest extends \PHPUnit_Framework_TestCase -{ - - /** - * @expectedException \InvalidArgumentException - * - * @return void - */ - public function testInvalidTagLine() - { - Tag::createInstance('Invalid tag line'); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testTagHandlerUnregistration() - { - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreUnreg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreUnreg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreUnreg - ); - - Tag::registerTagHandler('var', null); - - $tagPostUnreg = Tag::createInstance('@var mixed'); - $this->assertNotInstanceOf( - $currentHandler, - $tagPostUnreg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostUnreg - ); - - Tag::registerTagHandler('var', $currentHandler); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testTagHandlerCorrectRegistration() - { - if (0 == ini_get('allow_url_include')) { - $this->markTestSkipped('"data" URIs for includes are required.'); - } - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - - include 'data:text/plain;base64,'. base64_encode( -<<assertTrue(Tag::registerTagHandler('var', '\MyTagHandler')); - - $tagPostReg = Tag::createInstance('@var mixed'); - $this->assertNotInstanceOf( - $currentHandler, - $tagPostReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - $this->assertInstanceOf( - '\MyTagHandler', - $tagPostReg - ); - - $this->assertTrue(Tag::registerTagHandler('var', $currentHandler)); - } - - /** - * @depends testTagHandlerCorrectRegistration - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance - * - * @return void - */ - public function testNamespacedTagHandlerCorrectRegistration() - { - $tagPreReg = Tag::createInstance('@T something'); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - $this->assertNotInstanceOf( - '\MyTagHandler', - $tagPreReg - ); - - $this->assertTrue( - Tag::registerTagHandler('\MyNamespace\MyTag', '\MyTagHandler') - ); - - $tagPostReg = Tag::createInstance( - '@T something', - new DocBlock( - '', - new Context('', array('T' => '\MyNamespace\MyTag')) - ) - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - $this->assertInstanceOf( - '\MyTagHandler', - $tagPostReg - ); - - $this->assertTrue( - Tag::registerTagHandler('\MyNamespace\MyTag', null) - ); - } - - /** - * @depends testTagHandlerCorrectRegistration - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance - * - * @return void - */ - public function testNamespacedTagHandlerIncorrectRegistration() - { - $tagPreReg = Tag::createInstance('@T something'); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - $this->assertNotInstanceOf( - '\MyTagHandler', - $tagPreReg - ); - - $this->assertFalse( - Tag::registerTagHandler('MyNamespace\MyTag', '\MyTagHandler') - ); - - $tagPostReg = Tag::createInstance( - '@T something', - new DocBlock( - '', - new Context('', array('T' => '\MyNamespace\MyTag')) - ) - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - $this->assertNotInstanceOf( - '\MyTagHandler', - $tagPostReg - ); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testNonExistentTagHandlerRegistration() - { - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - - $this->assertFalse(Tag::registerTagHandler('var', 'Non existent')); - - $tagPostReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPostReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testIncompatibleTagHandlerRegistration() - { - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - - $this->assertFalse( - Tag::registerTagHandler('var', __NAMESPACE__ . '\TagTest') - ); - - $tagPostReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPostReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - } - - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can - * understand the @var doc block. - * - * @param string $type - * @param string $content - * @param string $exDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exDescription - ) { - $tag = new Tag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($content, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exDescription - return array( - array( - 'unknown', - 'some content', - 'some content', - ), - array( - 'unknown', - '', - '', - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php deleted file mode 100644 index 78c7306..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php +++ /dev/null @@ -1,195 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Type; - -use phpDocumentor\Reflection\DocBlock\Context; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Type\Collection - * - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class CollectionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getContext - * - * @return void - */ - public function testConstruct() - { - $collection = new Collection(); - $this->assertCount(0, $collection); - $this->assertEquals('', $collection->getContext()->getNamespace()); - $this->assertCount(0, $collection->getContext()->getNamespaceAliases()); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * - * @return void - */ - public function testConstructWithTypes() - { - $collection = new Collection(array('integer', 'string')); - $this->assertCount(2, $collection); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * - * @return void - */ - public function testConstructWithNamespace() - { - $collection = new Collection(array(), new Context('\My\Space')); - $this->assertEquals('My\Space', $collection->getContext()->getNamespace()); - - $collection = new Collection(array(), new Context('My\Space')); - $this->assertEquals('My\Space', $collection->getContext()->getNamespace()); - - $collection = new Collection(array(), null); - $this->assertEquals('', $collection->getContext()->getNamespace()); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * - * @return void - */ - public function testConstructWithNamespaceAliases() - { - $fixture = array('a' => 'b'); - $collection = new Collection(array(), new Context(null, $fixture)); - $this->assertEquals( - array('a' => '\b'), - $collection->getContext()->getNamespaceAliases() - ); - } - - /** - * @param string $fixture - * @param array $expected - * - * @dataProvider provideTypesToExpand - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add - * - * @return void - */ - public function testAdd($fixture, $expected) - { - $collection = new Collection( - array(), - new Context('\My\Space', array('Alias' => '\My\Space\Aliasing')) - ); - $collection->add($fixture); - - $this->assertSame($expected, $collection->getArrayCopy()); - } - - /** - * @param string $fixture - * @param array $expected - * - * @dataProvider provideTypesToExpandWithoutNamespace - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add - * - * @return void - */ - public function testAddWithoutNamespace($fixture, $expected) - { - $collection = new Collection( - array(), - new Context(null, array('Alias' => '\My\Space\Aliasing')) - ); - $collection->add($fixture); - - $this->assertSame($expected, $collection->getArrayCopy()); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add - * @expectedException InvalidArgumentException - * - * @return void - */ - public function testAddWithInvalidArgument() - { - $collection = new Collection(); - $collection->add(array()); - } - - /** - * Returns the types and their expected values to test the retrieval of - * types. - * - * @param string $method Name of the method consuming this data provider. - * @param string $namespace Name of the namespace to user as basis. - * - * @return string[] - */ - public function provideTypesToExpand($method, $namespace = '\My\Space\\') - { - return array( - array('', array()), - array(' ', array()), - array('int', array('int')), - array('int ', array('int')), - array('string', array('string')), - array('DocBlock', array($namespace.'DocBlock')), - array('DocBlock[]', array($namespace.'DocBlock[]')), - array(' DocBlock ', array($namespace.'DocBlock')), - array('\My\Space\DocBlock', array('\My\Space\DocBlock')), - array('Alias\DocBlock', array('\My\Space\Aliasing\DocBlock')), - array( - 'DocBlock|Tag', - array($namespace .'DocBlock', $namespace .'Tag') - ), - array( - 'DocBlock|null', - array($namespace.'DocBlock', 'null') - ), - array( - '\My\Space\DocBlock|Tag', - array('\My\Space\DocBlock', $namespace.'Tag') - ), - array( - 'DocBlock[]|null', - array($namespace.'DocBlock[]', 'null') - ), - array( - 'DocBlock[]|int[]', - array($namespace.'DocBlock[]', 'int[]') - ), - ); - } - - /** - * Returns the types and their expected values to test the retrieval of - * types when no namespace is available. - * - * @param string $method Name of the method consuming this data provider. - * - * @return string[] - */ - public function provideTypesToExpandWithoutNamespace($method) - { - return $this->provideTypesToExpand($method, '\\'); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php deleted file mode 100644 index 30eedfc..0000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php +++ /dev/null @@ -1,337 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection; - -use phpDocumentor\Reflection\DocBlock\Context; -use phpDocumentor\Reflection\DocBlock\Location; -use phpDocumentor\Reflection\DocBlock\Tag\ReturnTag; - -/** - * Test class for phpDocumentor\Reflection\DocBlock - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DocBlockTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers \phpDocumentor\Reflection\DocBlock - * - * @return void - */ - public function testConstruct() - { - $fixture = << '\phpDocumentor')), - new Location(2) - ); - $this->assertEquals( - 'This is a short description', - $object->getShortDescription() - ); - $this->assertEquals( - 'This is a long description', - $object->getLongDescription()->getContents() - ); - $this->assertCount(2, $object->getTags()); - $this->assertTrue($object->hasTag('see')); - $this->assertTrue($object->hasTag('return')); - $this->assertFalse($object->hasTag('category')); - - $this->assertSame('MyNamespace', $object->getContext()->getNamespace()); - $this->assertSame( - array('PHPDoc' => '\phpDocumentor'), - $object->getContext()->getNamespaceAliases() - ); - $this->assertSame(2, $object->getLocation()->getLineNumber()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::splitDocBlock - * - * @return void - */ - public function testConstructWithTagsOnly() - { - $fixture = <<assertEquals('', $object->getShortDescription()); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(2, $object->getTags()); - $this->assertTrue($object->hasTag('see')); - $this->assertTrue($object->hasTag('return')); - $this->assertFalse($object->hasTag('category')); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::isTemplateStart - */ - public function testIfStartOfTemplateIsDiscovered() - { - $fixture = <<assertEquals('', $object->getShortDescription()); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(2, $object->getTags()); - $this->assertTrue($object->hasTag('see')); - $this->assertTrue($object->hasTag('return')); - $this->assertFalse($object->hasTag('category')); - $this->assertTrue($object->isTemplateStart()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::isTemplateEnd - */ - public function testIfEndOfTemplateIsDiscovered() - { - $fixture = <<assertEquals('', $object->getShortDescription()); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertTrue($object->isTemplateEnd()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::cleanInput - * - * @return void - */ - public function testConstructOneLiner() - { - $fixture = '/** Short description and nothing more. */'; - $object = new DocBlock($fixture); - $this->assertEquals( - 'Short description and nothing more.', - $object->getShortDescription() - ); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(0, $object->getTags()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::__construct - * - * @return void - */ - public function testConstructFromReflector() - { - $object = new DocBlock(new \ReflectionClass($this)); - $this->assertEquals( - 'Test class for phpDocumentor\Reflection\DocBlock', - $object->getShortDescription() - ); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(4, $object->getTags()); - $this->assertTrue($object->hasTag('author')); - $this->assertTrue($object->hasTag('copyright')); - $this->assertTrue($object->hasTag('license')); - $this->assertTrue($object->hasTag('link')); - $this->assertFalse($object->hasTag('category')); - } - - /** - * @expectedException \InvalidArgumentException - * - * @return void - */ - public function testExceptionOnInvalidObject() - { - new DocBlock($this); - } - - public function testDotSeperation() - { - $fixture = <<assertEquals( - 'This is a short description.', - $object->getShortDescription() - ); - $this->assertEquals( - "This is a long description.\nThis is a continuation of the long " - ."description.", - $object->getLongDescription()->getContents() - ); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::parseTags - * @expectedException \LogicException - * - * @return void - */ - public function testInvalidTagBlock() - { - if (0 == ini_get('allow_url_include')) { - $this->markTestSkipped('"data" URIs for includes are required.'); - } - - include 'data:text/plain;base64,'. base64_encode( - <<assertEquals( - 'This is a short description.', - $object->getShortDescription() - ); - $this->assertEquals( - 'This is a long description.', - $object->getLongDescription()->getContents() - ); - $tags = $object->getTags(); - $this->assertCount(2, $tags); - $this->assertTrue($object->hasTag('method')); - $this->assertTrue($object->hasTag('Method')); - $this->assertInstanceOf( - __NAMESPACE__ . '\DocBlock\Tag\MethodTag', - $tags[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\DocBlock\Tag', - $tags[1] - ); - $this->assertNotInstanceOf( - __NAMESPACE__ . '\DocBlock\Tag\MethodTag', - $tags[1] - ); - } - - /** - * @depends testConstructFromReflector - * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName - * - * @return void - */ - public function testGetTagsByNameZeroAndOneMatch() - { - $object = new DocBlock(new \ReflectionClass($this)); - $this->assertEmpty($object->getTagsByName('category')); - $this->assertCount(1, $object->getTagsByName('author')); - } - - /** - * @depends testConstructWithTagsOnly - * @covers \phpDocumentor\Reflection\DocBlock::parseTags - * - * @return void - */ - public function testParseMultilineTag() - { - $fixture = <<assertCount(1, $object->getTags()); - } - - /** - * @depends testConstructWithTagsOnly - * @covers \phpDocumentor\Reflection\DocBlock::parseTags - * - * @return void - */ - public function testParseMultilineTagWithLineBreaks() - { - $fixture = <<assertCount(1, $tags = $object->getTags()); - /** @var ReturnTag $tag */ - $tag = reset($tags); - $this->assertEquals("Content on\n multiple lines.\n\n One more, after the break.", $tag->getDescription()); - } - - /** - * @depends testConstructWithTagsOnly - * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName - * - * @return void - */ - public function testGetTagsByNameMultipleMatch() - { - $fixture = <<assertEmpty($object->getTagsByName('category')); - $this->assertCount(1, $object->getTagsByName('return')); - $this->assertCount(2, $object->getTagsByName('param')); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/FilterTest.php b/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/FilterTest.php deleted file mode 100644 index 66f8bb4..0000000 --- a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/FilterTest.php +++ /dev/null @@ -1,281 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -/** - * Tests for the PHP_CodeCoverage_Filter class. - * - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverage_FilterTest extends PHPUnit_Framework_TestCase -{ - protected $filter; - protected $files; - - protected function setUp() - { - $this->filter = unserialize('O:23:"PHP_CodeCoverage_Filter":0:{}'); - - $this->files = array( - TEST_FILES_PATH . 'BankAccount.php', - TEST_FILES_PATH . 'BankAccountTest.php', - TEST_FILES_PATH . 'CoverageClassExtendedTest.php', - TEST_FILES_PATH . 'CoverageClassTest.php', - TEST_FILES_PATH . 'CoverageFunctionParenthesesTest.php', - TEST_FILES_PATH . 'CoverageFunctionParenthesesWhitespaceTest.php', - TEST_FILES_PATH . 'CoverageFunctionTest.php', - TEST_FILES_PATH . 'CoverageMethodOneLineAnnotationTest.php', - TEST_FILES_PATH . 'CoverageMethodParenthesesTest.php', - TEST_FILES_PATH . 'CoverageMethodParenthesesWhitespaceTest.php', - TEST_FILES_PATH . 'CoverageMethodTest.php', - TEST_FILES_PATH . 'CoverageNoneTest.php', - TEST_FILES_PATH . 'CoverageNotPrivateTest.php', - TEST_FILES_PATH . 'CoverageNotProtectedTest.php', - TEST_FILES_PATH . 'CoverageNotPublicTest.php', - TEST_FILES_PATH . 'CoverageNothingTest.php', - TEST_FILES_PATH . 'CoveragePrivateTest.php', - TEST_FILES_PATH . 'CoverageProtectedTest.php', - TEST_FILES_PATH . 'CoveragePublicTest.php', - TEST_FILES_PATH . 'CoverageTwoDefaultClassAnnotations.php', - TEST_FILES_PATH . 'CoveredClass.php', - TEST_FILES_PATH . 'CoveredFunction.php', - TEST_FILES_PATH . 'NamespaceCoverageClassExtendedTest.php', - TEST_FILES_PATH . 'NamespaceCoverageClassTest.php', - TEST_FILES_PATH . 'NamespaceCoverageCoversClassPublicTest.php', - TEST_FILES_PATH . 'NamespaceCoverageCoversClassTest.php', - TEST_FILES_PATH . 'NamespaceCoverageMethodTest.php', - TEST_FILES_PATH . 'NamespaceCoverageNotPrivateTest.php', - TEST_FILES_PATH . 'NamespaceCoverageNotProtectedTest.php', - TEST_FILES_PATH . 'NamespaceCoverageNotPublicTest.php', - TEST_FILES_PATH . 'NamespaceCoveragePrivateTest.php', - TEST_FILES_PATH . 'NamespaceCoverageProtectedTest.php', - TEST_FILES_PATH . 'NamespaceCoveragePublicTest.php', - TEST_FILES_PATH . 'NamespaceCoveredClass.php', - TEST_FILES_PATH . 'NotExistingCoveredElementTest.php', - TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php', - TEST_FILES_PATH . 'source_with_ignore.php', - TEST_FILES_PATH . 'source_with_namespace.php', - TEST_FILES_PATH . 'source_with_oneline_annotations.php', - TEST_FILES_PATH . 'source_without_ignore.php', - TEST_FILES_PATH . 'source_without_namespace.php' - ); - } - - /** - * @covers PHP_CodeCoverage_Filter::addFileToBlacklist - * @covers PHP_CodeCoverage_Filter::getBlacklist - */ - public function testAddingAFileToTheBlacklistWorks() - { - $this->filter->addFileToBlacklist($this->files[0]); - - $this->assertEquals( - array($this->files[0]), - $this->filter->getBlacklist() - ); - } - - /** - * @covers PHP_CodeCoverage_Filter::removeFileFromBlacklist - * @covers PHP_CodeCoverage_Filter::getBlacklist - */ - public function testRemovingAFileFromTheBlacklistWorks() - { - $this->filter->addFileToBlacklist($this->files[0]); - $this->filter->removeFileFromBlacklist($this->files[0]); - - $this->assertEquals(array(), $this->filter->getBlacklist()); - } - - /** - * @covers PHP_CodeCoverage_Filter::addDirectoryToBlacklist - * @covers PHP_CodeCoverage_Filter::getBlacklist - * @depends testAddingAFileToTheBlacklistWorks - */ - public function testAddingADirectoryToTheBlacklistWorks() - { - $this->filter->addDirectoryToBlacklist(TEST_FILES_PATH); - - $blacklist = $this->filter->getBlacklist(); - sort($blacklist); - - $this->assertEquals($this->files, $blacklist); - } - - /** - * @covers PHP_CodeCoverage_Filter::addFilesToBlacklist - * @covers PHP_CodeCoverage_Filter::getBlacklist - */ - public function testAddingFilesToTheBlacklistWorks() - { - $facade = new File_Iterator_Facade; - $files = $facade->getFilesAsArray( - TEST_FILES_PATH, - $suffixes = '.php' - ); - - $this->filter->addFilesToBlacklist($files); - - $blacklist = $this->filter->getBlacklist(); - sort($blacklist); - - $this->assertEquals($this->files, $blacklist); - } - - /** - * @covers PHP_CodeCoverage_Filter::removeDirectoryFromBlacklist - * @covers PHP_CodeCoverage_Filter::getBlacklist - * @depends testAddingADirectoryToTheBlacklistWorks - */ - public function testRemovingADirectoryFromTheBlacklistWorks() - { - $this->filter->addDirectoryToBlacklist(TEST_FILES_PATH); - $this->filter->removeDirectoryFromBlacklist(TEST_FILES_PATH); - - $this->assertEquals(array(), $this->filter->getBlacklist()); - } - - /** - * @covers PHP_CodeCoverage_Filter::addFileToWhitelist - * @covers PHP_CodeCoverage_Filter::getWhitelist - */ - public function testAddingAFileToTheWhitelistWorks() - { - $this->filter->addFileToWhitelist($this->files[0]); - - $this->assertEquals( - array($this->files[0]), - $this->filter->getWhitelist() - ); - } - - /** - * @covers PHP_CodeCoverage_Filter::removeFileFromWhitelist - * @covers PHP_CodeCoverage_Filter::getWhitelist - */ - public function testRemovingAFileFromTheWhitelistWorks() - { - $this->filter->addFileToWhitelist($this->files[0]); - $this->filter->removeFileFromWhitelist($this->files[0]); - - $this->assertEquals(array(), $this->filter->getWhitelist()); - } - - /** - * @covers PHP_CodeCoverage_Filter::addDirectoryToWhitelist - * @covers PHP_CodeCoverage_Filter::getWhitelist - * @depends testAddingAFileToTheWhitelistWorks - */ - public function testAddingADirectoryToTheWhitelistWorks() - { - $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH); - - $whitelist = $this->filter->getWhitelist(); - sort($whitelist); - - $this->assertEquals($this->files, $whitelist); - } - - /** - * @covers PHP_CodeCoverage_Filter::addFilesToWhitelist - * @covers PHP_CodeCoverage_Filter::getBlacklist - */ - public function testAddingFilesToTheWhitelistWorks() - { - $facade = new File_Iterator_Facade; - $files = $facade->getFilesAsArray( - TEST_FILES_PATH, - $suffixes = '.php' - ); - - $this->filter->addFilesToWhitelist($files); - - $whitelist = $this->filter->getWhitelist(); - sort($whitelist); - - $this->assertEquals($this->files, $whitelist); - } - - /** - * @covers PHP_CodeCoverage_Filter::removeDirectoryFromWhitelist - * @covers PHP_CodeCoverage_Filter::getWhitelist - * @depends testAddingADirectoryToTheWhitelistWorks - */ - public function testRemovingADirectoryFromTheWhitelistWorks() - { - $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH); - $this->filter->removeDirectoryFromWhitelist(TEST_FILES_PATH); - - $this->assertEquals(array(), $this->filter->getWhitelist()); - } - - /** - * @covers PHP_CodeCoverage_Filter::isFile - */ - public function testIsFile() - { - $this->assertFalse($this->filter->isFile('vfs://root/a/path')); - $this->assertFalse($this->filter->isFile('xdebug://debug-eval')); - $this->assertFalse($this->filter->isFile('eval()\'d code')); - $this->assertFalse($this->filter->isFile('runtime-created function')); - $this->assertFalse($this->filter->isFile('assert code')); - $this->assertFalse($this->filter->isFile('regexp code')); - $this->assertTrue($this->filter->isFile(__FILE__)); - } - - /** - * @covers PHP_CodeCoverage_Filter::isFiltered - */ - public function testBlacklistedFileIsFiltered() - { - $this->filter->addFileToBlacklist($this->files[0]); - $this->assertTrue($this->filter->isFiltered($this->files[0])); - } - - /** - * @covers PHP_CodeCoverage_Filter::isFiltered - */ - public function testWhitelistedFileIsNotFiltered() - { - $this->filter->addFileToWhitelist($this->files[0]); - $this->assertFalse($this->filter->isFiltered($this->files[0])); - } - - /** - * @covers PHP_CodeCoverage_Filter::isFiltered - */ - public function testNotWhitelistedFileIsFiltered() - { - $this->filter->addFileToWhitelist($this->files[0]); - $this->assertTrue($this->filter->isFiltered($this->files[1])); - } - - /** - * @covers PHP_CodeCoverage_Filter::isFiltered - * @covers PHP_CodeCoverage_Filter::isFile - */ - public function testNonFilesAreFiltered() - { - $this->assertTrue($this->filter->isFiltered('vfs://root/a/path')); - $this->assertTrue($this->filter->isFiltered('xdebug://debug-eval')); - $this->assertTrue($this->filter->isFiltered('eval()\'d code')); - $this->assertTrue($this->filter->isFiltered('runtime-created function')); - $this->assertTrue($this->filter->isFiltered('assert code')); - $this->assertTrue($this->filter->isFiltered('regexp code')); - $this->assertFalse($this->filter->isFiltered(__FILE__)); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/CloverTest.php b/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/CloverTest.php deleted file mode 100644 index 8d860bd..0000000 --- a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/CloverTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once TEST_FILES_PATH . '../TestCase.php'; - -/** - * Tests for the PHP_CodeCoverage_Report_Clover class. - * - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverage_Report_CloverTest extends PHP_CodeCoverage_TestCase -{ - /** - * @covers PHP_CodeCoverage_Report_Clover - */ - public function testCloverForBankAccountTest() - { - $clover = new PHP_CodeCoverage_Report_Clover; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'BankAccount-clover.xml', - $clover->process($this->getCoverageForBankAccount(), null, 'BankAccount') - ); - } - - /** - * @covers PHP_CodeCoverage_Report_Clover - */ - public function testCloverForFileWithIgnoredLines() - { - $clover = new PHP_CodeCoverage_Report_Clover; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'ignored-lines-clover.xml', - $clover->process($this->getCoverageForFileWithIgnoredLines()) - ); - } - - /** - * @covers PHP_CodeCoverage_Report_Clover - */ - public function testCloverForClassWithAnonymousFunction() - { - $clover = new PHP_CodeCoverage_Report_Clover; - - $this->assertStringMatchesFormatFile( - TEST_FILES_PATH . 'class-with-anonymous-function-clover.xml', - $clover->process($this->getCoverageForClassWithAnonymousFunction()) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/FactoryTest.php b/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/FactoryTest.php deleted file mode 100644 index 84f14ae..0000000 --- a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/FactoryTest.php +++ /dev/null @@ -1,222 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once TEST_FILES_PATH . '../TestCase.php'; - -/** - * Tests for the PHP_CodeCoverage_Report_Factory class. - * - * @since Class available since Release 1.1.0 - */ -class PHP_CodeCoverage_Report_FactoryTest extends PHP_CodeCoverage_TestCase -{ - protected $factory; - - protected function setUp() - { - $this->factory = new PHP_CodeCoverage_Report_Factory; - } - - public function testSomething() - { - $root = $this->getCoverageForBankAccount()->getReport(); - - $expectedPath = rtrim(TEST_FILES_PATH, DIRECTORY_SEPARATOR); - $this->assertEquals($expectedPath, $root->getName()); - $this->assertEquals($expectedPath, $root->getPath()); - $this->assertEquals(10, $root->getNumExecutableLines()); - $this->assertEquals(5, $root->getNumExecutedLines()); - $this->assertEquals(1, $root->getNumClasses()); - $this->assertEquals(0, $root->getNumTestedClasses()); - $this->assertEquals(4, $root->getNumMethods()); - $this->assertEquals(3, $root->getNumTestedMethods()); - $this->assertEquals('0.00%', $root->getTestedClassesPercent()); - $this->assertEquals('75.00%', $root->getTestedMethodsPercent()); - $this->assertEquals('50.00%', $root->getLineExecutedPercent()); - $this->assertEquals(0, $root->getNumFunctions()); - $this->assertEquals(0, $root->getNumTestedFunctions()); - $this->assertNull($root->getParent()); - $this->assertEquals(array(), $root->getDirectories()); - #$this->assertEquals(array(), $root->getFiles()); - #$this->assertEquals(array(), $root->getChildNodes()); - - $this->assertEquals( - array( - 'BankAccount' => array( - 'methods' => array( - 'getBalance' => array( - 'signature' => 'getBalance()', - 'startLine' => 6, - 'endLine' => 9, - 'executableLines' => 1, - 'executedLines' => 1, - 'ccn' => 1, - 'coverage' => 100, - 'crap' => '1', - 'link' => 'BankAccount.php.html#6', - 'methodName' => 'getBalance' - ), - 'setBalance' => array( - 'signature' => 'setBalance($balance)', - 'startLine' => 11, - 'endLine' => 18, - 'executableLines' => 5, - 'executedLines' => 0, - 'ccn' => 2, - 'coverage' => 0, - 'crap' => 6, - 'link' => 'BankAccount.php.html#11', - 'methodName' => 'setBalance' - ), - 'depositMoney' => array( - 'signature' => 'depositMoney($balance)', - 'startLine' => 20, - 'endLine' => 25, - 'executableLines' => 2, - 'executedLines' => 2, - 'ccn' => 1, - 'coverage' => 100, - 'crap' => '1', - 'link' => 'BankAccount.php.html#20', - 'methodName' => 'depositMoney' - ), - 'withdrawMoney' => array( - 'signature' => 'withdrawMoney($balance)', - 'startLine' => 27, - 'endLine' => 32, - 'executableLines' => 2, - 'executedLines' => 2, - 'ccn' => 1, - 'coverage' => 100, - 'crap' => '1', - 'link' => 'BankAccount.php.html#27', - 'methodName' => 'withdrawMoney' - ), - ), - 'startLine' => 2, - 'executableLines' => 10, - 'executedLines' => 5, - 'ccn' => 5, - 'coverage' => 50, - 'crap' => '8.12', - 'package' => array( - 'namespace' => '', - 'fullPackage' => '', - 'category' => '', - 'package' => '', - 'subpackage' => '' - ), - 'link' => 'BankAccount.php.html#2', - 'className' => 'BankAccount' - ) - ), - $root->getClasses() - ); - - $this->assertEquals(array(), $root->getFunctions()); - } - - /** - * @covers PHP_CodeCoverage_Report_Factory::buildDirectoryStructure - */ - public function testBuildDirectoryStructure() - { - $method = new ReflectionMethod( - 'PHP_CodeCoverage_Report_Factory', - 'buildDirectoryStructure' - ); - - $method->setAccessible(true); - - $this->assertEquals( - array( - 'src' => array( - 'Money.php/f' => array(), - 'MoneyBag.php/f' => array() - ) - ), - $method->invoke( - $this->factory, - array('src/Money.php' => array(), 'src/MoneyBag.php' => array()) - ) - ); - } - - /** - * @covers PHP_CodeCoverage_Report_Factory::reducePaths - * @dataProvider reducePathsProvider - */ - public function testReducePaths($reducedPaths, $commonPath, $paths) - { - $method = new ReflectionMethod( - 'PHP_CodeCoverage_Report_Factory', - 'reducePaths' - ); - - $method->setAccessible(true); - - $_commonPath = $method->invokeArgs($this->factory, array(&$paths)); - - $this->assertEquals($reducedPaths, $paths); - $this->assertEquals($commonPath, $_commonPath); - } - - public function reducePathsProvider() - { - return array( - array( - array( - 'Money.php' => array(), - 'MoneyBag.php' => array() - ), - '/home/sb/Money', - array( - '/home/sb/Money/Money.php' => array(), - '/home/sb/Money/MoneyBag.php' => array() - ) - ), - array( - array( - 'Money.php' => array() - ), - '/home/sb/Money/', - array( - '/home/sb/Money/Money.php' => array() - ) - ), - array( - array(), - '.', - array() - ), - array( - array( - 'Money.php' => array(), - 'MoneyBag.php' => array(), - 'Cash.phar/Cash.php' => array(), - ), - '/home/sb/Money', - array( - '/home/sb/Money/Money.php' => array(), - '/home/sb/Money/MoneyBag.php' => array(), - 'phar:///home/sb/Money/Cash.phar/Cash.php' => array(), - ), - ), - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/UtilTest.php b/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/UtilTest.php deleted file mode 100644 index 0b4caea..0000000 --- a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/UtilTest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_CodeCoverage_Util class. - * - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverage_UtilTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHP_CodeCoverage_Util::percent - */ - public function testPercent() - { - $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 0)); - $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 100)); - $this->assertEquals( - '100.00%', - PHP_CodeCoverage_Util::percent(100, 100, true) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverageTest.php b/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverageTest.php deleted file mode 100644 index a755b88..0000000 --- a/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverageTest.php +++ /dev/null @@ -1,487 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once TEST_FILES_PATH . '../TestCase.php'; -require_once TEST_FILES_PATH . 'BankAccount.php'; -require_once TEST_FILES_PATH . 'BankAccountTest.php'; - -/** - * Tests for the PHP_CodeCoverage class. - * - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverageTest extends PHP_CodeCoverage_TestCase -{ - /** - * @var PHP_CodeCoverage - */ - private $coverage; - - protected function setUp() - { - $this->coverage = new PHP_CodeCoverage; - } - - /** - * @covers PHP_CodeCoverage::__construct - * @covers PHP_CodeCoverage::filter - */ - public function testConstructor() - { - $this->assertAttributeInstanceOf( - 'PHP_CodeCoverage_Driver_Xdebug', - 'driver', - $this->coverage - ); - - $this->assertAttributeInstanceOf( - 'PHP_CodeCoverage_Filter', - 'filter', - $this->coverage - ); - } - - /** - * @covers PHP_CodeCoverage::__construct - * @covers PHP_CodeCoverage::filter - */ - public function testConstructor2() - { - $filter = new PHP_CodeCoverage_Filter; - $coverage = new PHP_CodeCoverage(null, $filter); - - $this->assertAttributeInstanceOf( - 'PHP_CodeCoverage_Driver_Xdebug', - 'driver', - $coverage - ); - - $this->assertSame($filter, $coverage->filter()); - } - - /** - * @covers PHP_CodeCoverage::start - * @expectedException PHP_CodeCoverage_Exception - */ - public function testStartThrowsExceptionForInvalidArgument() - { - $this->coverage->start(null, array(), null); - } - - /** - * @covers PHP_CodeCoverage::stop - * @expectedException PHP_CodeCoverage_Exception - */ - public function testStopThrowsExceptionForInvalidArgument() - { - $this->coverage->stop(null); - } - - /** - * @covers PHP_CodeCoverage::stop - * @expectedException PHP_CodeCoverage_Exception - */ - public function testStopThrowsExceptionForInvalidArgument2() - { - $this->coverage->stop(true, null); - } - - /** - * @covers PHP_CodeCoverage::append - * @expectedException PHP_CodeCoverage_Exception - */ - public function testAppendThrowsExceptionForInvalidArgument() - { - $this->coverage->append(array(), null); - } - - /** - * @covers PHP_CodeCoverage::setCacheTokens - * @expectedException PHP_CodeCoverage_Exception - */ - public function testSetCacheTokensThrowsExceptionForInvalidArgument() - { - $this->coverage->setCacheTokens(null); - } - - /** - * @covers PHP_CodeCoverage::setCacheTokens - */ - public function testSetCacheTokens() - { - $this->coverage->setCacheTokens(true); - $this->assertAttributeEquals(true, 'cacheTokens', $this->coverage); - } - - /** - * @covers PHP_CodeCoverage::setCheckForUnintentionallyCoveredCode - * @expectedException PHP_CodeCoverage_Exception - */ - public function testSetCheckForUnintentionallyCoveredCodeThrowsExceptionForInvalidArgument() - { - $this->coverage->setCheckForUnintentionallyCoveredCode(null); - } - - /** - * @covers PHP_CodeCoverage::setCheckForUnintentionallyCoveredCode - */ - public function testSetCheckForUnintentionallyCoveredCode() - { - $this->coverage->setCheckForUnintentionallyCoveredCode(true); - $this->assertAttributeEquals( - true, - 'checkForUnintentionallyCoveredCode', - $this->coverage - ); - } - - /** - * @covers PHP_CodeCoverage::setForceCoversAnnotation - * @expectedException PHP_CodeCoverage_Exception - */ - public function testSetForceCoversAnnotationThrowsExceptionForInvalidArgument() - { - $this->coverage->setForceCoversAnnotation(null); - } - - /** - * @covers PHP_CodeCoverage::setForceCoversAnnotation - */ - public function testSetForceCoversAnnotation() - { - $this->coverage->setForceCoversAnnotation(true); - $this->assertAttributeEquals( - true, - 'forceCoversAnnotation', - $this->coverage - ); - } - - /** - * @covers PHP_CodeCoverage::setAddUncoveredFilesFromWhitelist - * @expectedException PHP_CodeCoverage_Exception - */ - public function testSetAddUncoveredFilesFromWhitelistThrowsExceptionForInvalidArgument() - { - $this->coverage->setAddUncoveredFilesFromWhitelist(null); - } - - /** - * @covers PHP_CodeCoverage::setAddUncoveredFilesFromWhitelist - */ - public function testSetAddUncoveredFilesFromWhitelist() - { - $this->coverage->setAddUncoveredFilesFromWhitelist(true); - $this->assertAttributeEquals( - true, - 'addUncoveredFilesFromWhitelist', - $this->coverage - ); - } - - /** - * @covers PHP_CodeCoverage::setProcessUncoveredFilesFromWhitelist - * @expectedException PHP_CodeCoverage_Exception - */ - public function testSetProcessUncoveredFilesFromWhitelistThrowsExceptionForInvalidArgument() - { - $this->coverage->setProcessUncoveredFilesFromWhitelist(null); - } - - /** - * @covers PHP_CodeCoverage::setProcessUncoveredFilesFromWhitelist - */ - public function testSetProcessUncoveredFilesFromWhitelist() - { - $this->coverage->setProcessUncoveredFilesFromWhitelist(true); - $this->assertAttributeEquals( - true, - 'processUncoveredFilesFromWhitelist', - $this->coverage - ); - } - - /** - * @covers PHP_CodeCoverage::setMapTestClassNameToCoveredClassName - */ - public function testSetMapTestClassNameToCoveredClassName() - { - $this->coverage->setMapTestClassNameToCoveredClassName(true); - $this->assertAttributeEquals( - true, - 'mapTestClassNameToCoveredClassName', - $this->coverage - ); - } - - /** - * @covers PHP_CodeCoverage::setMapTestClassNameToCoveredClassName - * @expectedException PHP_CodeCoverage_Exception - */ - public function testSetMapTestClassNameToCoveredClassNameThrowsExceptionForInvalidArgument() - { - $this->coverage->setMapTestClassNameToCoveredClassName(null); - } - - /** - * @covers PHP_CodeCoverage::clear - */ - public function testClear() - { - $this->coverage->clear(); - - $this->assertAttributeEquals(null, 'currentId', $this->coverage); - $this->assertAttributeEquals(array(), 'data', $this->coverage); - $this->assertAttributeEquals(array(), 'tests', $this->coverage); - } - - /** - * @covers PHP_CodeCoverage::start - * @covers PHP_CodeCoverage::stop - * @covers PHP_CodeCoverage::append - * @covers PHP_CodeCoverage::applyListsFilter - * @covers PHP_CodeCoverage::initializeFilesThatAreSeenTheFirstTime - * @covers PHP_CodeCoverage::applyCoversAnnotationFilter - * @covers PHP_CodeCoverage::getTests - */ - public function testCollect() - { - $coverage = $this->getCoverageForBankAccount(); - - $this->assertEquals( - $this->getExpectedDataArrayForBankAccount(), - $coverage->getData() - ); - - if (version_compare(PHPUnit_Runner_Version::id(), '4.7', '>=')) { - $size = 'unknown'; - } else { - $size = 'small'; - } - - $this->assertEquals( - array( - 'BankAccountTest::testBalanceIsInitiallyZero' => array('size' => $size, 'status' => null), - 'BankAccountTest::testBalanceCannotBecomeNegative' => array('size' => $size, 'status' => null), - 'BankAccountTest::testBalanceCannotBecomeNegative2' => array('size' => $size, 'status' => null), - 'BankAccountTest::testDepositWithdrawMoney' => array('size' => $size, 'status' => null) - ), - $coverage->getTests() - ); - } - - /** - * @covers PHP_CodeCoverage::getData - * @covers PHP_CodeCoverage::merge - */ - public function testMerge() - { - $coverage = $this->getCoverageForBankAccountForFirstTwoTests(); - $coverage->merge($this->getCoverageForBankAccountForLastTwoTests()); - - $this->assertEquals( - $this->getExpectedDataArrayForBankAccount(), - $coverage->getData() - ); - } - - /** - * @covers PHP_CodeCoverage::getData - * @covers PHP_CodeCoverage::merge - */ - public function testMerge2() - { - $coverage = new PHP_CodeCoverage( - $this->getMock('PHP_CodeCoverage_Driver_Xdebug'), - new PHP_CodeCoverage_Filter - ); - - $coverage->merge($this->getCoverageForBankAccount()); - - $this->assertEquals( - $this->getExpectedDataArrayForBankAccount(), - $coverage->getData() - ); - } - - /** - * @covers PHP_CodeCoverage::getLinesToBeIgnored - */ - public function testGetLinesToBeIgnored() - { - $this->assertEquals( - array( - 1, - 3, - 4, - 5, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 30, - 32, - 33, - 34, - 35, - 36, - 37, - 38 - ), - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_ignore.php' - ) - ); - } - - /** - * @covers PHP_CodeCoverage::getLinesToBeIgnored - */ - public function testGetLinesToBeIgnored2() - { - $this->assertEquals( - array(1, 5), - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_without_ignore.php' - ) - ); - } - - /** - * @covers PHP_CodeCoverage::getLinesToBeIgnored - */ - public function testGetLinesToBeIgnored3() - { - $this->assertEquals( - array( - 1, - 2, - 3, - 4, - 5, - 8, - 11, - 15, - 16, - 19, - 20 - ), - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php' - ) - ); - } - - /** - * @covers PHP_CodeCoverage::getLinesToBeIgnored - */ - public function testGetLinesToBeIgnoredOneLineAnnotations() - { - $this->assertEquals( - array( - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 18, - 20, - 21, - 23, - 24, - 25, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 37 - ), - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_oneline_annotations.php' - ) - ); - } - - /** - * @return ReflectionMethod - */ - private function getLinesToBeIgnored() - { - $getLinesToBeIgnored = new ReflectionMethod( - 'PHP_CodeCoverage', - 'getLinesToBeIgnored' - ); - - $getLinesToBeIgnored->setAccessible(true); - - return $getLinesToBeIgnored; - } - - /** - * @covers PHP_CodeCoverage::getLinesToBeIgnored - */ - public function testGetLinesToBeIgnoredWhenIgnoreIsDisabled() - { - $this->coverage->setDisableIgnoredLines(true); - - $this->assertEquals( - array(), - $this->getLinesToBeIgnored()->invoke( - $this->coverage, - TEST_FILES_PATH . 'source_with_ignore.php' - ) - ); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/TestCase.php b/vendor/phpunit/php-code-coverage/tests/TestCase.php deleted file mode 100644 index f982428..0000000 --- a/vendor/phpunit/php-code-coverage/tests/TestCase.php +++ /dev/null @@ -1,311 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Abstract base class for test case classes. - * - * @since Class available since Release 1.0.0 - */ -abstract class PHP_CodeCoverage_TestCase extends PHPUnit_Framework_TestCase -{ - protected function getXdebugDataForBankAccount() - { - return array( - array( - TEST_FILES_PATH . 'BankAccount.php' => array( - 8 => 1, - 9 => -2, - 13 => -1, - 14 => -1, - 15 => -1, - 16 => -1, - 18 => -1, - 22 => -1, - 24 => -1, - 25 => -2, - 29 => -1, - 31 => -1, - 32 => -2 - ) - ), - array( - TEST_FILES_PATH . 'BankAccount.php' => array( - 8 => 1, - 13 => 1, - 16 => 1, - 29 => 1, - ) - ), - array( - TEST_FILES_PATH . 'BankAccount.php' => array( - 8 => 1, - 13 => 1, - 16 => 1, - 22 => 1, - ) - ), - array( - TEST_FILES_PATH . 'BankAccount.php' => array( - 8 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 18 => 1, - 22 => 1, - 24 => 1, - 29 => 1, - 31 => 1, - ) - ) - ); - } - - protected function getCoverageForBankAccount() - { - $data = $this->getXdebugDataForBankAccount(); - - $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); - $stub->expects($this->any()) - ->method('stop') - ->will($this->onConsecutiveCalls( - $data[0], - $data[1], - $data[2], - $data[3] - )); - - $coverage = new PHP_CodeCoverage($stub, new PHP_CodeCoverage_Filter); - - $coverage->start( - new BankAccountTest('testBalanceIsInitiallyZero'), - true - ); - - $coverage->stop( - true, - array(TEST_FILES_PATH . 'BankAccount.php' => range(6, 9)) - ); - - $coverage->start( - new BankAccountTest('testBalanceCannotBecomeNegative') - ); - - $coverage->stop( - true, - array(TEST_FILES_PATH . 'BankAccount.php' => range(27, 32)) - ); - - $coverage->start( - new BankAccountTest('testBalanceCannotBecomeNegative2') - ); - - $coverage->stop( - true, - array(TEST_FILES_PATH . 'BankAccount.php' => range(20, 25)) - ); - - $coverage->start( - new BankAccountTest('testDepositWithdrawMoney') - ); - - $coverage->stop( - true, - array( - TEST_FILES_PATH . 'BankAccount.php' => array_merge( - range(6, 9), - range(20, 25), - range(27, 32) - ) - ) - ); - - return $coverage; - } - - protected function getCoverageForBankAccountForFirstTwoTests() - { - $data = $this->getXdebugDataForBankAccount(); - - $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); - $stub->expects($this->any()) - ->method('stop') - ->will($this->onConsecutiveCalls( - $data[0], - $data[1] - )); - - $coverage = new PHP_CodeCoverage($stub, new PHP_CodeCoverage_Filter); - - $coverage->start( - new BankAccountTest('testBalanceIsInitiallyZero'), - true - ); - - $coverage->stop( - true, - array(TEST_FILES_PATH . 'BankAccount.php' => range(6, 9)) - ); - - $coverage->start( - new BankAccountTest('testBalanceCannotBecomeNegative') - ); - - $coverage->stop( - true, - array(TEST_FILES_PATH . 'BankAccount.php' => range(27, 32)) - ); - - return $coverage; - } - - protected function getCoverageForBankAccountForLastTwoTests() - { - $data = $this->getXdebugDataForBankAccount(); - - $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); - $stub->expects($this->any()) - ->method('stop') - ->will($this->onConsecutiveCalls( - $data[2], - $data[3] - )); - - $coverage = new PHP_CodeCoverage($stub, new PHP_CodeCoverage_Filter); - - $coverage->start( - new BankAccountTest('testBalanceCannotBecomeNegative2') - ); - - $coverage->stop( - true, - array(TEST_FILES_PATH . 'BankAccount.php' => range(20, 25)) - ); - - $coverage->start( - new BankAccountTest('testDepositWithdrawMoney') - ); - - $coverage->stop( - true, - array( - TEST_FILES_PATH . 'BankAccount.php' => array_merge( - range(6, 9), - range(20, 25), - range(27, 32) - ) - ) - ); - - return $coverage; - } - - protected function getExpectedDataArrayForBankAccount() - { - return array( - TEST_FILES_PATH . 'BankAccount.php' => array( - 8 => array( - 0 => 'BankAccountTest::testBalanceIsInitiallyZero', - 1 => 'BankAccountTest::testDepositWithdrawMoney' - ), - 9 => null, - 13 => array(), - 14 => array(), - 15 => array(), - 16 => array(), - 18 => array(), - 22 => array( - 0 => 'BankAccountTest::testBalanceCannotBecomeNegative2', - 1 => 'BankAccountTest::testDepositWithdrawMoney' - ), - 24 => array( - 0 => 'BankAccountTest::testDepositWithdrawMoney', - ), - 25 => null, - 29 => array( - 0 => 'BankAccountTest::testBalanceCannotBecomeNegative', - 1 => 'BankAccountTest::testDepositWithdrawMoney' - ), - 31 => array( - 0 => 'BankAccountTest::testDepositWithdrawMoney' - ), - 32 => null - ) - ); - } - - protected function getCoverageForFileWithIgnoredLines() - { - $coverage = new PHP_CodeCoverage( - $this->setUpXdebugStubForFileWithIgnoredLines(), - new PHP_CodeCoverage_Filter - ); - - $coverage->start('FileWithIgnoredLines', true); - $coverage->stop(); - - return $coverage; - } - - protected function setUpXdebugStubForFileWithIgnoredLines() - { - $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); - $stub->expects($this->any()) - ->method('stop') - ->will($this->returnValue( - array( - TEST_FILES_PATH . 'source_with_ignore.php' => array( - 2 => 1, - 4 => -1, - 6 => -1, - 7 => 1 - ) - ) - )); - - return $stub; - } - - protected function getCoverageForClassWithAnonymousFunction() - { - $coverage = new PHP_CodeCoverage( - $this->setUpXdebugStubForClassWithAnonymousFunction(), - new PHP_CodeCoverage_Filter - ); - - $coverage->start('ClassWithAnonymousFunction', true); - $coverage->stop(); - - return $coverage; - } - - protected function setUpXdebugStubForClassWithAnonymousFunction() - { - $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); - $stub->expects($this->any()) - ->method('stop') - ->will($this->returnValue( - array( - TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php' => array( - 7 => 1, - 9 => 1, - 10 => -1, - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 17 => 1, - 18 => 1 - ) - ) - )); - - return $stub; - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml b/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml deleted file mode 100644 index 578a7cc..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php b/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php deleted file mode 100644 index 4238c15..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php +++ /dev/null @@ -1,33 +0,0 @@ -balance; - } - - protected function setBalance($balance) - { - if ($balance >= 0) { - $this->balance = $balance; - } else { - throw new RuntimeException; - } - } - - public function depositMoney($balance) - { - $this->setBalance($this->getBalance() + $balance); - - return $this->getBalance(); - } - - public function withdrawMoney($balance) - { - $this->setBalance($this->getBalance() - $balance); - - return $this->getBalance(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php b/vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php deleted file mode 100644 index 3a6277b..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php +++ /dev/null @@ -1,66 +0,0 @@ -ba = new BankAccount; - } - - /** - * @covers BankAccount::getBalance - */ - public function testBalanceIsInitiallyZero() - { - $this->assertEquals(0, $this->ba->getBalance()); - } - - /** - * @covers BankAccount::withdrawMoney - */ - public function testBalanceCannotBecomeNegative() - { - try { - $this->ba->withdrawMoney(1); - } catch (RuntimeException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /** - * @covers BankAccount::depositMoney - */ - public function testBalanceCannotBecomeNegative2() - { - try { - $this->ba->depositMoney(-1); - } catch (RuntimeException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /** - * @covers BankAccount::getBalance - * @covers BankAccount::depositMoney - * @covers BankAccount::withdrawMoney - */ - public function testDepositWithdrawMoney() - { - $this->assertEquals(0, $this->ba->getBalance()); - $this->ba->depositMoney(1); - $this->assertEquals(1, $this->ba->getBalance()); - $this->ba->withdrawMoney(1); - $this->assertEquals(0, $this->ba->getBalance()); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php deleted file mode 100644 index df12d34..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php deleted file mode 100644 index 7f569ae..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php deleted file mode 100644 index 33b5fe3..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php +++ /dev/null @@ -1,11 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php deleted file mode 100644 index 4223004..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php deleted file mode 100644 index d1be1c6..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php deleted file mode 100644 index 167b3db..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php deleted file mode 100644 index 0b414c2..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php +++ /dev/null @@ -1,9 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php deleted file mode 100644 index 12b56e8..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php deleted file mode 100644 index c69d261..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php deleted file mode 100644 index aebfe4b..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php deleted file mode 100644 index 5d5680d..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php +++ /dev/null @@ -1,13 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php deleted file mode 100644 index f09560d..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php deleted file mode 100644 index 9b3acbf..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php deleted file mode 100644 index 480a522..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php b/vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php deleted file mode 100644 index 7ffc5c9..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } - -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php deleted file mode 100644 index f382ce9..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php +++ /dev/null @@ -1,36 +0,0 @@ -privateMethod(); - } - - public function publicMethod() - { - $this->protectedMethod(); - } -} - -class CoveredClass extends CoveredParentClass -{ - private function privateMethod() - { - } - - protected function protectedMethod() - { - parent::protectedMethod(); - $this->privateMethod(); - } - - public function publicMethod() - { - parent::publicMethod(); - $this->protectedMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php b/vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php deleted file mode 100644 index 9989eb0..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php +++ /dev/null @@ -1,4 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php deleted file mode 100644 index 63912c0..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php deleted file mode 100644 index 45f583b..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php +++ /dev/null @@ -1,15 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php deleted file mode 100644 index b336745..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php +++ /dev/null @@ -1,20 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php deleted file mode 100644 index 35dfb8b..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php deleted file mode 100644 index 552c9ec..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php deleted file mode 100644 index 33fc8c7..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php deleted file mode 100644 index ccbc500..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php deleted file mode 100644 index cce7ba9..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php deleted file mode 100644 index dbbcc1c..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php deleted file mode 100644 index bf1bff8..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php b/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php deleted file mode 100644 index 5bd0ddf..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php +++ /dev/null @@ -1,38 +0,0 @@ -privateMethod(); - } - - public function publicMethod() - { - $this->protectedMethod(); - } -} - -class CoveredClass extends CoveredParentClass -{ - private function privateMethod() - { - } - - protected function protectedMethod() - { - parent::protectedMethod(); - $this->privateMethod(); - } - - public function publicMethod() - { - parent::publicMethod(); - $this->protectedMethod(); - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php b/vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php deleted file mode 100644 index be07ef4..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ - public function testThree() - { - } -} diff --git a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml b/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml deleted file mode 100644 index ac43b80..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml b/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml deleted file mode 100644 index cda929c..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php b/vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php deleted file mode 100644 index eaba387..0000000 --- a/vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for PHP_Timer. - * - * @since Class available since Release 1.0.0 - */ -class PHP_TimerTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHP_Timer::start - * @covers PHP_Timer::stop - */ - public function testStartStop() - { - $this->assertInternalType('float', PHP_Timer::stop()); - } - - /** - * @covers PHP_Timer::secondsToTimeString - * @dataProvider secondsProvider - */ - public function testSecondsToTimeString($string, $seconds) - { - $this->assertEquals( - $string, - PHP_Timer::secondsToTimeString($seconds) - ); - } - - /** - * @covers PHP_Timer::timeSinceStartOfRequest - */ - public function testTimeSinceStartOfRequest() - { - $this->assertStringMatchesFormat( - '%f %s', - PHP_Timer::timeSinceStartOfRequest() - ); - } - - - /** - * @covers PHP_Timer::resourceUsage - */ - public function testResourceUsage() - { - $this->assertStringMatchesFormat( - 'Time: %s, Memory: %s', - PHP_Timer::resourceUsage() - ); - } - - public function secondsProvider() - { - return array( - array('0 ms', 0), - array('1 ms', .001), - array('10 ms', .01), - array('100 ms', .1), - array('999 ms', .999), - array('1 second', .9999), - array('1 second', 1), - array('2 seconds', 2), - array('59.9 seconds', 59.9), - array('59.99 seconds', 59.99), - array('59.99 seconds', 59.999), - array('1 minute', 59.9999), - array('59 seconds', 59.001), - array('59.01 seconds', 59.01), - array('1 minute', 60), - array('1.01 minutes', 61), - array('2 minutes', 120), - array('2.01 minutes', 121), - array('59.99 minutes', 3599.9), - array('59.99 minutes', 3599.99), - array('59.99 minutes', 3599.999), - array('1 hour', 3599.9999), - array('59.98 minutes', 3599.001), - array('59.98 minutes', 3599.01), - array('1 hour', 3600), - array('1 hour', 3601), - array('1 hour', 3601.9), - array('1 hour', 3601.99), - array('1 hour', 3601.999), - array('1 hour', 3601.9999), - array('1.01 hours', 3659.9999), - array('1.01 hours', 3659.001), - array('1.01 hours', 3659.01), - array('2 hours', 7199.9999), - ); - } -} diff --git a/vendor/phpunit/php-token-stream/tests/Token/ClassTest.php b/vendor/phpunit/php-token-stream/tests/Token/ClassTest.php deleted file mode 100644 index 4ba0296..0000000 --- a/vendor/phpunit/php-token-stream/tests/Token/ClassTest.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_Token_CLASS class. - * - * @package PHP_TokenStream - * @subpackage Tests - * @author Laurent Laville - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @version Release: @package_version@ - * @link http://github.com/sebastianbergmann/php-token-stream/ - * @since Class available since Release 1.0.2 - */ -class PHP_Token_ClassTest extends PHPUnit_Framework_TestCase -{ - protected $class; - protected $function; - - protected function setUp() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source2.php'); - - foreach ($ts as $token) { - if ($token instanceof PHP_Token_CLASS) { - $this->class = $token; - } - - if ($token instanceof PHP_Token_FUNCTION) { - $this->function = $token; - break; - } - } - } - - /** - * @covers PHP_Token_CLASS::getKeywords - */ - public function testGetClassKeywords() - { - $this->assertEquals('abstract', $this->class->getKeywords()); - } - - /** - * @covers PHP_Token_FUNCTION::getKeywords - */ - public function testGetFunctionKeywords() - { - $this->assertEquals('abstract,static', $this->function->getKeywords()); - } - - /** - * @covers PHP_Token_FUNCTION::getVisibility - */ - public function testGetFunctionVisibility() - { - $this->assertEquals('public', $this->function->getVisibility()); - } - - public function testIssue19() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'issue19.php'); - - foreach ($ts as $token) { - if ($token instanceof PHP_Token_CLASS) { - $this->assertFalse($token->hasInterfaces()); - } - } - } - - public function testIssue30() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'issue30.php'); - $this->assertCount(1, $ts->getClasses()); - } - - /** - * @requires PHP 7 - */ - public function testAnonymousClassesAreHandledCorrectly() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'class_with_method_that_declares_anonymous_class.php'); - - $classes = $ts->getClasses(); - - $this->assertEquals(array('class_with_method_that_declares_anonymous_class'), array_keys($classes)); - } - - /** - * @requires PHP 7 - * @ticket https://github.com/sebastianbergmann/php-token-stream/issues/52 - */ - public function testAnonymousClassesAreHandledCorrectly2() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'class_with_method_that_declares_anonymous_class2.php'); - - $classes = $ts->getClasses(); - - $this->assertEquals(array('Test'), array_keys($classes)); - $this->assertEquals(array('methodOne', 'methodTwo'), array_keys($classes['Test']['methods'])); - - $this->assertEmpty($ts->getFunctions()); - } -} diff --git a/vendor/phpunit/php-token-stream/tests/Token/ClosureTest.php b/vendor/phpunit/php-token-stream/tests/Token/ClosureTest.php deleted file mode 100644 index f1e508c..0000000 --- a/vendor/phpunit/php-token-stream/tests/Token/ClosureTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_Token_FUNCTION class. - * - * @package PHP_TokenStream - * @subpackage Tests - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @version Release: @package_version@ - * @link http://github.com/sebastianbergmann/php-token-stream/ - * @since Class available since Release 1.0.0 - */ -class PHP_Token_ClosureTest extends PHPUnit_Framework_TestCase -{ - protected $functions; - - protected function setUp() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'closure.php'); - - foreach ($ts as $token) { - if ($token instanceof PHP_Token_FUNCTION) { - $this->functions[] = $token; - } - } - } - - /** - * @covers PHP_Token_FUNCTION::getArguments - */ - public function testGetArguments() - { - $this->assertEquals(array('$foo' => null, '$bar' => null), $this->functions[0]->getArguments()); - $this->assertEquals(array('$foo' => 'Foo', '$bar' => null), $this->functions[1]->getArguments()); - $this->assertEquals(array('$foo' => null, '$bar' => null, '$baz' => null), $this->functions[2]->getArguments()); - $this->assertEquals(array('$foo' => 'Foo', '$bar' => null, '$baz' => null), $this->functions[3]->getArguments()); - $this->assertEquals(array(), $this->functions[4]->getArguments()); - $this->assertEquals(array(), $this->functions[5]->getArguments()); - } - - /** - * @covers PHP_Token_FUNCTION::getName - */ - public function testGetName() - { - $this->assertEquals('anonymous function', $this->functions[0]->getName()); - $this->assertEquals('anonymous function', $this->functions[1]->getName()); - $this->assertEquals('anonymous function', $this->functions[2]->getName()); - $this->assertEquals('anonymous function', $this->functions[3]->getName()); - $this->assertEquals('anonymous function', $this->functions[4]->getName()); - $this->assertEquals('anonymous function', $this->functions[5]->getName()); - } - - /** - * @covers PHP_Token::getLine - */ - public function testGetLine() - { - $this->assertEquals(2, $this->functions[0]->getLine()); - $this->assertEquals(3, $this->functions[1]->getLine()); - $this->assertEquals(4, $this->functions[2]->getLine()); - $this->assertEquals(5, $this->functions[3]->getLine()); - } - - /** - * @covers PHP_TokenWithScope::getEndLine - */ - public function testGetEndLine() - { - $this->assertEquals(2, $this->functions[0]->getLine()); - $this->assertEquals(3, $this->functions[1]->getLine()); - $this->assertEquals(4, $this->functions[2]->getLine()); - $this->assertEquals(5, $this->functions[3]->getLine()); - } -} diff --git a/vendor/phpunit/php-token-stream/tests/Token/FunctionTest.php b/vendor/phpunit/php-token-stream/tests/Token/FunctionTest.php deleted file mode 100644 index 4f23c39..0000000 --- a/vendor/phpunit/php-token-stream/tests/Token/FunctionTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_Token_FUNCTION class. - * - * @package PHP_TokenStream - * @subpackage Tests - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @version Release: @package_version@ - * @link http://github.com/sebastianbergmann/php-token-stream/ - * @since Class available since Release 1.0.0 - */ -class PHP_Token_FunctionTest extends PHPUnit_Framework_TestCase -{ - protected $functions; - - protected function setUp() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source.php'); - - foreach ($ts as $token) { - if ($token instanceof PHP_Token_FUNCTION) { - $this->functions[] = $token; - } - } - } - - /** - * @covers PHP_Token_FUNCTION::getArguments - */ - public function testGetArguments() - { - $this->assertEquals(array(), $this->functions[0]->getArguments()); - - $this->assertEquals( - array('$baz' => 'Baz'), $this->functions[1]->getArguments() - ); - - $this->assertEquals( - array('$foobar' => 'Foobar'), $this->functions[2]->getArguments() - ); - - $this->assertEquals( - array('$barfoo' => 'Barfoo'), $this->functions[3]->getArguments() - ); - - $this->assertEquals(array(), $this->functions[4]->getArguments()); - - $this->assertEquals(array('$x' => null, '$y' => null), $this->functions[5]->getArguments()); - } - - /** - * @covers PHP_Token_FUNCTION::getName - */ - public function testGetName() - { - $this->assertEquals('foo', $this->functions[0]->getName()); - $this->assertEquals('bar', $this->functions[1]->getName()); - $this->assertEquals('foobar', $this->functions[2]->getName()); - $this->assertEquals('barfoo', $this->functions[3]->getName()); - $this->assertEquals('baz', $this->functions[4]->getName()); - } - - /** - * @covers PHP_Token::getLine - */ - public function testGetLine() - { - $this->assertEquals(5, $this->functions[0]->getLine()); - $this->assertEquals(10, $this->functions[1]->getLine()); - $this->assertEquals(17, $this->functions[2]->getLine()); - $this->assertEquals(21, $this->functions[3]->getLine()); - $this->assertEquals(29, $this->functions[4]->getLine()); - } - - /** - * @covers PHP_TokenWithScope::getEndLine - */ - public function testGetEndLine() - { - $this->assertEquals(5, $this->functions[0]->getEndLine()); - $this->assertEquals(12, $this->functions[1]->getEndLine()); - $this->assertEquals(19, $this->functions[2]->getEndLine()); - $this->assertEquals(23, $this->functions[3]->getEndLine()); - $this->assertEquals(31, $this->functions[4]->getEndLine()); - } - - /** - * @covers PHP_Token_FUNCTION::getDocblock - */ - public function testGetDocblock() - { - $this->assertNull($this->functions[0]->getDocblock()); - - $this->assertEquals( - "/**\n * @param Baz \$baz\n */", - $this->functions[1]->getDocblock() - ); - - $this->assertEquals( - "/**\n * @param Foobar \$foobar\n */", - $this->functions[2]->getDocblock() - ); - - $this->assertNull($this->functions[3]->getDocblock()); - $this->assertNull($this->functions[4]->getDocblock()); - } - - public function testSignature() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source5.php'); - $f = $ts->getFunctions(); - $c = $ts->getClasses(); - $i = $ts->getInterfaces(); - - $this->assertEquals( - 'foo($a, array $b, array $c = array())', - $f['foo']['signature'] - ); - - $this->assertEquals( - 'm($a, array $b, array $c = array())', - $c['c']['methods']['m']['signature'] - ); - - $this->assertEquals( - 'm($a, array $b, array $c = array())', - $c['a']['methods']['m']['signature'] - ); - - $this->assertEquals( - 'm($a, array $b, array $c = array())', - $i['i']['methods']['m']['signature'] - ); - } -} diff --git a/vendor/phpunit/php-token-stream/tests/Token/IncludeTest.php b/vendor/phpunit/php-token-stream/tests/Token/IncludeTest.php deleted file mode 100644 index 1e43351..0000000 --- a/vendor/phpunit/php-token-stream/tests/Token/IncludeTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_Token_REQUIRE_ONCE, PHP_Token_REQUIRE - * PHP_Token_INCLUDE_ONCE and PHP_Token_INCLUDE_ONCE classes. - * - * @package PHP_TokenStream - * @subpackage Tests - * @author Laurent Laville - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @version Release: @package_version@ - * @link http://github.com/sebastianbergmann/php-token-stream/ - * @since Class available since Release 1.0.2 - */ -class PHP_Token_IncludeTest extends PHPUnit_Framework_TestCase -{ - protected $ts; - - protected function setUp() - { - $this->ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source3.php'); - } - - /** - * @covers PHP_Token_Includes::getName - * @covers PHP_Token_Includes::getType - */ - public function testGetIncludes() - { - $this->assertSame( - array('test4.php', 'test3.php', 'test2.php', 'test1.php'), - $this->ts->getIncludes() - ); - } - - /** - * @covers PHP_Token_Includes::getName - * @covers PHP_Token_Includes::getType - */ - public function testGetIncludesCategorized() - { - $this->assertSame( - array( - 'require_once' => array('test4.php'), - 'require' => array('test3.php'), - 'include_once' => array('test2.php'), - 'include' => array('test1.php') - ), - $this->ts->getIncludes(TRUE) - ); - } - - /** - * @covers PHP_Token_Includes::getName - * @covers PHP_Token_Includes::getType - */ - public function testGetIncludesCategory() - { - $this->assertSame( - array('test4.php'), - $this->ts->getIncludes(TRUE, 'require_once') - ); - } -} diff --git a/vendor/phpunit/php-token-stream/tests/Token/InterfaceTest.php b/vendor/phpunit/php-token-stream/tests/Token/InterfaceTest.php deleted file mode 100644 index 56caede..0000000 --- a/vendor/phpunit/php-token-stream/tests/Token/InterfaceTest.php +++ /dev/null @@ -1,191 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_Token_INTERFACE class. - * - * @package PHP_TokenStream - * @subpackage Tests - * @author Sebastian Bergmann - * @author Laurent Laville - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @version Release: @package_version@ - * @link http://github.com/sebastianbergmann/php-token-stream/ - * @since Class available since Release 1.0.0 - */ -class PHP_Token_InterfaceTest extends PHPUnit_Framework_TestCase -{ - protected $class; - protected $interfaces; - - protected function setUp() - { - $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source4.php'); - $i = 0; - foreach ($ts as $token) { - if ($token instanceof PHP_Token_CLASS) { - $this->class = $token; - } - elseif ($token instanceof PHP_Token_INTERFACE) { - $this->interfaces[$i] = $token; - $i++; - } - } - } - - /** - * @covers PHP_Token_INTERFACE::getName - */ - public function testGetName() - { - $this->assertEquals( - 'iTemplate', $this->interfaces[0]->getName() - ); - } - - /** - * @covers PHP_Token_INTERFACE::getParent - */ - public function testGetParentNotExists() - { - $this->assertFalse( - $this->interfaces[0]->getParent() - ); - } - - /** - * @covers PHP_Token_INTERFACE::hasParent - */ - public function testHasParentNotExists() - { - $this->assertFalse( - $this->interfaces[0]->hasParent() - ); - } - - /** - * @covers PHP_Token_INTERFACE::getParent - */ - public function testGetParentExists() - { - $this->assertEquals( - 'a', $this->interfaces[2]->getParent() - ); - } - - /** - * @covers PHP_Token_INTERFACE::hasParent - */ - public function testHasParentExists() - { - $this->assertTrue( - $this->interfaces[2]->hasParent() - ); - } - - /** - * @covers PHP_Token_INTERFACE::getInterfaces - */ - public function testGetInterfacesExists() - { - $this->assertEquals( - array('b'), - $this->class->getInterfaces() - ); - } - - /** - * @covers PHP_Token_INTERFACE::hasInterfaces - */ - public function testHasInterfacesExists() - { - $this->assertTrue( - $this->class->hasInterfaces() - ); - } - /** - * @covers PHP_Token_INTERFACE::getPackage - */ - public function testGetPackageNamespace() { - $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInNamespace.php'); - foreach($tokenStream as $token) { - if($token instanceOf PHP_Token_INTERFACE) { - $package = $token->getPackage(); - $this->assertSame('Foo\\Bar', $package['namespace']); - } - } - } - - - public function provideFilesWithClassesWithinMultipleNamespaces() { - return array( - array(TEST_FILES_PATH . 'multipleNamespacesWithOneClassUsingBraces.php'), - array(TEST_FILES_PATH . 'multipleNamespacesWithOneClassUsingNonBraceSyntax.php'), - ); - } - - /** - * @dataProvider provideFilesWithClassesWithinMultipleNamespaces - * @covers PHP_Token_INTERFACE::getPackage - */ - public function testGetPackageNamespaceForFileWithMultipleNamespaces($filepath) { - $tokenStream = new PHP_Token_Stream($filepath); - $firstClassFound = false; - foreach($tokenStream as $token) { - if($firstClassFound === false && $token instanceOf PHP_Token_INTERFACE) { - $package = $token->getPackage(); - $this->assertSame('TestClassInBar', $token->getName()); - $this->assertSame('Foo\\Bar', $package['namespace']); - $firstClassFound = true; - continue; - } - // Secound class - if($token instanceOf PHP_Token_INTERFACE) { - $package = $token->getPackage(); - $this->assertSame('TestClassInBaz', $token->getName()); - $this->assertSame('Foo\\Baz', $package['namespace']); - return; - } - } - $this->fail("Seachring for 2 classes failed"); - } - - public function testGetPackageNamespaceIsEmptyForInterfacesThatAreNotWithinNamespaces() { - foreach($this->interfaces as $token) { - $package = $token->getPackage(); - $this->assertSame("", $package['namespace']); - } - } - - /** - * @covers PHP_Token_INTERFACE::getPackage - */ - public function testGetPackageNamespaceWhenExtentingFromNamespaceClass() { - $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classExtendsNamespacedClass.php'); - $firstClassFound = false; - foreach($tokenStream as $token) { - if($firstClassFound === false && $token instanceOf PHP_Token_INTERFACE) { - $package = $token->getPackage(); - $this->assertSame('Baz', $token->getName()); - $this->assertSame('Foo\\Bar', $package['namespace']); - $firstClassFound = true; - continue; - } - if($token instanceOf PHP_Token_INTERFACE) { - $package = $token->getPackage(); - $this->assertSame('Extender', $token->getName()); - $this->assertSame('Other\\Space', $package['namespace']); - return; - } - } - $this->fail("Searching for 2 classes failed"); - } -} diff --git a/vendor/phpunit/php-token-stream/tests/Token/NamespaceTest.php b/vendor/phpunit/php-token-stream/tests/Token/NamespaceTest.php deleted file mode 100644 index 469f787..0000000 --- a/vendor/phpunit/php-token-stream/tests/Token/NamespaceTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_Token_NAMESPACE class. - * - * @package PHP_TokenStream - * @subpackage Tests - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @version Release: @package_version@ - * @link http://github.com/sebastianbergmann/php-token-stream/ - * @since Class available since Release 1.0.0 - */ -class PHP_Token_NamespaceTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHP_Token_NAMESPACE::getName - */ - public function testGetName() - { - $tokenStream = new PHP_Token_Stream( - TEST_FILES_PATH . 'classInNamespace.php' - ); - - foreach ($tokenStream as $token) { - if ($token instanceof PHP_Token_NAMESPACE) { - $this->assertSame('Foo\\Bar', $token->getName()); - } - } - } - - public function testGetStartLineWithUnscopedNamespace() - { - $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInNamespace.php'); - foreach($tokenStream as $token) { - if($token instanceOf PHP_Token_NAMESPACE) { - $this->assertSame(2, $token->getLine()); - } - } - } - - public function testGetEndLineWithUnscopedNamespace() - { - $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInNamespace.php'); - foreach($tokenStream as $token) { - if($token instanceOf PHP_Token_NAMESPACE) { - $this->assertSame(2, $token->getEndLine()); - } - } - } - public function testGetStartLineWithScopedNamespace() - { - $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInScopedNamespace.php'); - foreach($tokenStream as $token) { - if($token instanceOf PHP_Token_NAMESPACE) { - $this->assertSame(2, $token->getLine()); - } - } - } - - public function testGetEndLineWithScopedNamespace() - { - $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInScopedNamespace.php'); - foreach($tokenStream as $token) { - if($token instanceOf PHP_Token_NAMESPACE) { - $this->assertSame(8, $token->getEndLine()); - } - } - } - -} diff --git a/vendor/phpunit/php-token-stream/tests/TokenTest.php b/vendor/phpunit/php-token-stream/tests/TokenTest.php deleted file mode 100644 index 67bf79a..0000000 --- a/vendor/phpunit/php-token-stream/tests/TokenTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the PHP_Token class. - * - * @package PHP_TokenStream - * @subpackage Tests - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @version Release: @package_version@ - * @link http://github.com/sebastianbergmann/php-token-stream/ - * @since Class available since Release 1.0.0 - */ -class PHP_TokenTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHP_Token::__construct - * @covers PHP_Token::__toString - */ - public function testToString() - { - $this->markTestIncomplete(); - } - - /** - * @covers PHP_Token::__construct - * @covers PHP_Token::getLine - */ - public function testGetLine() - { - $this->markTestIncomplete(); - } -} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/classExtendsNamespacedClass.php b/vendor/phpunit/php-token-stream/tests/_fixture/classExtendsNamespacedClass.php deleted file mode 100644 index 560eec9..0000000 --- a/vendor/phpunit/php-token-stream/tests/_fixture/classExtendsNamespacedClass.php +++ /dev/null @@ -1,10 +0,0 @@ -method_in_anonymous_class(); - } - - public function methodTwo() { - return false; - } -} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/closure.php b/vendor/phpunit/php-token-stream/tests/_fixture/closure.php deleted file mode 100644 index a0e3a81..0000000 --- a/vendor/phpunit/php-token-stream/tests/_fixture/closure.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class Extensions_PhptTestCaseTest extends \PHPUnit_Framework_TestCase -{ - public function testParseIniSection() - { - $phptTestCase = new PhpTestCaseProxy(__FILE__); - $settings = $phptTestCase->parseIniSection("foo=1\nbar = 2\rbaz = 3\r\nempty=\nignore"); - - $expected = array( - 'foo=1', - 'bar = 2', - 'baz = 3', - 'empty=', - 'ignore', - ); - - $this->assertEquals($expected, $settings); - - } -} - -class PhpTestCaseProxy extends PHPUnit_Extensions_PhptTestCase -{ - public function parseIniSection($content) - { - return parent::parseIniSection($content); - } -} diff --git a/vendor/phpunit/phpunit/tests/Extensions/RepeatedTestTest.php b/vendor/phpunit/phpunit/tests/Extensions/RepeatedTestTest.php deleted file mode 100644 index de83fb5..0000000 --- a/vendor/phpunit/phpunit/tests/Extensions/RepeatedTestTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 2.0.0 - * @covers PHPUnit_Extensions_RepeatedTest - */ -class Extensions_RepeatedTestTest extends PHPUnit_Framework_TestCase -{ - protected $suite; - - public function __construct() - { - $this->suite = new PHPUnit_Framework_TestSuite; - - $this->suite->addTest(new Success); - $this->suite->addTest(new Success); - } - - public function testRepeatedOnce() - { - $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 1); - $this->assertEquals(2, count($test)); - - $result = $test->run(); - $this->assertEquals(2, count($result)); - } - - public function testRepeatedMoreThanOnce() - { - $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 3); - $this->assertEquals(6, count($test)); - - $result = $test->run(); - $this->assertEquals(6, count($result)); - } - - public function testRepeatedZero() - { - $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 0); - $this->assertEquals(0, count($test)); - - $result = $test->run(); - $this->assertEquals(0, count($result)); - } - - public function testRepeatedNegative() - { - try { - $test = new PHPUnit_Extensions_RepeatedTest($this->suite, -1); - } catch (Exception $e) { - return; - } - - $this->fail('Should throw an Exception'); - } -} diff --git a/vendor/phpunit/phpunit/tests/Fail/fail.phpt b/vendor/phpunit/phpunit/tests/Fail/fail.phpt deleted file mode 100644 index b88454f..0000000 --- a/vendor/phpunit/phpunit/tests/Fail/fail.phpt +++ /dev/null @@ -1,5 +0,0 @@ ---TEST-- -// This test intentionally fails and it is checked by Travis. ---FILE-- ---EXPECTF-- -unexpected diff --git a/vendor/phpunit/phpunit/tests/Framework/AssertTest.php b/vendor/phpunit/phpunit/tests/Framework/AssertTest.php deleted file mode 100644 index 3406be8..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/AssertTest.php +++ /dev/null @@ -1,4130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 2.0.0 - */ -class Framework_AssertTest extends PHPUnit_Framework_TestCase -{ - /** - * @var string - */ - private $filesDirectory; - - protected function setUp() - { - $this->filesDirectory = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; - } - - /** - * @covers PHPUnit_Framework_Assert::fail - */ - public function testFail() - { - try { - $this->fail(); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - throw new PHPUnit_Framework_AssertionFailedError('Fail did not throw fail exception'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - */ - public function testAssertSplObjectStorageContainsObject() - { - $a = new stdClass; - $b = new stdClass; - $c = new SplObjectStorage; - $c->attach($a); - - $this->assertContains($a, $c); - - try { - $this->assertContains($b, $c); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - */ - public function testAssertArrayContainsObject() - { - $a = new stdClass; - $b = new stdClass; - - $this->assertContains($a, array($a)); - - try { - $this->assertContains($a, array($b)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - */ - public function testAssertArrayContainsString() - { - $this->assertContains('foo', array('foo')); - - try { - $this->assertContains('foo', array('bar')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - */ - public function testAssertArrayContainsNonObject() - { - $this->assertContains('foo', array(true)); - - try { - $this->assertContains('foo', array(true), '', false, true, true); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf - */ - public function testAssertContainsOnlyInstancesOf() - { - $test = array( - new Book(), - new Book - ); - $this->assertContainsOnlyInstancesOf('Book', $test); - $this->assertContainsOnlyInstancesOf('stdClass', array(new stdClass())); - - $test2 = array( - new Author('Test') - ); - try { - $this->assertContainsOnlyInstancesOf('Book', $test2); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertArrayHasKeyThrowsExceptionForInvalidFirstArgument() - { - $this->assertArrayHasKey(null, array()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertArrayHasKeyThrowsExceptionForInvalidSecondArgument() - { - $this->assertArrayHasKey(0, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - */ - public function testAssertArrayHasIntegerKey() - { - $this->assertArrayHasKey(0, array('foo')); - - try { - $this->assertArrayHasKey(1, array('foo')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArraySubset - * @covers PHPUnit_Framework_Constraint_ArraySubset - */ - public function testAssertArraySubset() - { - $array = array( - 'a' => 'item a', - 'b' => 'item b', - 'c' => array('a2' => 'item a2', 'b2' => 'item b2'), - 'd' => array('a2' => array('a3' => 'item a3', 'b3' => 'item b3')) - ); - - $this->assertArraySubset(array('a' => 'item a', 'c' => array('a2' => 'item a2')), $array); - $this->assertArraySubset(array('a' => 'item a', 'd' => array('a2' => array('b3' => 'item b3'))), $array); - - try { - $this->assertArraySubset(array('a' => 'bad value'), $array); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - } - - try { - $this->assertArraySubset(array('d' => array('a2' => array('bad index' => 'item b3'))), $array); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArraySubset - * @covers PHPUnit_Framework_Constraint_ArraySubset - */ - public function testAssertArraySubsetWithDeepNestedArrays() - { - $array = array( - 'path' => array( - 'to' => array( - 'the' => array( - 'cake' => 'is a lie' - ) - ) - ) - ); - - $this->assertArraySubset(array('path' => array()), $array); - $this->assertArraySubset(array('path' => array('to' => array())), $array); - $this->assertArraySubset(array('path' => array('to' => array('the' => array()))), $array); - $this->assertArraySubset(array('path' => array('to' => array('the' => array('cake' => 'is a lie')))), $array); - - try { - $this->assertArraySubset(array('path' => array('to' => array('the' => array('cake' => 'is not a lie')))), $array); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArraySubset - * @covers PHPUnit_Framework_Constraint_ArraySubset - */ - public function testAssertArraySubsetWithNoStrictCheckAndObjects() - { - $obj = new \stdClass; - $reference = &$obj; - $array = array('a' => $obj); - - $this->assertArraySubset(array('a' => $reference), $array); - $this->assertArraySubset(array('a' => new \stdClass), $array); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArraySubset - * @covers PHPUnit_Framework_Constraint_ArraySubset - */ - public function testAssertArraySubsetWithStrictCheckAndObjects() - { - $obj = new \stdClass; - $reference = &$obj; - $array = array('a' => $obj); - - $this->assertArraySubset(array('a' => $reference), $array, true); - - try { - $this->assertArraySubset(array('a' => new \stdClass), $array, true); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail('Strict recursive array check fail.'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArraySubset - * @covers PHPUnit_Framework_Constraint_ArraySubset - * @expectedException PHPUnit_Framework_Exception - * @expectedExceptionMessage array or ArrayAccess - * @dataProvider assertArraySubsetInvalidArgumentProvider - */ - public function testAssertArraySubsetRaisesExceptionForInvalidArguments($partial, $subject) - { - $this->assertArraySubset($partial, $subject); - } - - /** - * @return array - */ - public function assertArraySubsetInvalidArgumentProvider() - { - return array( - array(false, array()), - array(array(), false), - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertArrayNotHasKeyThrowsExceptionForInvalidFirstArgument() - { - $this->assertArrayNotHasKey(null, array()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertArrayNotHasKeyThrowsExceptionForInvalidSecondArgument() - { - $this->assertArrayNotHasKey(0, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey - */ - public function testAssertArrayNotHasIntegerKey() - { - $this->assertArrayNotHasKey(1, array('foo')); - - try { - $this->assertArrayNotHasKey(0, array('foo')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - */ - public function testAssertArrayHasStringKey() - { - $this->assertArrayHasKey('foo', array('foo' => 'bar')); - - try { - $this->assertArrayHasKey('bar', array('foo' => 'bar')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey - */ - public function testAssertArrayNotHasStringKey() - { - $this->assertArrayNotHasKey('bar', array('foo' => 'bar')); - - try { - $this->assertArrayNotHasKey('foo', array('foo' => 'bar')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - */ - public function testAssertArrayHasKeyAcceptsArrayObjectValue() - { - $array = new ArrayObject(); - $array['foo'] = 'bar'; - $this->assertArrayHasKey('foo', $array); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertArrayHasKeyProperlyFailsWithArrayObjectValue() - { - $array = new ArrayObject(); - $array['bar'] = 'bar'; - $this->assertArrayHasKey('foo', $array); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - */ - public function testAssertArrayHasKeyAcceptsArrayAccessValue() - { - $array = new SampleArrayAccess(); - $array['foo'] = 'bar'; - $this->assertArrayHasKey('foo', $array); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayHasKey - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertArrayHasKeyProperlyFailsWithArrayAccessValue() - { - $array = new SampleArrayAccess(); - $array['bar'] = 'bar'; - $this->assertArrayHasKey('foo', $array); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey - */ - public function testAssertArrayNotHasKeyAcceptsArrayAccessValue() - { - $array = new ArrayObject(); - $array['foo'] = 'bar'; - $this->assertArrayNotHasKey('bar', $array); - } - - /** - * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertArrayNotHasKeyPropertlyFailsWithArrayAccessValue() - { - $array = new ArrayObject(); - $array['bar'] = 'bar'; - $this->assertArrayNotHasKey('bar', $array); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertContainsThrowsException() - { - $this->assertContains(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - */ - public function testAssertIteratorContainsObject() - { - $foo = new stdClass; - - $this->assertContains($foo, new TestIterator(array($foo))); - - try { - $this->assertContains($foo, new TestIterator(array(new stdClass))); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - */ - public function testAssertIteratorContainsString() - { - $this->assertContains('foo', new TestIterator(array('foo'))); - - try { - $this->assertContains('foo', new TestIterator(array('bar'))); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContains - */ - public function testAssertStringContainsString() - { - $this->assertContains('foo', 'foobar'); - - try { - $this->assertContains('foo', 'bar'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContains - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotContainsThrowsException() - { - $this->assertNotContains(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContains - */ - public function testAssertSplObjectStorageNotContainsObject() - { - $a = new stdClass; - $b = new stdClass; - $c = new SplObjectStorage; - $c->attach($a); - - $this->assertNotContains($b, $c); - - try { - $this->assertNotContains($a, $c); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContains - */ - public function testAssertArrayNotContainsObject() - { - $a = new stdClass; - $b = new stdClass; - - $this->assertNotContains($a, array($b)); - - try { - $this->assertNotContains($a, array($a)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContains - */ - public function testAssertArrayNotContainsString() - { - $this->assertNotContains('foo', array('bar')); - - try { - $this->assertNotContains('foo', array('foo')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContains - */ - public function testAssertArrayNotContainsNonObject() - { - $this->assertNotContains('foo', array(true), '', false, true, true); - - try { - $this->assertNotContains('foo', array(true)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContains - */ - public function testAssertStringNotContainsString() - { - $this->assertNotContains('foo', 'bar'); - - try { - $this->assertNotContains('foo', 'foo'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContainsOnly - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertContainsOnlyThrowsException() - { - $this->assertContainsOnly(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContainsOnly - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotContainsOnlyThrowsException() - { - $this->assertNotContainsOnly(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertContainsOnlyInstancesOfThrowsException() - { - $this->assertContainsOnlyInstancesOf(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContainsOnly - */ - public function testAssertArrayContainsOnlyIntegers() - { - $this->assertContainsOnly('integer', array(1, 2, 3)); - - try { - $this->assertContainsOnly('integer', array('1', 2, 3)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContainsOnly - */ - public function testAssertArrayNotContainsOnlyIntegers() - { - $this->assertNotContainsOnly('integer', array('1', 2, 3)); - - try { - $this->assertNotContainsOnly('integer', array(1, 2, 3)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertContainsOnly - */ - public function testAssertArrayContainsOnlyStdClass() - { - $this->assertContainsOnly('StdClass', array(new stdClass)); - - try { - $this->assertContainsOnly('StdClass', array('StdClass')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotContainsOnly - */ - public function testAssertArrayNotContainsOnlyStdClass() - { - $this->assertNotContainsOnly('StdClass', array('StdClass')); - - try { - $this->assertNotContainsOnly('StdClass', array(new stdClass)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - protected function sameValues() - { - $object = new SampleClass(4, 8, 15); - // cannot use $filesDirectory, because neither setUp() nor - // setUpBeforeClass() are executed before the data providers - $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'foo.xml'; - $resource = fopen($file, 'r'); - - return array( - // null - array(null, null), - // strings - array('a', 'a'), - // integers - array(0, 0), - // floats - array(2.3, 2.3), - array(1/3, 1 - 2/3), - array(log(0), log(0)), - // arrays - array(array(), array()), - array(array(0 => 1), array(0 => 1)), - array(array(0 => null), array(0 => null)), - array(array('a', 'b' => array(1, 2)), array('a', 'b' => array(1, 2))), - // objects - array($object, $object), - // resources - array($resource, $resource), - ); - } - - protected function notEqualValues() - { - // cyclic dependencies - $book1 = new Book; - $book1->author = new Author('Terry Pratchett'); - $book1->author->books[] = $book1; - $book2 = new Book; - $book2->author = new Author('Terry Pratch'); - $book2->author->books[] = $book2; - - $book3 = new Book; - $book3->author = 'Terry Pratchett'; - $book4 = new stdClass; - $book4->author = 'Terry Pratchett'; - - $object1 = new SampleClass(4, 8, 15); - $object2 = new SampleClass(16, 23, 42); - $object3 = new SampleClass(4, 8, 15); - $storage1 = new SplObjectStorage; - $storage1->attach($object1); - $storage2 = new SplObjectStorage; - $storage2->attach($object3); // same content, different object - - // cannot use $filesDirectory, because neither setUp() nor - // setUpBeforeClass() are executed before the data providers - $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'foo.xml'; - - return array( - // strings - array('a', 'b'), - array('a', 'A'), - // https://github.com/sebastianbergmann/phpunit/issues/1023 - array('9E6666666','9E7777777'), - // integers - array(1, 2), - array(2, 1), - // floats - array(2.3, 4.2), - array(2.3, 4.2, 0.5), - array(array(2.3), array(4.2), 0.5), - array(array(array(2.3)), array(array(4.2)), 0.5), - array(new Struct(2.3), new Struct(4.2), 0.5), - array(array(new Struct(2.3)), array(new Struct(4.2)), 0.5), - // NAN - array(NAN, NAN), - // arrays - array(array(), array(0 => 1)), - array(array(0 => 1), array()), - array(array(0 => null), array()), - array(array(0 => 1, 1 => 2), array(0 => 1, 1 => 3)), - array(array('a', 'b' => array(1, 2)), array('a', 'b' => array(2, 1))), - // objects - array(new SampleClass(4, 8, 15), new SampleClass(16, 23, 42)), - array($object1, $object2), - array($book1, $book2), - array($book3, $book4), // same content, different class - // resources - array(fopen($file, 'r'), fopen($file, 'r')), - // SplObjectStorage - array($storage1, $storage2), - // DOMDocument - array( - PHPUnit_Util_XML::load(''), - PHPUnit_Util_XML::load(''), - ), - array( - PHPUnit_Util_XML::load(''), - PHPUnit_Util_XML::load(''), - ), - array( - PHPUnit_Util_XML::load(' bar '), - PHPUnit_Util_XML::load(''), - ), - array( - PHPUnit_Util_XML::load(''), - PHPUnit_Util_XML::load(''), - ), - array( - PHPUnit_Util_XML::load(' bar '), - PHPUnit_Util_XML::load(' bir '), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')), - 3500 - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 05:13:35', new DateTimeZone('America/New_York')), - 3500 - ), - array( - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - ), - array( - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - 43200 - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')), - 3500 - ), - array( - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/Chicago')), - ), - array( - new DateTime('2013-03-29T05:13:35-0600'), - new DateTime('2013-03-29T04:13:35-0600'), - ), - array( - new DateTime('2013-03-29T05:13:35-0600'), - new DateTime('2013-03-29T05:13:35-0500'), - ), - // Exception - //array(new Exception('Exception 1'), new Exception('Exception 2')), - // different types - array(new SampleClass(4, 8, 15), false), - array(false, new SampleClass(4, 8, 15)), - array(array(0 => 1, 1 => 2), false), - array(false, array(0 => 1, 1 => 2)), - array(array(), new stdClass), - array(new stdClass, array()), - // PHP: 0 == 'Foobar' => true! - // We want these values to differ - array(0, 'Foobar'), - array('Foobar', 0), - array(3, acos(8)), - array(acos(8), 3) - ); - } - - protected function equalValues() - { - // cyclic dependencies - $book1 = new Book; - $book1->author = new Author('Terry Pratchett'); - $book1->author->books[] = $book1; - $book2 = new Book; - $book2->author = new Author('Terry Pratchett'); - $book2->author->books[] = $book2; - - $object1 = new SampleClass(4, 8, 15); - $object2 = new SampleClass(4, 8, 15); - $storage1 = new SplObjectStorage; - $storage1->attach($object1); - $storage2 = new SplObjectStorage; - $storage2->attach($object1); - - return array( - // strings - array('a', 'A', 0, false, true), // ignore case - // arrays - array(array('a' => 1, 'b' => 2), array('b' => 2, 'a' => 1)), - array(array(1), array('1')), - array(array(3, 2, 1), array(2, 3, 1), 0, true), // canonicalized comparison - // floats - array(2.3, 2.5, 0.5), - array(array(2.3), array(2.5), 0.5), - array(array(array(2.3)), array(array(2.5)), 0.5), - array(new Struct(2.3), new Struct(2.5), 0.5), - array(array(new Struct(2.3)), array(new Struct(2.5)), 0.5), - // numeric with delta - array(1, 2, 1), - // objects - array($object1, $object2), - array($book1, $book2), - // SplObjectStorage - array($storage1, $storage2), - // DOMDocument - array( - PHPUnit_Util_XML::load(''), - PHPUnit_Util_XML::load(''), - ), - array( - PHPUnit_Util_XML::load(''), - PHPUnit_Util_XML::load(''), - ), - array( - PHPUnit_Util_XML::load(''), - PHPUnit_Util_XML::load(''), - ), - array( - PHPUnit_Util_XML::load("\n \n"), - PHPUnit_Util_XML::load(''), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:25', new DateTimeZone('America/New_York')), - 10 - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:14:40', new DateTimeZone('America/New_York')), - 65 - ), - array( - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/Chicago')), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:49', new DateTimeZone('America/Chicago')), - 15 - ), - array( - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 23:00:00', new DateTimeZone('America/Chicago')), - ), - array( - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 23:01:30', new DateTimeZone('America/Chicago')), - 100 - ), - array( - new DateTime('@1364616000'), - new DateTime('2013-03-29 23:00:00', new DateTimeZone('America/Chicago')), - ), - array( - new DateTime('2013-03-29T05:13:35-0500'), - new DateTime('2013-03-29T04:13:35-0600'), - ), - // Exception - //array(new Exception('Exception 1'), new Exception('Exception 1')), - // mixed types - array(0, '0'), - array('0', 0), - array(2.3, '2.3'), - array('2.3', 2.3), - array((string) (1/3), 1 - 2/3), - array(1/3, (string) (1 - 2/3)), - array('string representation', new ClassWithToString), - array(new ClassWithToString, 'string representation'), - ); - } - - public function equalProvider() - { - // same |= equal - return array_merge($this->equalValues(), $this->sameValues()); - } - - public function notEqualProvider() - { - return $this->notEqualValues(); - } - - public function sameProvider() - { - return $this->sameValues(); - } - - public function notSameProvider() - { - // not equal |= not same - // equal, ¬same |= not same - return array_merge($this->notEqualValues(), $this->equalValues()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEquals - * @dataProvider equalProvider - */ - public function testAssertEqualsSucceeds($a, $b, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - $this->assertEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEquals - * @dataProvider notEqualProvider - */ - public function testAssertEqualsFails($a, $b, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - try { - $this->assertEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotEquals - * @dataProvider notEqualProvider - */ - public function testAssertNotEqualsSucceeds($a, $b, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - $this->assertNotEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotEquals - * @dataProvider equalProvider - */ - public function testAssertNotEqualsFails($a, $b, $delta = 0.0, $canonicalize = false, $ignoreCase = false) - { - try { - $this->assertNotEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertSame - * @dataProvider sameProvider - */ - public function testAssertSameSucceeds($a, $b) - { - $this->assertSame($a, $b); - } - - /** - * @covers PHPUnit_Framework_Assert::assertSame - * @dataProvider notSameProvider - */ - public function testAssertSameFails($a, $b) - { - try { - $this->assertSame($a, $b); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSame - * @dataProvider notSameProvider - */ - public function testAssertNotSameSucceeds($a, $b) - { - $this->assertNotSame($a, $b); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSame - * @dataProvider sameProvider - */ - public function testAssertNotSameFails($a, $b) - { - try { - $this->assertNotSame($a, $b); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile - */ - public function testAssertXmlFileEqualsXmlFile() - { - $this->assertXmlFileEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'foo.xml' - ); - - try { - $this->assertXmlFileEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'bar.xml' - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile - */ - public function testAssertXmlFileNotEqualsXmlFile() - { - $this->assertXmlFileNotEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'bar.xml' - ); - - try { - $this->assertXmlFileNotEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'foo.xml' - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile - */ - public function testAssertXmlStringEqualsXmlFile() - { - $this->assertXmlStringEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'foo.xml') - ); - - try { - $this->assertXmlStringEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'bar.xml') - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile - */ - public function testXmlStringNotEqualsXmlFile() - { - $this->assertXmlStringNotEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'bar.xml') - ); - - try { - $this->assertXmlStringNotEqualsXmlFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'foo.xml') - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString - */ - public function testAssertXmlStringEqualsXmlString() - { - $this->assertXmlStringEqualsXmlString('', ''); - - try { - $this->assertXmlStringEqualsXmlString('', ''); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @expectedException PHPUnit_Framework_Exception - * @covers PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString - * @ticket 1860 - */ - public function testAssertXmlStringEqualsXmlString2() - { - $this->assertXmlStringEqualsXmlString('', ''); - } - - /** - * @covers PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString - * @ticket 1860 - */ - public function testAssertXmlStringEqualsXmlString3() - { - $expected = << - - - -XML; - - $actual = << - - - -XML; - - $this->assertXmlStringEqualsXmlString($expected, $actual); - } - - /** - * @covers PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString - */ - public function testAssertXmlStringNotEqualsXmlString() - { - $this->assertXmlStringNotEqualsXmlString('', ''); - - try { - $this->assertXmlStringNotEqualsXmlString('', ''); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure - */ - public function testXMLStructureIsSame() - { - $expected = new DOMDocument; - $expected->load($this->filesDirectory . 'structureExpected.xml'); - - $actual = new DOMDocument; - $actual->load($this->filesDirectory . 'structureExpected.xml'); - - $this->assertEqualXMLStructure( - $expected->firstChild, $actual->firstChild, true - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure - * @expectedException PHPUnit_Framework_ExpectationFailedException - */ - public function testXMLStructureWrongNumberOfAttributes() - { - $expected = new DOMDocument; - $expected->load($this->filesDirectory . 'structureExpected.xml'); - - $actual = new DOMDocument; - $actual->load($this->filesDirectory . 'structureWrongNumberOfAttributes.xml'); - - $this->assertEqualXMLStructure( - $expected->firstChild, $actual->firstChild, true - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure - * @expectedException PHPUnit_Framework_ExpectationFailedException - */ - public function testXMLStructureWrongNumberOfNodes() - { - $expected = new DOMDocument; - $expected->load($this->filesDirectory . 'structureExpected.xml'); - - $actual = new DOMDocument; - $actual->load($this->filesDirectory . 'structureWrongNumberOfNodes.xml'); - - $this->assertEqualXMLStructure( - $expected->firstChild, $actual->firstChild, true - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure - */ - public function testXMLStructureIsSameButDataIsNot() - { - $expected = new DOMDocument; - $expected->load($this->filesDirectory . 'structureExpected.xml'); - - $actual = new DOMDocument; - $actual->load($this->filesDirectory . 'structureIsSameButDataIsNot.xml'); - - $this->assertEqualXMLStructure( - $expected->firstChild, $actual->firstChild, true - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure - */ - public function testXMLStructureAttributesAreSameButValuesAreNot() - { - $expected = new DOMDocument; - $expected->load($this->filesDirectory . 'structureExpected.xml'); - - $actual = new DOMDocument; - $actual->load($this->filesDirectory . 'structureAttributesAreSameButValuesAreNot.xml'); - - $this->assertEqualXMLStructure( - $expected->firstChild, $actual->firstChild, true - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure - */ - public function testXMLStructureIgnoreTextNodes() - { - $expected = new DOMDocument; - $expected->load($this->filesDirectory . 'structureExpected.xml'); - - $actual = new DOMDocument; - $actual->load($this->filesDirectory . 'structureIgnoreTextNodes.xml'); - - $this->assertEqualXMLStructure( - $expected->firstChild, $actual->firstChild, true - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEquals - */ - public function testAssertStringEqualsNumeric() - { - $this->assertEquals('0', 0); - - try { - $this->assertEquals('0', 1); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotEquals - */ - public function testAssertStringEqualsNumeric2() - { - $this->assertNotEquals('A', 0); - } - - /** - * @covers PHPUnit_Framework_Assert::assertFileExists - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertFileExistsThrowsException() - { - $this->assertFileExists(null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertFileExists - */ - public function testAssertFileExists() - { - $this->assertFileExists(__FILE__); - - try { - $this->assertFileExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertFileNotExists - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertFileNotExistsThrowsException() - { - $this->assertFileNotExists(null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertFileNotExists - */ - public function testAssertFileNotExists() - { - $this->assertFileNotExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); - - try { - $this->assertFileNotExists(__FILE__); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - */ - public function testAssertObjectHasAttribute() - { - $o = new Author('Terry Pratchett'); - - $this->assertObjectHasAttribute('name', $o); - - try { - $this->assertObjectHasAttribute('foo', $o); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - */ - public function testAssertObjectNotHasAttribute() - { - $o = new Author('Terry Pratchett'); - - $this->assertObjectNotHasAttribute('foo', $o); - - try { - $this->assertObjectNotHasAttribute('name', $o); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNull - */ - public function testAssertNull() - { - $this->assertNull(null); - - try { - $this->assertNull(new stdClass); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotNull - */ - public function testAssertNotNull() - { - $this->assertNotNull(new stdClass); - - try { - $this->assertNotNull(null); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertTrue - */ - public function testAssertTrue() - { - $this->assertTrue(true); - - try { - $this->assertTrue(false); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotTrue - */ - public function testAssertNotTrue() - { - $this->assertNotTrue(false); - $this->assertNotTrue(1); - $this->assertNotTrue('true'); - - try { - $this->assertNotTrue(true); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertFalse - */ - public function testAssertFalse() - { - $this->assertFalse(false); - - try { - $this->assertFalse(true); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotFalse - */ - public function testAssertNotFalse() - { - $this->assertNotFalse(true); - $this->assertNotFalse(0); - $this->assertNotFalse(''); - - try { - $this->assertNotFalse(false); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertRegExp - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertRegExpThrowsException() - { - $this->assertRegExp(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertRegExp - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertRegExpThrowsException2() - { - $this->assertRegExp('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotRegExp - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotRegExpThrowsException() - { - $this->assertNotRegExp(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotRegExp - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotRegExpThrowsException2() - { - $this->assertNotRegExp('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertRegExp - */ - public function testAssertRegExp() - { - $this->assertRegExp('/foo/', 'foobar'); - - try { - $this->assertRegExp('/foo/', 'bar'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotRegExp - */ - public function testAssertNotRegExp() - { - $this->assertNotRegExp('/foo/', 'bar'); - - try { - $this->assertNotRegExp('/foo/', 'foobar'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertSame - */ - public function testAssertSame() - { - $o = new stdClass; - - $this->assertSame($o, $o); - - try { - $this->assertSame( - new stdClass, - new stdClass - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertSame - */ - public function testAssertSame2() - { - $this->assertSame(true, true); - $this->assertSame(false, false); - - try { - $this->assertSame(true, false); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSame - */ - public function testAssertNotSame() - { - $this->assertNotSame( - new stdClass, - null - ); - - $this->assertNotSame( - null, - new stdClass - ); - - $this->assertNotSame( - new stdClass, - new stdClass - ); - - $o = new stdClass; - - try { - $this->assertNotSame($o, $o); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSame - */ - public function testAssertNotSame2() - { - $this->assertNotSame(true, false); - $this->assertNotSame(false, true); - - try { - $this->assertNotSame(true, true); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSame - */ - public function testAssertNotSameFailsNull() - { - try { - $this->assertNotSame(null, null); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertGreaterThan - */ - public function testGreaterThan() - { - $this->assertGreaterThan(1, 2); - - try { - $this->assertGreaterThan(2, 1); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeGreaterThan - */ - public function testAttributeGreaterThan() - { - $this->assertAttributeGreaterThan( - 1, 'bar', new ClassWithNonPublicAttributes - ); - - try { - $this->assertAttributeGreaterThan( - 1, 'foo', new ClassWithNonPublicAttributes - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertGreaterThanOrEqual - */ - public function testGreaterThanOrEqual() - { - $this->assertGreaterThanOrEqual(1, 2); - - try { - $this->assertGreaterThanOrEqual(2, 1); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeGreaterThanOrEqual - */ - public function testAttributeGreaterThanOrEqual() - { - $this->assertAttributeGreaterThanOrEqual( - 1, 'bar', new ClassWithNonPublicAttributes - ); - - try { - $this->assertAttributeGreaterThanOrEqual( - 2, 'foo', new ClassWithNonPublicAttributes - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertLessThan - */ - public function testLessThan() - { - $this->assertLessThan(2, 1); - - try { - $this->assertLessThan(1, 2); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeLessThan - */ - public function testAttributeLessThan() - { - $this->assertAttributeLessThan( - 2, 'foo', new ClassWithNonPublicAttributes - ); - - try { - $this->assertAttributeLessThan( - 1, 'bar', new ClassWithNonPublicAttributes - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertLessThanOrEqual - */ - public function testLessThanOrEqual() - { - $this->assertLessThanOrEqual(2, 1); - - try { - $this->assertLessThanOrEqual(1, 2); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeLessThanOrEqual - */ - public function testAttributeLessThanOrEqual() - { - $this->assertAttributeLessThanOrEqual( - 2, 'foo', new ClassWithNonPublicAttributes - ); - - try { - $this->assertAttributeLessThanOrEqual( - 1, 'bar', new ClassWithNonPublicAttributes - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::readAttribute - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @covers PHPUnit_Framework_Assert::getObjectAttribute - */ - public function testReadAttribute() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertEquals('foo', $this->readAttribute($obj, 'publicAttribute')); - $this->assertEquals('bar', $this->readAttribute($obj, 'protectedAttribute')); - $this->assertEquals('baz', $this->readAttribute($obj, 'privateAttribute')); - $this->assertEquals('bar', $this->readAttribute($obj, 'protectedParentAttribute')); - //$this->assertEquals('bar', $this->readAttribute($obj, 'privateParentAttribute')); - } - - /** - * @covers PHPUnit_Framework_Assert::readAttribute - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @covers PHPUnit_Framework_Assert::getObjectAttribute - */ - public function testReadAttribute2() - { - $this->assertEquals('foo', $this->readAttribute('ClassWithNonPublicAttributes', 'publicStaticAttribute')); - $this->assertEquals('bar', $this->readAttribute('ClassWithNonPublicAttributes', 'protectedStaticAttribute')); - $this->assertEquals('baz', $this->readAttribute('ClassWithNonPublicAttributes', 'privateStaticAttribute')); - $this->assertEquals('foo', $this->readAttribute('ClassWithNonPublicAttributes', 'protectedStaticParentAttribute')); - $this->assertEquals('foo', $this->readAttribute('ClassWithNonPublicAttributes', 'privateStaticParentAttribute')); - } - - /** - * @covers PHPUnit_Framework_Assert::readAttribute - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testReadAttribute3() - { - $this->readAttribute('StdClass', null); - } - - /** - * @covers PHPUnit_Framework_Assert::readAttribute - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testReadAttribute4() - { - $this->readAttribute('NotExistingClass', 'foo'); - } - - /** - * @covers PHPUnit_Framework_Assert::readAttribute - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testReadAttribute5() - { - $this->readAttribute(null, 'foo'); - } - - /** - * @covers PHPUnit_Framework_Assert::readAttribute - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testReadAttributeIfAttributeNameIsNotValid() - { - $this->readAttribute('StdClass', '2'); - } - - /** - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetStaticAttributeRaisesExceptionForInvalidFirstArgument() - { - $this->getStaticAttribute(null, 'foo'); - } - - /** - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetStaticAttributeRaisesExceptionForInvalidFirstArgument2() - { - $this->getStaticAttribute('NotExistingClass', 'foo'); - } - - /** - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetStaticAttributeRaisesExceptionForInvalidSecondArgument() - { - $this->getStaticAttribute('stdClass', null); - } - - /** - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetStaticAttributeRaisesExceptionForInvalidSecondArgument2() - { - $this->getStaticAttribute('stdClass', '0'); - } - - /** - * @covers PHPUnit_Framework_Assert::getStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetStaticAttributeRaisesExceptionForInvalidSecondArgument3() - { - $this->getStaticAttribute('stdClass', 'foo'); - } - - /** - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetObjectAttributeRaisesExceptionForInvalidFirstArgument() - { - $this->getObjectAttribute(null, 'foo'); - } - - /** - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetObjectAttributeRaisesExceptionForInvalidSecondArgument() - { - $this->getObjectAttribute(new stdClass, null); - } - - /** - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetObjectAttributeRaisesExceptionForInvalidSecondArgument2() - { - $this->getObjectAttribute(new stdClass, '0'); - } - - /** - * @covers PHPUnit_Framework_Assert::getObjectAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testGetObjectAttributeRaisesExceptionForInvalidSecondArgument3() - { - $this->getObjectAttribute(new stdClass, 'foo'); - } - - /** - * @covers PHPUnit_Framework_Assert::getObjectAttribute - */ - public function testGetObjectAttributeWorksForInheritedAttributes() - { - $this->assertEquals( - 'bar', - $this->getObjectAttribute(new ClassWithNonPublicAttributes, 'privateParentAttribute') - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeContains - */ - public function testAssertPublicAttributeContains() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeContains('foo', 'publicArray', $obj); - - try { - $this->assertAttributeContains('bar', 'publicArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeContainsOnly - */ - public function testAssertPublicAttributeContainsOnly() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeContainsOnly('string', 'publicArray', $obj); - - try { - $this->assertAttributeContainsOnly('integer', 'publicArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotContains - */ - public function testAssertPublicAttributeNotContains() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotContains('bar', 'publicArray', $obj); - - try { - $this->assertAttributeNotContains('foo', 'publicArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotContainsOnly - */ - public function testAssertPublicAttributeNotContainsOnly() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotContainsOnly('integer', 'publicArray', $obj); - - try { - $this->assertAttributeNotContainsOnly('string', 'publicArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeContains - */ - public function testAssertProtectedAttributeContains() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeContains('bar', 'protectedArray', $obj); - - try { - $this->assertAttributeContains('foo', 'protectedArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotContains - */ - public function testAssertProtectedAttributeNotContains() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotContains('foo', 'protectedArray', $obj); - - try { - $this->assertAttributeNotContains('bar', 'protectedArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeContains - */ - public function testAssertPrivateAttributeContains() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeContains('baz', 'privateArray', $obj); - - try { - $this->assertAttributeContains('foo', 'privateArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotContains - */ - public function testAssertPrivateAttributeNotContains() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotContains('foo', 'privateArray', $obj); - - try { - $this->assertAttributeNotContains('baz', 'privateArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeContains - */ - public function testAssertAttributeContainsNonObject() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeContains(true, 'privateArray', $obj); - - try { - $this->assertAttributeContains(true, 'privateArray', $obj, '', false, true, true); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotContains - */ - public function testAssertAttributeNotContainsNonObject() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotContains(true, 'privateArray', $obj, '', false, true, true); - - try { - $this->assertAttributeNotContains(true, 'privateArray', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeEquals - */ - public function testAssertPublicAttributeEquals() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeEquals('foo', 'publicAttribute', $obj); - - try { - $this->assertAttributeEquals('bar', 'publicAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals - */ - public function testAssertPublicAttributeNotEquals() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotEquals('bar', 'publicAttribute', $obj); - - try { - $this->assertAttributeNotEquals('foo', 'publicAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeSame - */ - public function testAssertPublicAttributeSame() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeSame('foo', 'publicAttribute', $obj); - - try { - $this->assertAttributeSame('bar', 'publicAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotSame - */ - public function testAssertPublicAttributeNotSame() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotSame('bar', 'publicAttribute', $obj); - - try { - $this->assertAttributeNotSame('foo', 'publicAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeEquals - */ - public function testAssertProtectedAttributeEquals() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeEquals('bar', 'protectedAttribute', $obj); - - try { - $this->assertAttributeEquals('foo', 'protectedAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals - */ - public function testAssertProtectedAttributeNotEquals() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotEquals('foo', 'protectedAttribute', $obj); - - try { - $this->assertAttributeNotEquals('bar', 'protectedAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeEquals - */ - public function testAssertPrivateAttributeEquals() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeEquals('baz', 'privateAttribute', $obj); - - try { - $this->assertAttributeEquals('foo', 'privateAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals - */ - public function testAssertPrivateAttributeNotEquals() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertAttributeNotEquals('foo', 'privateAttribute', $obj); - - try { - $this->assertAttributeNotEquals('baz', 'privateAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeEquals - */ - public function testAssertPublicStaticAttributeEquals() - { - $this->assertAttributeEquals('foo', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertAttributeEquals('bar', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals - */ - public function testAssertPublicStaticAttributeNotEquals() - { - $this->assertAttributeNotEquals('bar', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertAttributeNotEquals('foo', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeEquals - */ - public function testAssertProtectedStaticAttributeEquals() - { - $this->assertAttributeEquals('bar', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertAttributeEquals('foo', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals - */ - public function testAssertProtectedStaticAttributeNotEquals() - { - $this->assertAttributeNotEquals('foo', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertAttributeNotEquals('bar', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeEquals - */ - public function testAssertPrivateStaticAttributeEquals() - { - $this->assertAttributeEquals('baz', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertAttributeEquals('foo', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals - */ - public function testAssertPrivateStaticAttributeNotEquals() - { - $this->assertAttributeNotEquals('foo', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertAttributeNotEquals('baz', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassHasAttributeThrowsException() - { - $this->assertClassHasAttribute(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassHasAttributeThrowsException2() - { - $this->assertClassHasAttribute('foo', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassHasAttributeThrowsExceptionIfAttributeNameIsNotValid() - { - $this->assertClassHasAttribute('1', 'ClassWithNonPublicAttributes'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassNotHasAttributeThrowsException() - { - $this->assertClassNotHasAttribute(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassNotHasAttributeThrowsException2() - { - $this->assertClassNotHasAttribute('foo', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassNotHasAttributeThrowsExceptionIfAttributeNameIsNotValid() - { - $this->assertClassNotHasAttribute('1', 'ClassWithNonPublicAttributes'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassHasStaticAttributeThrowsException() - { - $this->assertClassHasStaticAttribute(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassHasStaticAttributeThrowsException2() - { - $this->assertClassHasStaticAttribute('foo', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid() - { - $this->assertClassHasStaticAttribute('1', 'ClassWithNonPublicAttributes'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassNotHasStaticAttributeThrowsException() - { - $this->assertClassNotHasStaticAttribute(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassNotHasStaticAttributeThrowsException2() - { - $this->assertClassNotHasStaticAttribute('foo', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertClassNotHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid() - { - $this->assertClassNotHasStaticAttribute('1', 'ClassWithNonPublicAttributes'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertObjectHasAttributeThrowsException() - { - $this->assertObjectHasAttribute(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertObjectHasAttributeThrowsException2() - { - $this->assertObjectHasAttribute('foo', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertObjectHasAttributeThrowsExceptionIfAttributeNameIsNotValid() - { - $this->assertObjectHasAttribute('1', 'ClassWithNonPublicAttributes'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertObjectNotHasAttributeThrowsException() - { - $this->assertObjectNotHasAttribute(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertObjectNotHasAttributeThrowsException2() - { - $this->assertObjectNotHasAttribute('foo', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertObjectNotHasAttributeThrowsExceptionIfAttributeNameIsNotValid() - { - $this->assertObjectNotHasAttribute('1', 'ClassWithNonPublicAttributes'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasAttribute - */ - public function testClassHasPublicAttribute() - { - $this->assertClassHasAttribute('publicAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertClassHasAttribute('attribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute - */ - public function testClassNotHasPublicAttribute() - { - $this->assertClassNotHasAttribute('attribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertClassNotHasAttribute('publicAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute - */ - public function testClassHasPublicStaticAttribute() - { - $this->assertClassHasStaticAttribute('publicStaticAttribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertClassHasStaticAttribute('attribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute - */ - public function testClassNotHasPublicStaticAttribute() - { - $this->assertClassNotHasStaticAttribute('attribute', 'ClassWithNonPublicAttributes'); - - try { - $this->assertClassNotHasStaticAttribute('publicStaticAttribute', 'ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - */ - public function testObjectHasPublicAttribute() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertObjectHasAttribute('publicAttribute', $obj); - - try { - $this->assertObjectHasAttribute('attribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - */ - public function testObjectNotHasPublicAttribute() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertObjectNotHasAttribute('attribute', $obj); - - try { - $this->assertObjectNotHasAttribute('publicAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - */ - public function testObjectHasOnTheFlyAttribute() - { - $obj = new stdClass; - $obj->foo = 'bar'; - - $this->assertObjectHasAttribute('foo', $obj); - - try { - $this->assertObjectHasAttribute('bar', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - */ - public function testObjectNotHasOnTheFlyAttribute() - { - $obj = new stdClass; - $obj->foo = 'bar'; - - $this->assertObjectNotHasAttribute('bar', $obj); - - try { - $this->assertObjectNotHasAttribute('foo', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - */ - public function testObjectHasProtectedAttribute() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertObjectHasAttribute('protectedAttribute', $obj); - - try { - $this->assertObjectHasAttribute('attribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - */ - public function testObjectNotHasProtectedAttribute() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertObjectNotHasAttribute('attribute', $obj); - - try { - $this->assertObjectNotHasAttribute('protectedAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute - */ - public function testObjectHasPrivateAttribute() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertObjectHasAttribute('privateAttribute', $obj); - - try { - $this->assertObjectHasAttribute('attribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute - */ - public function testObjectNotHasPrivateAttribute() - { - $obj = new ClassWithNonPublicAttributes; - - $this->assertObjectNotHasAttribute('attribute', $obj); - - try { - $this->assertObjectNotHasAttribute('privateAttribute', $obj); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::attribute - * @covers PHPUnit_Framework_Assert::equalTo - */ - public function testAssertThatAttributeEquals() - { - $this->assertThat( - new ClassWithNonPublicAttributes, - $this->attribute( - $this->equalTo('foo'), - 'publicAttribute' - ) - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::attribute - * @covers PHPUnit_Framework_Assert::equalTo - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertThatAttributeEquals2() - { - $this->assertThat( - new ClassWithNonPublicAttributes, - $this->attribute( - $this->equalTo('bar'), - 'publicAttribute' - ) - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::attribute - * @covers PHPUnit_Framework_Assert::equalTo - */ - public function testAssertThatAttributeEqualTo() - { - $this->assertThat( - new ClassWithNonPublicAttributes, - $this->attributeEqualTo('publicAttribute', 'foo') - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::anything - */ - public function testAssertThatAnything() - { - $this->assertThat('anything', $this->anything()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::isTrue - */ - public function testAssertThatIsTrue() - { - $this->assertThat(true, $this->isTrue()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::isFalse - */ - public function testAssertThatIsFalse() - { - $this->assertThat(false, $this->isFalse()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::isJson - */ - public function testAssertThatIsJson() - { - $this->assertThat('{}', $this->isJson()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::anything - * @covers PHPUnit_Framework_Assert::logicalAnd - */ - public function testAssertThatAnythingAndAnything() - { - $this->assertThat( - 'anything', - $this->logicalAnd( - $this->anything(), $this->anything() - ) - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::anything - * @covers PHPUnit_Framework_Assert::logicalOr - */ - public function testAssertThatAnythingOrAnything() - { - $this->assertThat( - 'anything', - $this->logicalOr( - $this->anything(), $this->anything() - ) - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::anything - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_Assert::logicalXor - */ - public function testAssertThatAnythingXorNotAnything() - { - $this->assertThat( - 'anything', - $this->logicalXor( - $this->anything(), - $this->logicalNot($this->anything()) - ) - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::contains - */ - public function testAssertThatContains() - { - $this->assertThat(array('foo'), $this->contains('foo')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::stringContains - */ - public function testAssertThatStringContains() - { - $this->assertThat('barfoobar', $this->stringContains('foo')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::containsOnly - */ - public function testAssertThatContainsOnly() - { - $this->assertThat(array('foo'), $this->containsOnly('string')); - } - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::containsOnlyInstancesOf - */ - public function testAssertThatContainsOnlyInstancesOf() - { - $this->assertThat(array(new Book), $this->containsOnlyInstancesOf('Book')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::arrayHasKey - */ - public function testAssertThatArrayHasKey() - { - $this->assertThat(array('foo' => 'bar'), $this->arrayHasKey('foo')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::classHasAttribute - */ - public function testAssertThatClassHasAttribute() - { - $this->assertThat( - new ClassWithNonPublicAttributes, - $this->classHasAttribute('publicAttribute') - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::classHasStaticAttribute - */ - public function testAssertThatClassHasStaticAttribute() - { - $this->assertThat( - new ClassWithNonPublicAttributes, - $this->classHasStaticAttribute('publicStaticAttribute') - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::objectHasAttribute - */ - public function testAssertThatObjectHasAttribute() - { - $this->assertThat( - new ClassWithNonPublicAttributes, - $this->objectHasAttribute('publicAttribute') - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::equalTo - */ - public function testAssertThatEqualTo() - { - $this->assertThat('foo', $this->equalTo('foo')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::identicalTo - */ - public function testAssertThatIdenticalTo() - { - $value = new stdClass; - $constraint = $this->identicalTo($value); - - $this->assertThat($value, $constraint); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::isInstanceOf - */ - public function testAssertThatIsInstanceOf() - { - $this->assertThat(new stdClass, $this->isInstanceOf('StdClass')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::isType - */ - public function testAssertThatIsType() - { - $this->assertThat('string', $this->isType('string')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::isEmpty - */ - public function testAssertThatIsEmpty() - { - $this->assertThat(array(), $this->isEmpty()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::fileExists - */ - public function testAssertThatFileExists() - { - $this->assertThat(__FILE__, $this->fileExists()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::greaterThan - */ - public function testAssertThatGreaterThan() - { - $this->assertThat(2, $this->greaterThan(1)); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::greaterThanOrEqual - */ - public function testAssertThatGreaterThanOrEqual() - { - $this->assertThat(2, $this->greaterThanOrEqual(1)); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::lessThan - */ - public function testAssertThatLessThan() - { - $this->assertThat(1, $this->lessThan(2)); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::lessThanOrEqual - */ - public function testAssertThatLessThanOrEqual() - { - $this->assertThat(1, $this->lessThanOrEqual(2)); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::matchesRegularExpression - */ - public function testAssertThatMatchesRegularExpression() - { - $this->assertThat('foobar', $this->matchesRegularExpression('/foo/')); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::callback - */ - public function testAssertThatCallback() - { - $this->assertThat( - null, - $this->callback(function ($other) { return true; }) - ); - } - - /** - * @covers PHPUnit_Framework_Assert::assertThat - * @covers PHPUnit_Framework_Assert::countOf - */ - public function testAssertThatCountOf() - { - $this->assertThat(array(1), $this->countOf(1)); - } - - /** - * @covers PHPUnit_Framework_Assert::assertFileEquals - */ - public function testAssertFileEquals() - { - $this->assertFileEquals( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'foo.xml' - ); - - try { - $this->assertFileEquals( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'bar.xml' - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertFileNotEquals - */ - public function testAssertFileNotEquals() - { - $this->assertFileNotEquals( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'bar.xml' - ); - - try { - $this->assertFileNotEquals( - $this->filesDirectory . 'foo.xml', - $this->filesDirectory . 'foo.xml' - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringEqualsFile - */ - public function testAssertStringEqualsFile() - { - $this->assertStringEqualsFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'foo.xml') - ); - - try { - $this->assertStringEqualsFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'bar.xml') - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringNotEqualsFile - */ - public function testAssertStringNotEqualsFile() - { - $this->assertStringNotEqualsFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'bar.xml') - ); - - try { - $this->assertStringNotEqualsFile( - $this->filesDirectory . 'foo.xml', - file_get_contents($this->filesDirectory . 'foo.xml') - ); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringStartsWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringStartsWithThrowsException() - { - $this->assertStringStartsWith(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringStartsWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringStartsWithThrowsException2() - { - $this->assertStringStartsWith('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringStartsNotWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringStartsNotWithThrowsException() - { - $this->assertStringStartsNotWith(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringStartsNotWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringStartsNotWithThrowsException2() - { - $this->assertStringStartsNotWith('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringEndsWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringEndsWithThrowsException() - { - $this->assertStringEndsWith(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringEndsWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringEndsWithThrowsException2() - { - $this->assertStringEndsWith('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringEndsNotWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringEndsNotWithThrowsException() - { - $this->assertStringEndsNotWith(null, null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringEndsNotWith - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringEndsNotWithThrowsException2() - { - $this->assertStringEndsNotWith('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringStartsWith - */ - public function testAssertStringStartsWith() - { - $this->assertStringStartsWith('prefix', 'prefixfoo'); - - try { - $this->assertStringStartsWith('prefix', 'foo'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringStartsNotWith - */ - public function testAssertStringStartsNotWith() - { - $this->assertStringStartsNotWith('prefix', 'foo'); - - try { - $this->assertStringStartsNotWith('prefix', 'prefixfoo'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringEndsWith - */ - public function testAssertStringEndsWith() - { - $this->assertStringEndsWith('suffix', 'foosuffix'); - - try { - $this->assertStringEndsWith('suffix', 'foo'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringEndsNotWith - */ - public function testAssertStringEndsNotWith() - { - $this->assertStringEndsNotWith('suffix', 'foo'); - - try { - $this->assertStringEndsNotWith('suffix', 'foosuffix'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringMatchesFormat - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringMatchesFormatRaisesExceptionForInvalidFirstArgument() - { - $this->assertStringMatchesFormat(null, ''); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringMatchesFormat - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringMatchesFormatRaisesExceptionForInvalidSecondArgument() - { - $this->assertStringMatchesFormat('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringMatchesFormat - */ - public function testAssertStringMatchesFormat() - { - $this->assertStringMatchesFormat('*%s*', '***'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringMatchesFormat - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertStringMatchesFormatFailure() - { - $this->assertStringMatchesFormat('*%s*', '**'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringNotMatchesFormat - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringNotMatchesFormatRaisesExceptionForInvalidFirstArgument() - { - $this->assertStringNotMatchesFormat(null, ''); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringNotMatchesFormat - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringNotMatchesFormatRaisesExceptionForInvalidSecondArgument() - { - $this->assertStringNotMatchesFormat('', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringNotMatchesFormat - */ - public function testAssertStringNotMatchesFormat() - { - $this->assertStringNotMatchesFormat('*%s*', '**'); - - try { - $this->assertStringMatchesFormat('*%s*', '**'); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertEmpty - */ - public function testAssertEmpty() - { - $this->assertEmpty(array()); - - try { - $this->assertEmpty(array('foo')); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotEmpty - */ - public function testAssertNotEmpty() - { - $this->assertNotEmpty(array('foo')); - - try { - $this->assertNotEmpty(array()); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeEmpty - */ - public function testAssertAttributeEmpty() - { - $o = new stdClass; - $o->a = array(); - - $this->assertAttributeEmpty('a', $o); - - try { - $o->a = array('b'); - $this->assertAttributeEmpty('a', $o); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotEmpty - */ - public function testAssertAttributeNotEmpty() - { - $o = new stdClass; - $o->a = array('b'); - - $this->assertAttributeNotEmpty('a', $o); - - try { - $o->a = array(); - $this->assertAttributeNotEmpty('a', $o); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::markTestIncomplete - */ - public function testMarkTestIncomplete() - { - try { - $this->markTestIncomplete('incomplete'); - } catch (PHPUnit_Framework_IncompleteTestError $e) { - $this->assertEquals('incomplete', $e->getMessage()); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::markTestSkipped - */ - public function testMarkTestSkipped() - { - try { - $this->markTestSkipped('skipped'); - } catch (PHPUnit_Framework_SkippedTestError $e) { - $this->assertEquals('skipped', $e->getMessage()); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertCount - */ - public function testAssertCount() - { - $this->assertCount(2, array(1, 2)); - - try { - $this->assertCount(2, array(1, 2, 3)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertCount - */ - public function testAssertCountTraversable() - { - $this->assertCount(2, new ArrayIterator(array(1, 2))); - - try { - $this->assertCount(2, new ArrayIterator(array(1, 2, 3))); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertCount - */ - public function testAssertCountThrowsExceptionIfExpectedCountIsNoInteger() - { - try { - $this->assertCount('a', array()); - } catch (PHPUnit_Framework_Exception $e) { - $this->assertEquals('Argument #1 (No Value) of PHPUnit_Framework_Assert::assertCount() must be a integer', $e->getMessage()); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertCount - */ - public function testAssertCountThrowsExceptionIfElementIsNotCountable() - { - try { - $this->assertCount(2, ''); - } catch (PHPUnit_Framework_Exception $e) { - $this->assertEquals('Argument #2 (No Value) of PHPUnit_Framework_Assert::assertCount() must be a countable or traversable', $e->getMessage()); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeCount - */ - public function testAssertAttributeCount() - { - $o = new stdClass; - $o->a = array(); - - $this->assertAttributeCount(0, 'a', $o); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotCount - */ - public function testAssertNotCount() - { - $this->assertNotCount(2, array(1, 2, 3)); - - try { - $this->assertNotCount(2, array(1, 2)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotCount - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotCountThrowsExceptionIfExpectedCountIsNoInteger() - { - $this->assertNotCount('a', array()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotCount - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotCountThrowsExceptionIfElementIsNotCountable() - { - $this->assertNotCount(2, ''); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotCount - */ - public function testAssertAttributeNotCount() - { - $o = new stdClass; - $o->a = array(); - - $this->assertAttributeNotCount(1, 'a', $o); - } - - /** - * @covers PHPUnit_Framework_Assert::assertSameSize - */ - public function testAssertSameSize() - { - $this->assertSameSize(array(1, 2), array(3, 4)); - - try { - $this->assertSameSize(array(1, 2), array(1, 2, 3)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertSameSize - */ - public function testAssertSameSizeThrowsExceptionIfExpectedIsNotCountable() - { - try { - $this->assertSameSize('a', array()); - } catch (PHPUnit_Framework_Exception $e) { - $this->assertEquals('Argument #1 (No Value) of PHPUnit_Framework_Assert::assertSameSize() must be a countable or traversable', $e->getMessage()); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertSameSize - */ - public function testAssertSameSizeThrowsExceptionIfActualIsNotCountable() - { - try { - $this->assertSameSize(array(), ''); - } catch (PHPUnit_Framework_Exception $e) { - $this->assertEquals('Argument #2 (No Value) of PHPUnit_Framework_Assert::assertSameSize() must be a countable or traversable', $e->getMessage()); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSameSize - */ - public function testAssertNotSameSize() - { - $this->assertNotSameSize(array(1, 2), array(1, 2, 3)); - - try { - $this->assertNotSameSize(array(1, 2), array(3, 4)); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSameSize - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotSameSizeThrowsExceptionIfExpectedIsNotCountable() - { - $this->assertNotSameSize('a', array()); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotSameSize - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotSameSizeThrowsExceptionIfActualIsNotCountable() - { - $this->assertNotSameSize(array(), ''); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJson - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertJsonRaisesExceptionForInvalidArgument() - { - $this->assertJson(null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJson - */ - public function testAssertJson() - { - $this->assertJson('{}'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString - */ - public function testAssertJsonStringEqualsJsonString() - { - $expected = '{"Mascott" : "Tux"}'; - $actual = '{"Mascott" : "Tux"}'; - $message = 'Given Json strings do not match'; - - $this->assertJsonStringEqualsJsonString($expected, $actual, $message); - } - - /** - * @dataProvider validInvalidJsonDataprovider - * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString - */ - public function testAssertJsonStringEqualsJsonStringErrorRaised($expected, $actual) - { - try { - $this->assertJsonStringEqualsJsonString($expected, $actual); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - $this->fail('Expected exception not found'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString - */ - public function testAssertJsonStringNotEqualsJsonString() - { - $expected = '{"Mascott" : "Beastie"}'; - $actual = '{"Mascott" : "Tux"}'; - $message = 'Given Json strings do match'; - - $this->assertJsonStringNotEqualsJsonString($expected, $actual, $message); - } - - /** - * @dataProvider validInvalidJsonDataprovider - * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString - */ - public function testAssertJsonStringNotEqualsJsonStringErrorRaised($expected, $actual) - { - try { - $this->assertJsonStringNotEqualsJsonString($expected, $actual); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - $this->fail('Expected exception not found'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile - */ - public function testAssertJsonStringEqualsJsonFile() - { - $file = __DIR__ . '/../_files/JsonData/simpleObject.json'; - $actual = json_encode(array('Mascott' => 'Tux')); - $message = ''; - $this->assertJsonStringEqualsJsonFile($file, $actual, $message); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile - */ - public function testAssertJsonStringEqualsJsonFileExpectingExpectationFailedException() - { - $file = __DIR__ . '/../_files/JsonData/simpleObject.json'; - $actual = json_encode(array('Mascott' => 'Beastie')); - $message = ''; - try { - $this->assertJsonStringEqualsJsonFile($file, $actual, $message); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - 'Failed asserting that \'{"Mascott":"Beastie"}\' matches JSON string "{"Mascott":"Tux"}".', - $e->getMessage() - ); - - return; - } - - $this->fail('Expected Exception not thrown.'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile - */ - public function testAssertJsonStringEqualsJsonFileExpectingException() - { - $file = __DIR__ . '/../_files/JsonData/simpleObject.json'; - try { - $this->assertJsonStringEqualsJsonFile($file, null); - } catch (PHPUnit_Framework_Exception $e) { - return; - } - $this->fail('Expected Exception not thrown.'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile - */ - public function testAssertJsonStringNotEqualsJsonFile() - { - $file = __DIR__ . '/../_files/JsonData/simpleObject.json'; - $actual = json_encode(array('Mascott' => 'Beastie')); - $message = ''; - $this->assertJsonStringNotEqualsJsonFile($file, $actual, $message); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile - */ - public function testAssertJsonStringNotEqualsJsonFileExpectingException() - { - $file = __DIR__ . '/../_files/JsonData/simpleObject.json'; - try { - $this->assertJsonStringNotEqualsJsonFile($file, null); - } catch (PHPUnit_Framework_Exception $e) { - return; - } - $this->fail('Expected exception not found.'); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile - */ - public function testAssertJsonFileNotEqualsJsonFile() - { - $fileExpected = __DIR__ . '/../_files/JsonData/simpleObject.json'; - $fileActual = __DIR__ . '/../_files/JsonData/arrayObject.json'; - $message = ''; - $this->assertJsonFileNotEqualsJsonFile($fileExpected, $fileActual, $message); - } - - /** - * @covers PHPUnit_Framework_Assert::assertJsonFileEqualsJsonFile - */ - public function testAssertJsonFileEqualsJsonFile() - { - $file = __DIR__ . '/../_files/JsonData/simpleObject.json'; - $message = ''; - $this->assertJsonFileEqualsJsonFile($file, $file, $message); - } - - /** - * @covers PHPUnit_Framework_Assert::assertInstanceOf - */ - public function testAssertInstanceOf() - { - $this->assertInstanceOf('stdClass', new stdClass); - - try { - $this->assertInstanceOf('Exception', new stdClass); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertInstanceOf - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertInstanceOfThrowsExceptionForInvalidArgument() - { - $this->assertInstanceOf(null, new stdClass); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeInstanceOf - */ - public function testAssertAttributeInstanceOf() - { - $o = new stdClass; - $o->a = new stdClass; - - $this->assertAttributeInstanceOf('stdClass', 'a', $o); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotInstanceOf - */ - public function testAssertNotInstanceOf() - { - $this->assertNotInstanceOf('Exception', new stdClass); - - try { - $this->assertNotInstanceOf('stdClass', new stdClass); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotInstanceOf - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotInstanceOfThrowsExceptionForInvalidArgument() - { - $this->assertNotInstanceOf(null, new stdClass); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotInstanceOf - */ - public function testAssertAttributeNotInstanceOf() - { - $o = new stdClass; - $o->a = new stdClass; - - $this->assertAttributeNotInstanceOf('Exception', 'a', $o); - } - - /** - * @covers PHPUnit_Framework_Assert::assertInternalType - */ - public function testAssertInternalType() - { - $this->assertInternalType('integer', 1); - - try { - $this->assertInternalType('string', 1); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertInternalType - */ - public function testAssertInternalTypeDouble() - { - $this->assertInternalType('double', 1.0); - - try { - $this->assertInternalType('double', 1); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertInternalType - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertInternalTypeThrowsExceptionForInvalidArgument() - { - $this->assertInternalType(null, 1); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeInternalType - */ - public function testAssertAttributeInternalType() - { - $o = new stdClass; - $o->a = 1; - - $this->assertAttributeInternalType('integer', 'a', $o); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotInternalType - */ - public function testAssertNotInternalType() - { - $this->assertNotInternalType('string', 1); - - try { - $this->assertNotInternalType('integer', 1); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertNotInternalType - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertNotInternalTypeThrowsExceptionForInvalidArgument() - { - $this->assertNotInternalType(null, 1); - } - - /** - * @covers PHPUnit_Framework_Assert::assertAttributeNotInternalType - */ - public function testAssertAttributeNotInternalType() - { - $o = new stdClass; - $o->a = 1; - - $this->assertAttributeNotInternalType('string', 'a', $o); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringMatchesFormatFile - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringMatchesFormatFileThrowsExceptionForInvalidArgument() - { - $this->assertStringMatchesFormatFile('not_existing_file', ''); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringMatchesFormatFile - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringMatchesFormatFileThrowsExceptionForInvalidArgument2() - { - $this->assertStringMatchesFormatFile($this->filesDirectory . 'expectedFileFormat.txt', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringMatchesFormatFile - */ - public function testAssertStringMatchesFormatFile() - { - $this->assertStringMatchesFormatFile($this->filesDirectory . 'expectedFileFormat.txt', "FOO\n"); - - try { - $this->assertStringMatchesFormatFile($this->filesDirectory . 'expectedFileFormat.txt', "BAR\n"); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringNotMatchesFormatFileThrowsExceptionForInvalidArgument() - { - $this->assertStringNotMatchesFormatFile('not_existing_file', ''); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile - * @expectedException PHPUnit_Framework_Exception - */ - public function testAssertStringNotMatchesFormatFileThrowsExceptionForInvalidArgument2() - { - $this->assertStringNotMatchesFormatFile($this->filesDirectory . 'expectedFileFormat.txt', null); - } - - /** - * @covers PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile - */ - public function testAssertStringNotMatchesFormatFile() - { - $this->assertStringNotMatchesFormatFile($this->filesDirectory . 'expectedFileFormat.txt', "BAR\n"); - - try { - $this->assertStringNotMatchesFormatFile($this->filesDirectory . 'expectedFileFormat.txt', "FOO\n"); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - return; - } - - $this->fail(); - } - - /** - * @return array - */ - public static function validInvalidJsonDataprovider() - { - return array( - 'error syntax in expected JSON' => array('{"Mascott"::}', '{"Mascott" : "Tux"}'), - 'error UTF-8 in actual JSON' => array('{"Mascott" : "Tux"}', '{"Mascott" : :}'), - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/BaseTestListenerTest.php b/vendor/phpunit/phpunit/tests/Framework/BaseTestListenerTest.php deleted file mode 100644 index 0d426cf..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/BaseTestListenerTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 4.0.0 - */ -class Framework_BaseTestListenerTest extends PHPUnit_Framework_TestCase -{ - /** - * @var PHPUnit_Framework_TestResult - */ - private $result; - - /** - * @covers PHPUnit_Framework_TestResult - */ - public function testEndEventsAreCounted() - { - $this->result = new PHPUnit_Framework_TestResult; - $listener = new BaseTestListenerSample(); - $this->result->addListener($listener); - $test = new Success; - $test->run($this->result); - - $this->assertEquals(1, $listener->endCount); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/Constraint/CountTest.php b/vendor/phpunit/phpunit/tests/Framework/Constraint/CountTest.php deleted file mode 100644 index 79e99e8..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/Constraint/CountTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 3.7.30 - * @covers PHPUnit_Framework_Constraint_Count - */ -class CountTest extends PHPUnit_Framework_TestCase -{ - public function testCount() - { - $countConstraint = new PHPUnit_Framework_Constraint_Count(3); - $this->assertTrue($countConstraint->evaluate(array(1, 2, 3), '', true)); - - $countConstraint = new PHPUnit_Framework_Constraint_Count(0); - $this->assertTrue($countConstraint->evaluate(array(), '', true)); - - $countConstraint = new PHPUnit_Framework_Constraint_Count(2); - $it = new TestIterator(array(1, 2)); - $this->assertTrue($countConstraint->evaluate($it, '', true)); - } - - public function testCountDoesNotChangeIteratorKey() - { - $countConstraint = new PHPUnit_Framework_Constraint_Count(2); - - // test with 1st implementation of Iterator - $it = new TestIterator(array(1, 2)); - - $countConstraint->evaluate($it, '', true); - $this->assertEquals(1, $it->current()); - - $it->next(); - $countConstraint->evaluate($it, '', true); - $this->assertEquals(2, $it->current()); - - $it->next(); - $countConstraint->evaluate($it, '', true); - $this->assertFalse($it->valid()); - - // test with 2nd implementation of Iterator - $it = new TestIterator2(array(1, 2)); - - $countConstraint = new PHPUnit_Framework_Constraint_Count(2); - $countConstraint->evaluate($it, '', true); - $this->assertEquals(1, $it->current()); - - $it->next(); - $countConstraint->evaluate($it, '', true); - $this->assertEquals(2, $it->current()); - - $it->next(); - $countConstraint->evaluate($it, '', true); - $this->assertFalse($it->valid()); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/Constraint/ExceptionMessageRegExpTest.php b/vendor/phpunit/phpunit/tests/Framework/Constraint/ExceptionMessageRegExpTest.php deleted file mode 100644 index 1c02a12..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/Constraint/ExceptionMessageRegExpTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 4.3.0 - * @covers PHPUnit_Framework_Constraint_ExceptionMessageRegExp - */ -class ExceptionMessageRegExpTest extends PHPUnit_Framework_TestCase -{ - /** - * @expectedException \Exception - * @expectedExceptionMessageRegExp /^A polymorphic \w+ message/ - */ - public function testRegexMessage() - { - throw new Exception('A polymorphic exception message'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessageRegExp /^a poly[a-z]+ [a-zA-Z0-9_]+ me(s){2}age$/i - */ - public function testRegexMessageExtreme() - { - throw new Exception('A polymorphic exception message'); - } - - /** - * @runInSeparateProcess - * @requires extension xdebug - * @expectedException \Exception - * @expectedExceptionMessageRegExp #Screaming preg_match# - */ - public function testMessageXdebugScreamCompatibility() - { - ini_set('xdebug.scream', '1'); - throw new Exception('Screaming preg_match'); - } - - /** - * @coversNothing - * @expectedException \Exception variadic - * @expectedExceptionMessageRegExp /^A variadic \w+ message/ - */ - public function testSimultaneousLiteralAndRegExpExceptionMessage() - { - throw new Exception('A variadic exception message'); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/Constraint/ExceptionMessageTest.php b/vendor/phpunit/phpunit/tests/Framework/Constraint/ExceptionMessageTest.php deleted file mode 100644 index 33f4319..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/Constraint/ExceptionMessageTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 4.0.20 - * @covers PHPUnit_Framework_Constraint_ExceptionMessage - */ -class ExceptionMessageTest extends PHPUnit_Framework_TestCase -{ - /** - * @expectedException \Exception - * @expectedExceptionMessage A literal exception message - */ - public function testLiteralMessage() - { - throw new Exception('A literal exception message'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage A partial - */ - public function testPatialMessageBegin() - { - throw new Exception('A partial exception message'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage partial exception - */ - public function testPatialMessageMiddle() - { - throw new Exception('A partial exception message'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage exception message - */ - public function testPatialMessageEnd() - { - throw new Exception('A partial exception message'); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php b/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php deleted file mode 100644 index 8529026..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since File available since Release 3.7.0 - */ -class Framework_Constraint_JsonMatches_ErrorMessageProviderTest extends PHPUnit_Framework_TestCase -{ - /** - * @dataProvider translateTypeToPrefixDataprovider - * @covers PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::translateTypeToPrefix - */ - public function testTranslateTypeToPrefix($expected, $type) - { - $this->assertEquals( - $expected, - PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::translateTypeToPrefix($type) - ); - } - - /** - * @dataProvider determineJsonErrorDataprovider - * @covers PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::determineJsonError - */ - public function testDetermineJsonError($expected, $error, $prefix) - { - $this->assertEquals( - $expected, - PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::determineJsonError( - $error, - $prefix - ) - ); - } - - public static function determineJsonErrorDataprovider() - { - return array( - 'JSON_ERROR_NONE' => array( - null, 'json_error_none', '' - ), - 'JSON_ERROR_DEPTH' => array( - 'Maximum stack depth exceeded', JSON_ERROR_DEPTH, '' - ), - 'prefixed JSON_ERROR_DEPTH' => array( - 'TUX: Maximum stack depth exceeded', JSON_ERROR_DEPTH, 'TUX: ' - ), - 'JSON_ERROR_STATE_MISMatch' => array( - 'Underflow or the modes mismatch', JSON_ERROR_STATE_MISMATCH, '' - ), - 'JSON_ERROR_CTRL_CHAR' => array( - 'Unexpected control character found', JSON_ERROR_CTRL_CHAR, '' - ), - 'JSON_ERROR_SYNTAX' => array( - 'Syntax error, malformed JSON', JSON_ERROR_SYNTAX, '' - ), - 'JSON_ERROR_UTF8`' => array( - 'Malformed UTF-8 characters, possibly incorrectly encoded', - JSON_ERROR_UTF8, - '' - ), - 'Invalid error indicator' => array( - 'Unknown error', 55, '' - ), - ); - } - - public static function translateTypeToPrefixDataprovider() - { - return array( - 'expected' => array('Expected value JSON decode error - ', 'expected'), - 'actual' => array('Actual value JSON decode error - ', 'actual'), - 'default' => array('', ''), - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatchesTest.php b/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatchesTest.php deleted file mode 100644 index 3203100..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatchesTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since File available since Release 3.7.0 - */ -class Framework_Constraint_JsonMatchesTest extends PHPUnit_Framework_TestCase -{ - /** - * @dataProvider evaluateDataprovider - * @covers PHPUnit_Framework_Constraint_JsonMatches::evaluate - * @covers PHPUnit_Framework_Constraint_JsonMatches::matches - * @covers PHPUnit_Framework_Constraint_JsonMatches::__construct - */ - public function testEvaluate($expected, $jsonOther, $jsonValue) - { - $constraint = new PHPUnit_Framework_Constraint_JsonMatches($jsonValue); - $this->assertEquals($expected, $constraint->evaluate($jsonOther, '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_JsonMatches::toString - */ - public function testToString() - { - $jsonValue = json_encode(array('Mascott' => 'Tux')); - $constraint = new PHPUnit_Framework_Constraint_JsonMatches($jsonValue); - - $this->assertEquals('matches JSON string "' . $jsonValue . '"', $constraint->toString()); - } - - public static function evaluateDataprovider() - { - return array( - 'valid JSON' => array(true, json_encode(array('Mascott' => 'Tux')), json_encode(array('Mascott' => 'Tux'))), - 'error syntax' => array(false, '{"Mascott"::}', json_encode(array('Mascott' => 'Tux'))), - 'error UTF-8' => array(false, json_encode('\xB1\x31'), json_encode(array('Mascott' => 'Tux'))), - 'invalid JSON in class instantiation' => array(false, json_encode(array('Mascott' => 'Tux')), '{"Mascott"::}'), - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php b/vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php deleted file mode 100644 index f617133..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php +++ /dev/null @@ -1,3490 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 3.0.0 - */ -class Framework_ConstraintTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHPUnit_Framework_Constraint_ArrayHasKey - * @covers PHPUnit_Framework_Assert::arrayHasKey - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayHasKey() - { - $constraint = PHPUnit_Framework_Assert::arrayHasKey(0); - - $this->assertFalse($constraint->evaluate(array(), '', true)); - $this->assertEquals('has the key 0', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(array()); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ArrayHasKey - * @covers PHPUnit_Framework_Assert::arrayHasKey - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayHasKey2() - { - $constraint = PHPUnit_Framework_Assert::arrayHasKey(0); - - try { - $constraint->evaluate(array(), 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ArrayHasKey - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::arrayHasKey - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayNotHasKey() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::arrayHasKey(0) - ); - - $this->assertFalse($constraint->evaluate(array(0 => 1), '', true)); - $this->assertEquals('does not have the key 0', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(array(0 => 1)); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ArrayHasKey - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::arrayHasKey - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayNotHasKey2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::arrayHasKey(0) - ); - - try { - $constraint->evaluate(array(0), 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_FileExists - * @covers PHPUnit_Framework_Assert::fileExists - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintFileExists() - { - $constraint = PHPUnit_Framework_Assert::fileExists(); - - $this->assertFalse($constraint->evaluate('foo', '', true)); - $this->assertEquals('file exists', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('foo'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_FileExists - * @covers PHPUnit_Framework_Assert::fileExists - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintFileExists2() - { - $constraint = PHPUnit_Framework_Assert::fileExists(); - - try { - $constraint->evaluate('foo', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_FileExists - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_Assert::fileExists - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintFileNotExists() - { - $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; - - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::fileExists() - ); - - $this->assertFalse($constraint->evaluate($file, '', true)); - $this->assertEquals('file does not exist', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate($file); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_FileExists - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_Assert::fileExists - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintFileNotExists2() - { - $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; - - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::fileExists() - ); - - try { - $constraint->evaluate($file, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Assert::greaterThan - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintGreaterThan() - { - $constraint = PHPUnit_Framework_Assert::greaterThan(1); - - $this->assertFalse($constraint->evaluate(0, '', true)); - $this->assertTrue($constraint->evaluate(2, '', true)); - $this->assertEquals('is greater than 1', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(0); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Assert::greaterThan - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintGreaterThan2() - { - $constraint = PHPUnit_Framework_Assert::greaterThan(1); - - try { - $constraint->evaluate(0, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::greaterThan - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotGreaterThan() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::greaterThan(1) - ); - - $this->assertTrue($constraint->evaluate(1, '', true)); - $this->assertEquals('is not greater than 1', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(2); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::greaterThan - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotGreaterThan2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::greaterThan(1) - ); - - try { - $constraint->evaluate(2, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Assert::greaterThanOrEqual - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintGreaterThanOrEqual() - { - $constraint = PHPUnit_Framework_Assert::greaterThanOrEqual(1); - - $this->assertTrue($constraint->evaluate(1, '', true)); - $this->assertFalse($constraint->evaluate(0, '', true)); - $this->assertEquals('is equal to 1 or is greater than 1', $constraint->toString()); - $this->assertEquals(2, count($constraint)); - - try { - $constraint->evaluate(0); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Assert::greaterThanOrEqual - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintGreaterThanOrEqual2() - { - $constraint = PHPUnit_Framework_Assert::greaterThanOrEqual(1); - - try { - $constraint->evaluate(0, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::greaterThanOrEqual - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotGreaterThanOrEqual() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::greaterThanOrEqual(1) - ); - - $this->assertFalse($constraint->evaluate(1, '', true)); - $this->assertEquals('not( is equal to 1 or is greater than 1 )', $constraint->toString()); - $this->assertEquals(2, count($constraint)); - - try { - $constraint->evaluate(1); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_GreaterThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::greaterThanOrEqual - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotGreaterThanOrEqual2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::greaterThanOrEqual(1) - ); - - try { - $constraint->evaluate(1, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsAnything - * @covers PHPUnit_Framework_Assert::anything - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsAnything() - { - $constraint = PHPUnit_Framework_Assert::anything(); - - $this->assertTrue($constraint->evaluate(null, '', true)); - $this->assertNull($constraint->evaluate(null)); - $this->assertEquals('is anything', $constraint->toString()); - $this->assertEquals(0, count($constraint)); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsAnything - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::anything - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotIsAnything() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::anything() - ); - - $this->assertFalse($constraint->evaluate(null, '', true)); - $this->assertEquals('is not anything', $constraint->toString()); - $this->assertEquals(0, count($constraint)); - - try { - $constraint->evaluate(null); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Assert::equalTo - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsEqual() - { - $constraint = PHPUnit_Framework_Assert::equalTo(1); - - $this->assertTrue($constraint->evaluate(1, '', true)); - $this->assertFalse($constraint->evaluate(0, '', true)); - $this->assertEquals('is equal to 1', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(0); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - public function isEqualProvider() - { - $a = new stdClass; - $a->foo = 'bar'; - $b = new stdClass; - $ahash = spl_object_hash($a); - $bhash = spl_object_hash($b); - - $c = new stdClass; - $c->foo = 'bar'; - $c->int = 1; - $c->array = array(0, array(1), array(2), 3); - $c->related = new stdClass; - $c->related->foo = "a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk"; - $c->self = $c; - $c->c = $c; - $d = new stdClass; - $d->foo = 'bar'; - $d->int = 2; - $d->array = array(0, array(4), array(2), 3); - $d->related = new stdClass; - $d->related->foo = "a\np\nc\nd\ne\nf\ng\nh\ni\nw\nk"; - $d->self = $d; - $d->c = $c; - - $storage1 = new SplObjectStorage; - $storage1->attach($a); - $storage1->attach($b); - $storage2 = new SplObjectStorage; - $storage2->attach($b); - $storage1hash = spl_object_hash($storage1); - $storage2hash = spl_object_hash($storage2); - - $dom1 = new DOMDocument; - $dom1->preserveWhiteSpace = false; - $dom1->loadXML(''); - $dom2 = new DOMDocument; - $dom2->preserveWhiteSpace = false; - $dom2->loadXML(''); - - $data = array( - array(1, 0, << 0 -+ 0 => 1 - ) - -EOF - ), - array(array(true), array('true'), << true -+ 0 => 'true' - ) - -EOF - ), - array(array(0, array(1), array(2), 3), array(0, array(4), array(2), 3), << 0 - 1 => Array ( -- 0 => 1 -+ 0 => 4 - ) - 2 => Array (...) - 3 => 3 - ) - -EOF - ), - array($a, array(0), << 'bar' - ) - -EOF - ), - array($c, $d, << 'bar' -- 'int' => 1 -+ 'int' => 2 - 'array' => Array ( - 0 => 0 - 1 => Array ( -- 0 => 1 -+ 0 => 4 - -@@ @@ - 'foo' => 'a -- b -+ p - -@@ @@ - i -- j -+ w - k' - ) - 'self' => stdClass Object (...) - 'c' => stdClass Object (...) - ) - -EOF - ), - array($dom1, $dom2, << -- -+ -+ -+ - -EOF - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')), - << Array &0 ( -- 'obj' => stdClass Object &$ahash ( -- 'foo' => 'bar' -- ) -+SplObjectStorage Object &$storage2hash ( -+ '$bhash' => Array &0 ( -+ 'obj' => stdClass Object &$bhash () - 'inf' => null - ) -- '$bhash' => Array &0 - ) - -EOF - ); - } else { - $data[] = array($storage1, $storage2, << Array &0 ( -- 'obj' => stdClass Object &$ahash ( -- 'foo' => 'bar' -- ) -- 'inf' => null -- ) -- '$bhash' => Array &1 ( -+SplObjectStorage Object &$storage2hash ( -+ '$bhash' => Array &0 ( - 'obj' => stdClass Object &$bhash () - 'inf' => null - ) - ) - -EOF - ); - } - - return $data; - } - - /** - * @dataProvider isEqualProvider - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Assert::equalTo - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsEqual2($expected, $actual, $message) - { - $constraint = PHPUnit_Framework_Assert::equalTo($expected); - - try { - $constraint->evaluate($actual, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - "custom message\n$message", - $this->trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) - ); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::equalTo - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotEqual() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::equalTo(1) - ); - - $this->assertTrue($constraint->evaluate(0, '', true)); - $this->assertFalse($constraint->evaluate(1, '', true)); - $this->assertEquals('is not equal to 1', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(1); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::equalTo - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotEqual2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::equalTo(1) - ); - - try { - $constraint->evaluate(1, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsIdentical - * @covers PHPUnit_Framework_Assert::identicalTo - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsIdentical() - { - $a = new stdClass; - $b = new stdClass; - - $constraint = PHPUnit_Framework_Assert::identicalTo($a); - - $this->assertFalse($constraint->evaluate($b, '', true)); - $this->assertTrue($constraint->evaluate($a, '', true)); - $this->assertEquals('is identical to an object of class "stdClass"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate($b); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsIdentical - * @covers PHPUnit_Framework_Assert::identicalTo - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsIdentical2() - { - $a = new stdClass; - $b = new stdClass; - - $constraint = PHPUnit_Framework_Assert::identicalTo($a); - - try { - $constraint->evaluate($b, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsIdentical - * @covers PHPUnit_Framework_Assert::identicalTo - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsIdentical3() - { - $constraint = PHPUnit_Framework_Assert::identicalTo('a'); - - try { - $constraint->evaluate('b', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsIdentical - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::identicalTo - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotIdentical() - { - $a = new stdClass; - $b = new stdClass; - - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::identicalTo($a) - ); - - $this->assertTrue($constraint->evaluate($b, '', true)); - $this->assertFalse($constraint->evaluate($a, '', true)); - $this->assertEquals('is not identical to an object of class "stdClass"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate($a); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) - ); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsIdentical - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::identicalTo - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotIdentical2() - { - $a = new stdClass; - - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::identicalTo($a) - ); - - try { - $constraint->evaluate($a, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsIdentical - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::identicalTo - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotIdentical3() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::identicalTo('a') - ); - - try { - $constraint->evaluate('a', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) - ); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsInstanceOf - * @covers PHPUnit_Framework_Assert::isInstanceOf - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsInstanceOf() - { - $constraint = PHPUnit_Framework_Assert::isInstanceOf('Exception'); - - $this->assertFalse($constraint->evaluate(new stdClass, '', true)); - $this->assertTrue($constraint->evaluate(new Exception, '', true)); - $this->assertEquals('is instance of class "Exception"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - $interfaceConstraint = PHPUnit_Framework_Assert::isInstanceOf('Countable'); - $this->assertFalse($interfaceConstraint->evaluate(new stdClass, '', true)); - $this->assertTrue($interfaceConstraint->evaluate(new ArrayObject, '', true)); - $this->assertEquals('is instance of interface "Countable"', $interfaceConstraint->toString()); - - try { - $constraint->evaluate(new stdClass); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsInstanceOf - * @covers PHPUnit_Framework_Assert::isInstanceOf - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsInstanceOf2() - { - $constraint = PHPUnit_Framework_Assert::isInstanceOf('Exception'); - - try { - $constraint->evaluate(new stdClass, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsInstanceOf - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::isInstanceOf - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotInstanceOf() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::isInstanceOf('stdClass') - ); - - $this->assertFalse($constraint->evaluate(new stdClass, '', true)); - $this->assertTrue($constraint->evaluate(new Exception, '', true)); - $this->assertEquals('is not instance of class "stdClass"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(new stdClass); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsInstanceOf - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::isInstanceOf - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotInstanceOf2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::isInstanceOf('stdClass') - ); - - try { - $constraint->evaluate(new stdClass, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsType - * @covers PHPUnit_Framework_Assert::isType - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsType() - { - $constraint = PHPUnit_Framework_Assert::isType('string'); - - $this->assertFalse($constraint->evaluate(0, '', true)); - $this->assertTrue($constraint->evaluate('', '', true)); - $this->assertEquals('is of type "string"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(new stdClass); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertStringMatchesFormat(<<trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) - ); - - return; - } - - $this->fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsType - * @covers PHPUnit_Framework_Assert::isType - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsType2() - { - $constraint = PHPUnit_Framework_Assert::isType('string'); - - try { - $constraint->evaluate(new stdClass, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertStringMatchesFormat(<<trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) - ); - - return; - } - - $this->fail(); - } - - public function resources() - { - $fh = fopen(__FILE__, 'r'); - fclose($fh); - - return array( - 'open resource' => array(fopen(__FILE__, 'r')), - 'closed resource' => array($fh), - ); - } - - /** - * @dataProvider resources - * @covers PHPUnit_Framework_Constraint_IsType - * @covers PHPUnit_Framework_Assert::isType - */ - public function testConstraintIsResourceTypeEvaluatesCorrectlyWithResources($resource) - { - $constraint = PHPUnit_Framework_Assert::isType('resource'); - - $this->assertTrue($constraint->evaluate($resource, '', true)); - - @fclose($resource); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsType - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::isType - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotType() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::isType('string') - ); - - $this->assertTrue($constraint->evaluate(0, '', true)); - $this->assertFalse($constraint->evaluate('', '', true)); - $this->assertEquals('is not of type "string"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(''); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsType - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::isType - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotType2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::isType('string') - ); - - try { - $constraint->evaluate('', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsNull - * @covers PHPUnit_Framework_Assert::isNull - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNull() - { - $constraint = PHPUnit_Framework_Assert::isNull(); - - $this->assertFalse($constraint->evaluate(0, '', true)); - $this->assertTrue($constraint->evaluate(null, '', true)); - $this->assertEquals('is null', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(0); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsNull - * @covers PHPUnit_Framework_Assert::isNull - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNull2() - { - $constraint = PHPUnit_Framework_Assert::isNull(); - - try { - $constraint->evaluate(0, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsNull - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::isNull - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotNull() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::isNull() - ); - - $this->assertFalse($constraint->evaluate(null, '', true)); - $this->assertTrue($constraint->evaluate(0, '', true)); - $this->assertEquals('is not null', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(null); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsNull - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::isNull - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsNotNull2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::isNull() - ); - - try { - $constraint->evaluate(null, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Assert::lessThan - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintLessThan() - { - $constraint = PHPUnit_Framework_Assert::lessThan(1); - - $this->assertTrue($constraint->evaluate(0, '', true)); - $this->assertFalse($constraint->evaluate(1, '', true)); - $this->assertEquals('is less than 1', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(1); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Assert::lessThan - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintLessThan2() - { - $constraint = PHPUnit_Framework_Assert::lessThan(1); - - try { - $constraint->evaluate(1, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::lessThan - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotLessThan() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::lessThan(1) - ); - - $this->assertTrue($constraint->evaluate(1, '', true)); - $this->assertFalse($constraint->evaluate(0, '', true)); - $this->assertEquals('is not less than 1', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(0); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::lessThan - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotLessThan2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::lessThan(1) - ); - - try { - $constraint->evaluate(0, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Assert::lessThanOrEqual - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintLessThanOrEqual() - { - $constraint = PHPUnit_Framework_Assert::lessThanOrEqual(1); - - $this->assertTrue($constraint->evaluate(1, '', true)); - $this->assertFalse($constraint->evaluate(2, '', true)); - $this->assertEquals('is equal to 1 or is less than 1', $constraint->toString()); - $this->assertEquals(2, count($constraint)); - - try { - $constraint->evaluate(2); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_Callback - */ - public function testConstraintCallback() - { - $closureReflect = function ($parameter) { - return $parameter; - }; - - $closureWithoutParameter = function () { - return true; - }; - - $constraint = PHPUnit_Framework_Assert::callback($closureWithoutParameter); - $this->assertTrue($constraint->evaluate('', '', true)); - - $constraint = PHPUnit_Framework_Assert::callback($closureReflect); - $this->assertTrue($constraint->evaluate(true, '', true)); - $this->assertFalse($constraint->evaluate(false, '', true)); - - $callback = array($this, 'callbackReturningTrue'); - $constraint = PHPUnit_Framework_Assert::callback($callback); - $this->assertTrue($constraint->evaluate(false, '', true)); - - $callback = array('Framework_ConstraintTest', 'staticCallbackReturningTrue'); - $constraint = PHPUnit_Framework_Assert::callback($callback); - $this->assertTrue($constraint->evaluate(null, '', true)); - - $this->assertEquals('is accepted by specified callback', $constraint->toString()); - } - - /** - * @covers PHPUnit_Framework_Constraint_Callback - * @expectedException PHPUnit_Framework_ExpectationFailedException - * @expectedExceptionMessage Failed asserting that 'This fails' is accepted by specified callback. - */ - public function testConstraintCallbackFailure() - { - $constraint = PHPUnit_Framework_Assert::callback(function () { - return false; - }); - $constraint->evaluate('This fails'); - } - - public function callbackReturningTrue() - { - return true; - } - - public static function staticCallbackReturningTrue() - { - return true; - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Assert::lessThanOrEqual - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintLessThanOrEqual2() - { - $constraint = PHPUnit_Framework_Assert::lessThanOrEqual(1); - - try { - $constraint->evaluate(2, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::lessThanOrEqual - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotLessThanOrEqual() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::lessThanOrEqual(1) - ); - - $this->assertTrue($constraint->evaluate(2, '', true)); - $this->assertFalse($constraint->evaluate(1, '', true)); - $this->assertEquals('not( is equal to 1 or is less than 1 )', $constraint->toString()); - $this->assertEquals(2, count($constraint)); - - try { - $constraint->evaluate(1); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEqual - * @covers PHPUnit_Framework_Constraint_LessThan - * @covers PHPUnit_Framework_Constraint_Or - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::lessThanOrEqual - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotLessThanOrEqual2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::lessThanOrEqual(1) - ); - - try { - $constraint->evaluate(1, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasAttribute - * @covers PHPUnit_Framework_Assert::classHasAttribute - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassHasAttribute() - { - $constraint = PHPUnit_Framework_Assert::classHasAttribute('privateAttribute'); - - $this->assertTrue($constraint->evaluate('ClassWithNonPublicAttributes', '', true)); - $this->assertFalse($constraint->evaluate('stdClass', '', true)); - $this->assertEquals('has attribute "privateAttribute"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('stdClass'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasAttribute - * @covers PHPUnit_Framework_Assert::classHasAttribute - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassHasAttribute2() - { - $constraint = PHPUnit_Framework_Assert::classHasAttribute('privateAttribute'); - - try { - $constraint->evaluate('stdClass', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasAttribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::classHasAttribute - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassNotHasAttribute() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::classHasAttribute('privateAttribute') - ); - - $this->assertTrue($constraint->evaluate('stdClass', '', true)); - $this->assertFalse($constraint->evaluate('ClassWithNonPublicAttributes', '', true)); - $this->assertEquals('does not have attribute "privateAttribute"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasAttribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::classHasAttribute - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassNotHasAttribute2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::classHasAttribute('privateAttribute') - ); - - try { - $constraint->evaluate('ClassWithNonPublicAttributes', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute - * @covers PHPUnit_Framework_Assert::classHasStaticAttribute - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassHasStaticAttribute() - { - $constraint = PHPUnit_Framework_Assert::classHasStaticAttribute('privateStaticAttribute'); - - $this->assertTrue($constraint->evaluate('ClassWithNonPublicAttributes', '', true)); - $this->assertFalse($constraint->evaluate('stdClass', '', true)); - $this->assertEquals('has static attribute "privateStaticAttribute"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('stdClass'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute - * @covers PHPUnit_Framework_Assert::classHasStaticAttribute - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassHasStaticAttribute2() - { - $constraint = PHPUnit_Framework_Assert::classHasStaticAttribute('foo'); - - try { - $constraint->evaluate('stdClass', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::classHasStaticAttribute - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassNotHasStaticAttribute() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::classHasStaticAttribute('privateStaticAttribute') - ); - - $this->assertTrue($constraint->evaluate('stdClass', '', true)); - $this->assertFalse($constraint->evaluate('ClassWithNonPublicAttributes', '', true)); - $this->assertEquals('does not have static attribute "privateStaticAttribute"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('ClassWithNonPublicAttributes'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::classHasStaticAttribute - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintClassNotHasStaticAttribute2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::classHasStaticAttribute('privateStaticAttribute') - ); - - try { - $constraint->evaluate('ClassWithNonPublicAttributes', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute - * @covers PHPUnit_Framework_Assert::objectHasAttribute - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintObjectHasAttribute() - { - $constraint = PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute'); - - $this->assertTrue($constraint->evaluate(new ClassWithNonPublicAttributes, '', true)); - $this->assertFalse($constraint->evaluate(new stdClass, '', true)); - $this->assertEquals('has attribute "privateAttribute"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(new stdClass); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute - * @covers PHPUnit_Framework_Assert::objectHasAttribute - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintObjectHasAttribute2() - { - $constraint = PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute'); - - try { - $constraint->evaluate(new stdClass, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::objectHasAttribute - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintObjectNotHasAttribute() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute') - ); - - $this->assertTrue($constraint->evaluate(new stdClass, '', true)); - $this->assertFalse($constraint->evaluate(new ClassWithNonPublicAttributes, '', true)); - $this->assertEquals('does not have attribute "privateAttribute"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(new ClassWithNonPublicAttributes); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::objectHasAttribute - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintObjectNotHasAttribute2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute') - ); - - try { - $constraint->evaluate(new ClassWithNonPublicAttributes, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_PCREMatch - * @covers PHPUnit_Framework_Assert::matchesRegularExpression - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintPCREMatch() - { - $constraint = PHPUnit_Framework_Assert::matchesRegularExpression('/foo/'); - - $this->assertFalse($constraint->evaluate('barbazbar', '', true)); - $this->assertTrue($constraint->evaluate('barfoobar', '', true)); - $this->assertEquals('matches PCRE pattern "/foo/"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('barbazbar'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_PCREMatch - * @covers PHPUnit_Framework_Assert::matchesRegularExpression - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintPCREMatch2() - { - $constraint = PHPUnit_Framework_Assert::matchesRegularExpression('/foo/'); - - try { - $constraint->evaluate('barbazbar', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_PCREMatch - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::matchesRegularExpression - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintPCRENotMatch() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::matchesRegularExpression('/foo/') - ); - - $this->assertTrue($constraint->evaluate('barbazbar', '', true)); - $this->assertFalse($constraint->evaluate('barfoobar', '', true)); - $this->assertEquals('does not match PCRE pattern "/foo/"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('barfoobar'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_PCREMatch - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::matchesRegularExpression - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintPCRENotMatch2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::matchesRegularExpression('/foo/') - ); - - try { - $constraint->evaluate('barfoobar', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals(<<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringMatches - * @covers PHPUnit_Framework_Assert::matches - * @covers PHPUnit_Framework_Constraint::count - */ - public function testConstraintStringMatches() - { - $constraint = PHPUnit_Framework_Assert::matches('*%c*'); - $this->assertFalse($constraint->evaluate('**', '', true)); - $this->assertTrue($constraint->evaluate('***', '', true)); - $this->assertEquals('matches PCRE pattern "/^\*.\*$/s"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringMatches - * @covers PHPUnit_Framework_Assert::matches - * @covers PHPUnit_Framework_Constraint::count - */ - public function testConstraintStringMatches2() - { - $constraint = PHPUnit_Framework_Assert::matches('*%s*'); - $this->assertFalse($constraint->evaluate('**', '', true)); - $this->assertTrue($constraint->evaluate('***', '', true)); - $this->assertEquals('matches PCRE pattern "/^\*[^\r\n]+\*$/s"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringMatches - * @covers PHPUnit_Framework_Assert::matches - * @covers PHPUnit_Framework_Constraint::count - */ - public function testConstraintStringMatches3() - { - $constraint = PHPUnit_Framework_Assert::matches('*%i*'); - $this->assertFalse($constraint->evaluate('**', '', true)); - $this->assertTrue($constraint->evaluate('*0*', '', true)); - $this->assertEquals('matches PCRE pattern "/^\*[+-]?\d+\*$/s"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringMatches - * @covers PHPUnit_Framework_Assert::matches - * @covers PHPUnit_Framework_Constraint::count - */ - public function testConstraintStringMatches4() - { - $constraint = PHPUnit_Framework_Assert::matches('*%d*'); - $this->assertFalse($constraint->evaluate('**', '', true)); - $this->assertTrue($constraint->evaluate('*0*', '', true)); - $this->assertEquals('matches PCRE pattern "/^\*\d+\*$/s"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringMatches - * @covers PHPUnit_Framework_Assert::matches - * @covers PHPUnit_Framework_Constraint::count - */ - public function testConstraintStringMatches5() - { - $constraint = PHPUnit_Framework_Assert::matches('*%x*'); - $this->assertFalse($constraint->evaluate('**', '', true)); - $this->assertTrue($constraint->evaluate('*0f0f0f*', '', true)); - $this->assertEquals('matches PCRE pattern "/^\*[0-9a-fA-F]+\*$/s"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringMatches - * @covers PHPUnit_Framework_Assert::matches - * @covers PHPUnit_Framework_Constraint::count - */ - public function testConstraintStringMatches6() - { - $constraint = PHPUnit_Framework_Assert::matches('*%f*'); - $this->assertFalse($constraint->evaluate('**', '', true)); - $this->assertTrue($constraint->evaluate('*1.0*', '', true)); - $this->assertEquals('matches PCRE pattern "/^\*[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?\*$/s"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringStartsWith - * @covers PHPUnit_Framework_Assert::stringStartsWith - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringStartsWith() - { - $constraint = PHPUnit_Framework_Assert::stringStartsWith('prefix'); - - $this->assertFalse($constraint->evaluate('foo', '', true)); - $this->assertTrue($constraint->evaluate('prefixfoo', '', true)); - $this->assertEquals('starts with "prefix"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('foo'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringStartsWith - * @covers PHPUnit_Framework_Assert::stringStartsWith - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringStartsWith2() - { - $constraint = PHPUnit_Framework_Assert::stringStartsWith('prefix'); - - try { - $constraint->evaluate('foo', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringStartsWith - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::stringStartsWith - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringStartsNotWith() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::stringStartsWith('prefix') - ); - - $this->assertTrue($constraint->evaluate('foo', '', true)); - $this->assertFalse($constraint->evaluate('prefixfoo', '', true)); - $this->assertEquals('starts not with "prefix"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('prefixfoo'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringStartsWith - * @covers PHPUnit_Framework_Assert::stringStartsWith - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringStartsNotWith2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::stringStartsWith('prefix') - ); - - try { - $constraint->evaluate('prefixfoo', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringContains - * @covers PHPUnit_Framework_Assert::stringContains - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringContains() - { - $constraint = PHPUnit_Framework_Assert::stringContains('foo'); - - $this->assertFalse($constraint->evaluate('barbazbar', '', true)); - $this->assertTrue($constraint->evaluate('barfoobar', '', true)); - $this->assertEquals('contains "foo"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('barbazbar'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringContains - * @covers PHPUnit_Framework_Assert::stringContains - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringContains2() - { - $constraint = PHPUnit_Framework_Assert::stringContains('foo'); - - try { - $constraint->evaluate('barbazbar', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringContains - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::stringContains - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringNotContains() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::stringContains('foo') - ); - - $this->assertTrue($constraint->evaluate('barbazbar', '', true)); - $this->assertFalse($constraint->evaluate('barfoobar', '', true)); - $this->assertEquals('does not contain "foo"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('barfoobar'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringContains - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::stringContains - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringNotContains2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::stringContains('foo') - ); - - try { - $constraint->evaluate('barfoobar', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringEndsWith - * @covers PHPUnit_Framework_Assert::stringEndsWith - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringEndsWith() - { - $constraint = PHPUnit_Framework_Assert::stringEndsWith('suffix'); - - $this->assertFalse($constraint->evaluate('foo', '', true)); - $this->assertTrue($constraint->evaluate('foosuffix', '', true)); - $this->assertEquals('ends with "suffix"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('foo'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringEndsWith - * @covers PHPUnit_Framework_Assert::stringEndsWith - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringEndsWith2() - { - $constraint = PHPUnit_Framework_Assert::stringEndsWith('suffix'); - - try { - $constraint->evaluate('foo', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringEndsWith - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::stringEndsWith - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringEndsNotWith() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::stringEndsWith('suffix') - ); - - $this->assertTrue($constraint->evaluate('foo', '', true)); - $this->assertFalse($constraint->evaluate('foosuffix', '', true)); - $this->assertEquals('ends not with "suffix"', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate('foosuffix'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_StringEndsWith - * @covers PHPUnit_Framework_Assert::stringEndsWith - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintStringEndsNotWith2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::stringEndsWith('suffix') - ); - - try { - $constraint->evaluate('foosuffix', 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_TraversableContains - */ - public function testConstraintArrayContainsCheckForObjectIdentity() - { - // Check for primitive type. - $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo', true, true); - - $this->assertFalse($constraint->evaluate(array(0), '', true)); - $this->assertFalse($constraint->evaluate(array(true), '', true)); - - // Default case. - $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo'); - - $this->assertTrue($constraint->evaluate(array(0), '', true)); - $this->assertTrue($constraint->evaluate(array(true), '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_TraversableContains - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayContains() - { - $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo'); - - $this->assertFalse($constraint->evaluate(array('bar'), '', true)); - $this->assertTrue($constraint->evaluate(array('foo'), '', true)); - $this->assertEquals("contains 'foo'", $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(array('bar')); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_TraversableContains - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayContains2() - { - $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo'); - - try { - $constraint->evaluate(array('bar'), 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_TraversableContains - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayNotContains() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - new PHPUnit_Framework_Constraint_TraversableContains('foo') - ); - - $this->assertTrue($constraint->evaluate(array('bar'), '', true)); - $this->assertFalse($constraint->evaluate(array('foo'), '', true)); - $this->assertEquals("does not contain 'foo'", $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(array('foo')); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_TraversableContains - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintArrayNotContains2() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - new PHPUnit_Framework_Constraint_TraversableContains('foo') - ); - - try { - $constraint->evaluate(array('foo'), 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_TraversableContains - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintSplObjectStorageContains() - { - $object = new StdClass; - $constraint = new PHPUnit_Framework_Constraint_TraversableContains($object); - $this->assertStringMatchesFormat('contains stdClass Object &%s ()', $constraint->toString()); - - $storage = new SplObjectStorage; - $this->assertFalse($constraint->evaluate($storage, '', true)); - - $storage->attach($object); - $this->assertTrue($constraint->evaluate($storage, '', true)); - - try { - $constraint->evaluate(new SplObjectStorage); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertStringMatchesFormat( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_TraversableContains - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintSplObjectStorageContains2() - { - $object = new StdClass; - $constraint = new PHPUnit_Framework_Constraint_TraversableContains($object); - - try { - $constraint->evaluate(new SplObjectStorage, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertStringMatchesFormat( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::attributeEqualTo - * @covers PHPUnit_Framework_Constraint_Attribute - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testAttributeEqualTo() - { - $object = new ClassWithNonPublicAttributes; - $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 1); - - $this->assertTrue($constraint->evaluate($object, '', true)); - $this->assertEquals('attribute "foo" is equal to 1', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 2); - - $this->assertFalse($constraint->evaluate($object, '', true)); - - try { - $constraint->evaluate($object); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::attributeEqualTo - * @covers PHPUnit_Framework_Constraint_Attribute - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testAttributeEqualTo2() - { - $object = new ClassWithNonPublicAttributes; - $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 2); - - try { - $constraint->evaluate($object, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::attributeEqualTo - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_Constraint_Attribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testAttributeNotEqualTo() - { - $object = new ClassWithNonPublicAttributes; - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::attributeEqualTo('foo', 2) - ); - - $this->assertTrue($constraint->evaluate($object, '', true)); - $this->assertEquals('attribute "foo" is not equal to 2', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::attributeEqualTo('foo', 1) - ); - - $this->assertFalse($constraint->evaluate($object, '', true)); - - try { - $constraint->evaluate($object); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Assert::attributeEqualTo - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_Constraint_Attribute - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testAttributeNotEqualTo2() - { - $object = new ClassWithNonPublicAttributes; - $constraint = PHPUnit_Framework_Assert::logicalNot( - PHPUnit_Framework_Assert::attributeEqualTo('foo', 1) - ); - - try { - $constraint->evaluate($object, 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEmpty - * @covers PHPUnit_Framework_Constraint::count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsEmpty() - { - $constraint = new PHPUnit_Framework_Constraint_IsEmpty; - - $this->assertFalse($constraint->evaluate(array('foo'), '', true)); - $this->assertTrue($constraint->evaluate(array(), '', true)); - $this->assertFalse($constraint->evaluate(new ArrayObject(array('foo')), '', true)); - $this->assertTrue($constraint->evaluate(new ArrayObject(array()), '', true)); - $this->assertEquals('is empty', $constraint->toString()); - $this->assertEquals(1, count($constraint)); - - try { - $constraint->evaluate(array('foo')); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_IsEmpty - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintIsEmpty2() - { - $constraint = new PHPUnit_Framework_Constraint_IsEmpty; - - try { - $constraint->evaluate(array('foo'), 'custom message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_Count - */ - public function testConstraintCountWithAnArray() - { - $constraint = new PHPUnit_Framework_Constraint_Count(5); - - $this->assertTrue($constraint->evaluate(array(1, 2, 3, 4, 5), '', true)); - $this->assertFalse($constraint->evaluate(array(1, 2, 3, 4), '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_Count - */ - public function testConstraintCountWithAnIteratorWhichDoesNotImplementCountable() - { - $constraint = new PHPUnit_Framework_Constraint_Count(5); - - $this->assertTrue($constraint->evaluate(new TestIterator(array(1, 2, 3, 4, 5)), '', true)); - $this->assertFalse($constraint->evaluate(new TestIterator(array(1, 2, 3, 4)), '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_Count - */ - public function testConstraintCountWithAnObjectImplementingCountable() - { - $constraint = new PHPUnit_Framework_Constraint_Count(5); - - $this->assertTrue($constraint->evaluate(new ArrayObject(array(1, 2, 3, 4, 5)), '', true)); - $this->assertFalse($constraint->evaluate(new ArrayObject(array(1, 2, 3, 4)), '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_Count - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintCountFailing() - { - $constraint = new PHPUnit_Framework_Constraint_Count(5); - - try { - $constraint->evaluate(array(1, 2)); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_Count - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotCountFailing() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - new PHPUnit_Framework_Constraint_Count(2) - ); - - try { - $constraint->evaluate(array(1, 2)); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_SameSize - */ - public function testConstraintSameSizeWithAnArray() - { - $constraint = new PHPUnit_Framework_Constraint_SameSize(array(1, 2, 3, 4, 5)); - - $this->assertTrue($constraint->evaluate(array(6, 7, 8, 9, 10), '', true)); - $this->assertFalse($constraint->evaluate(array(1, 2, 3, 4), '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_SameSize - */ - public function testConstraintSameSizeWithAnIteratorWhichDoesNotImplementCountable() - { - $constraint = new PHPUnit_Framework_Constraint_SameSize(new TestIterator(array(1, 2, 3, 4, 5))); - - $this->assertTrue($constraint->evaluate(new TestIterator(array(6, 7, 8, 9, 10)), '', true)); - $this->assertFalse($constraint->evaluate(new TestIterator(array(1, 2, 3, 4)), '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_SameSize - */ - public function testConstraintSameSizeWithAnObjectImplementingCountable() - { - $constraint = new PHPUnit_Framework_Constraint_SameSize(new ArrayObject(array(1, 2, 3, 4, 5))); - - $this->assertTrue($constraint->evaluate(new ArrayObject(array(6, 7, 8, 9, 10)), '', true)); - $this->assertFalse($constraint->evaluate(new ArrayObject(array(1, 2, 3, 4)), '', true)); - } - - /** - * @covers PHPUnit_Framework_Constraint_SameSize - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintSameSizeFailing() - { - $constraint = new PHPUnit_Framework_Constraint_SameSize(array(1, 2, 3, 4, 5)); - - try { - $constraint->evaluate(array(1, 2)); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_SameSize - * @covers PHPUnit_Framework_Constraint_Not - * @covers PHPUnit_Framework_Assert::logicalNot - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintNotSameSizeFailing() - { - $constraint = PHPUnit_Framework_Assert::logicalNot( - new PHPUnit_Framework_Constraint_SameSize(array(1, 2)) - ); - - try { - $constraint->evaluate(array(3, 4)); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * @covers PHPUnit_Framework_Constraint_Exception - * @covers PHPUnit_Framework_TestFailure::exceptionToString - */ - public function testConstraintException() - { - $constraint = new PHPUnit_Framework_Constraint_Exception('FoobarException'); - $exception = new DummyException('Test'); - $stackTrace = $exception->getTraceAsString(); - - try { - $constraint->evaluate($exception); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $this->assertEquals( - <<fail(); - } - - /** - * Removes spaces in front of newlines - * - * @param string $string - * @return string - */ - private function trimnl($string) - { - return preg_replace('/[ ]*\n/', "\n", $string); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/SuiteTest.php b/vendor/phpunit/phpunit/tests/Framework/SuiteTest.php deleted file mode 100644 index e3f58b3..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/SuiteTest.php +++ /dev/null @@ -1,242 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'BeforeAndAfterTest.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'BeforeClassAndAfterClassTest.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'TestWithTest.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DataProviderSkippedTest.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DataProviderIncompleteTest.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'InheritedTestCase.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NoTestCaseClass.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NoTestCases.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NotPublicTestCase.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NotVoidTestCase.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'OverrideTestCase.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'RequirementsClassBeforeClassHookTest.php'; - -/** - * @since Class available since Release 2.0.0 - * @covers PHPUnit_Framework_TestSuite - */ -class Framework_SuiteTest extends PHPUnit_Framework_TestCase -{ - protected $result; - - protected function setUp() - { - $this->result = new PHPUnit_Framework_TestResult; - } - - public static function suite() - { - $suite = new PHPUnit_Framework_TestSuite; - - $suite->addTest(new self('testAddTestSuite')); - $suite->addTest(new self('testInheritedTests')); - $suite->addTest(new self('testNoTestCases')); - $suite->addTest(new self('testNoTestCaseClass')); - $suite->addTest(new self('testNotExistingTestCase')); - $suite->addTest(new self('testNotPublicTestCase')); - $suite->addTest(new self('testNotVoidTestCase')); - $suite->addTest(new self('testOneTestCase')); - $suite->addTest(new self('testShadowedTests')); - $suite->addTest(new self('testBeforeClassAndAfterClassAnnotations')); - $suite->addTest(new self('testBeforeAnnotation')); - $suite->addTest(new self('testTestWithAnnotation')); - $suite->addTest(new self('testSkippedTestDataProvider')); - $suite->addTest(new self('testIncompleteTestDataProvider')); - $suite->addTest(new self('testRequirementsBeforeClassHook')); - $suite->addTest(new self('testDontSkipInheritedClass')); - - return $suite; - } - - public function testAddTestSuite() - { - $suite = new PHPUnit_Framework_TestSuite( - 'OneTestCase' - ); - - $suite->run($this->result); - - $this->assertEquals(1, count($this->result)); - } - - public function testInheritedTests() - { - $suite = new PHPUnit_Framework_TestSuite( - 'InheritedTestCase' - ); - - $suite->run($this->result); - - $this->assertTrue($this->result->wasSuccessful()); - $this->assertEquals(2, count($this->result)); - } - - public function testNoTestCases() - { - $suite = new PHPUnit_Framework_TestSuite( - 'NoTestCases' - ); - - $suite->run($this->result); - - $this->assertTrue(!$this->result->wasSuccessful()); - $this->assertEquals(1, $this->result->failureCount()); - $this->assertEquals(1, count($this->result)); - } - - /** - * @expectedException PHPUnit_Framework_Exception - */ - public function testNoTestCaseClass() - { - $suite = new PHPUnit_Framework_TestSuite('NoTestCaseClass'); - } - - public function testNotExistingTestCase() - { - $suite = new self('notExistingMethod'); - - $suite->run($this->result); - - $this->assertEquals(0, $this->result->errorCount()); - $this->assertEquals(1, $this->result->failureCount()); - $this->assertEquals(1, count($this->result)); - } - - public function testNotPublicTestCase() - { - $suite = new PHPUnit_Framework_TestSuite( - 'NotPublicTestCase' - ); - - $this->assertEquals(2, count($suite)); - } - - public function testNotVoidTestCase() - { - $suite = new PHPUnit_Framework_TestSuite( - 'NotVoidTestCase' - ); - - $this->assertEquals(1, count($suite)); - } - - public function testOneTestCase() - { - $suite = new PHPUnit_Framework_TestSuite( - 'OneTestCase' - ); - - $suite->run($this->result); - - $this->assertEquals(0, $this->result->errorCount()); - $this->assertEquals(0, $this->result->failureCount()); - $this->assertEquals(1, count($this->result)); - $this->assertTrue($this->result->wasSuccessful()); - } - - public function testShadowedTests() - { - $suite = new PHPUnit_Framework_TestSuite( - 'OverrideTestCase' - ); - - $suite->run($this->result); - - $this->assertEquals(1, count($this->result)); - } - - public function testBeforeClassAndAfterClassAnnotations() - { - $suite = new PHPUnit_Framework_TestSuite( - 'BeforeClassAndAfterClassTest' - ); - - BeforeClassAndAfterClassTest::resetProperties(); - $suite->run($this->result); - - $this->assertEquals(1, BeforeClassAndAfterClassTest::$beforeClassWasRun, '@beforeClass method was not run once for the whole suite.'); - $this->assertEquals(1, BeforeClassAndAfterClassTest::$afterClassWasRun, '@afterClass method was not run once for the whole suite.'); - } - - public function testBeforeAnnotation() - { - $test = new PHPUnit_Framework_TestSuite( - 'BeforeAndAfterTest' - ); - - BeforeAndAfterTest::resetProperties(); - $result = $test->run(); - - $this->assertEquals(2, BeforeAndAfterTest::$beforeWasRun); - $this->assertEquals(2, BeforeAndAfterTest::$afterWasRun); - } - - public function testTestWithAnnotation() - { - $test = new PHPUnit_Framework_TestSuite( - 'TestWithTest' - ); - - BeforeAndAfterTest::resetProperties(); - $result = $test->run(); - - $this->assertEquals(4, count($result->passed())); - } - - public function testSkippedTestDataProvider() - { - $suite = new PHPUnit_Framework_TestSuite('DataProviderSkippedTest'); - - $suite->run($this->result); - - $this->assertEquals(3, $this->result->count()); - $this->assertEquals(1, $this->result->skippedCount()); - } - - public function testIncompleteTestDataProvider() - { - $suite = new PHPUnit_Framework_TestSuite('DataProviderIncompleteTest'); - - $suite->run($this->result); - - $this->assertEquals(3, $this->result->count()); - $this->assertEquals(1, $this->result->notImplementedCount()); - } - - public function testRequirementsBeforeClassHook() - { - $suite = new PHPUnit_Framework_TestSuite( - 'RequirementsClassBeforeClassHookTest' - ); - - $suite->run($this->result); - - $this->assertEquals(0, $this->result->errorCount()); - $this->assertEquals(1, $this->result->skippedCount()); - } - - public function testDontSkipInheritedClass() - { - $suite = new PHPUnit_Framework_TestSuite( - 'DontSkipInheritedClass' - ); - - $dir = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Inheritance' . DIRECTORY_SEPARATOR; - - $suite->addTestFile($dir . 'InheritanceA.php'); - $suite->addTestFile($dir . 'InheritanceB.php'); - $result = $suite->run(); - $this->assertEquals(2, count($result)); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/TestCaseTest.php b/vendor/phpunit/phpunit/tests/Framework/TestCaseTest.php deleted file mode 100644 index 9133278..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/TestCaseTest.php +++ /dev/null @@ -1,550 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NoArgTestCaseTest.php'; -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Singleton.php'; - -$GLOBALS['a'] = 'a'; -$_ENV['b'] = 'b'; -$_POST['c'] = 'c'; -$_GET['d'] = 'd'; -$_COOKIE['e'] = 'e'; -$_SERVER['f'] = 'f'; -$_FILES['g'] = 'g'; -$_REQUEST['h'] = 'h'; -$GLOBALS['i'] = 'i'; - -/** - * @since Class available since Release 2.0.0 - * @covers PHPUnit_Framework_TestCase - */ -class Framework_TestCaseTest extends PHPUnit_Framework_TestCase -{ - protected $backupGlobalsBlacklist = array('i', 'singleton'); - - /** - * Used be testStaticAttributesBackupPre - */ - protected static $_testStatic = 0; - - public function testCaseToString() - { - $this->assertEquals( - 'Framework_TestCaseTest::testCaseToString', - $this->toString() - ); - } - - public function testSuccess() - { - $test = new Success; - $result = $test->run(); - - $this->assertEquals(PHPUnit_Runner_BaseTestRunner::STATUS_PASSED, $test->getStatus()); - $this->assertEquals(0, $result->errorCount()); - $this->assertEquals(0, $result->failureCount()); - $this->assertEquals(0, $result->skippedCount()); - $this->assertEquals(1, count($result)); - } - - public function testFailure() - { - $test = new Failure; - $result = $test->run(); - - $this->assertEquals(PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE, $test->getStatus()); - $this->assertEquals(0, $result->errorCount()); - $this->assertEquals(1, $result->failureCount()); - $this->assertEquals(0, $result->skippedCount()); - $this->assertEquals(1, count($result)); - } - - public function testError() - { - $test = new TestError; - $result = $test->run(); - - $this->assertEquals(PHPUnit_Runner_BaseTestRunner::STATUS_ERROR, $test->getStatus()); - $this->assertEquals(1, $result->errorCount()); - $this->assertEquals(0, $result->failureCount()); - $this->assertEquals(0, $result->skippedCount()); - $this->assertEquals(1, count($result)); - } - - public function testSkipped() - { - $test = new TestSkipped(); - $result = $test->run(); - - $this->assertEquals(PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED, $test->getStatus()); - $this->assertEquals('Skipped test', $test->getStatusMessage()); - $this->assertEquals(0, $result->errorCount()); - $this->assertEquals(0, $result->failureCount()); - $this->assertEquals(1, $result->skippedCount()); - $this->assertEquals(1, count($result)); - } - - public function testIncomplete() - { - $test = new TestIncomplete(); - $result = $test->run(); - - $this->assertEquals(PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE, $test->getStatus()); - $this->assertEquals('Incomplete test', $test->getStatusMessage()); - $this->assertEquals(0, $result->errorCount()); - $this->assertEquals(0, $result->failureCount()); - $this->assertEquals(0, $result->skippedCount()); - $this->assertEquals(1, count($result)); - } - - public function testExceptionInSetUp() - { - $test = new ExceptionInSetUpTest('testSomething'); - $result = $test->run(); - - $this->assertTrue($test->setUp); - $this->assertFalse($test->assertPreConditions); - $this->assertFalse($test->testSomething); - $this->assertFalse($test->assertPostConditions); - $this->assertTrue($test->tearDown); - } - - public function testExceptionInAssertPreConditions() - { - $test = new ExceptionInAssertPreConditionsTest('testSomething'); - $result = $test->run(); - - $this->assertTrue($test->setUp); - $this->assertTrue($test->assertPreConditions); - $this->assertFalse($test->testSomething); - $this->assertFalse($test->assertPostConditions); - $this->assertTrue($test->tearDown); - } - - public function testExceptionInTest() - { - $test = new ExceptionInTest('testSomething'); - $result = $test->run(); - - $this->assertTrue($test->setUp); - $this->assertTrue($test->assertPreConditions); - $this->assertTrue($test->testSomething); - $this->assertFalse($test->assertPostConditions); - $this->assertTrue($test->tearDown); - } - - public function testExceptionInAssertPostConditions() - { - $test = new ExceptionInAssertPostConditionsTest('testSomething'); - $result = $test->run(); - - $this->assertTrue($test->setUp); - $this->assertTrue($test->assertPreConditions); - $this->assertTrue($test->testSomething); - $this->assertTrue($test->assertPostConditions); - $this->assertTrue($test->tearDown); - } - - public function testExceptionInTearDown() - { - $test = new ExceptionInTearDownTest('testSomething'); - $result = $test->run(); - - $this->assertTrue($test->setUp); - $this->assertTrue($test->assertPreConditions); - $this->assertTrue($test->testSomething); - $this->assertTrue($test->assertPostConditions); - $this->assertTrue($test->tearDown); - } - - public function testNoArgTestCasePasses() - { - $result = new PHPUnit_Framework_TestResult; - $t = new PHPUnit_Framework_TestSuite('NoArgTestCaseTest'); - - $t->run($result); - - $this->assertEquals(1, count($result)); - $this->assertEquals(0, $result->failureCount()); - $this->assertEquals(0, $result->errorCount()); - } - - public function testWasRun() - { - $test = new WasRun; - $test->run(); - - $this->assertTrue($test->wasRun); - } - - public function testException() - { - $test = new ThrowExceptionTestCase('test'); - $test->setExpectedException('RuntimeException'); - - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertTrue($result->wasSuccessful()); - } - - public function testExceptionWithMessage() - { - $test = new ThrowExceptionTestCase('test'); - $test->setExpectedException('RuntimeException', 'A runtime error occurred'); - - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertTrue($result->wasSuccessful()); - } - - public function testExceptionWithWrongMessage() - { - $test = new ThrowExceptionTestCase('test'); - $test->setExpectedException('RuntimeException', 'A logic error occurred'); - - $result = $test->run(); - - $this->assertEquals(1, $result->failureCount()); - $this->assertEquals(1, count($result)); - $this->assertEquals( - "Failed asserting that exception message 'A runtime error occurred' contains 'A logic error occurred'.", - $test->getStatusMessage() - ); - } - - public function testExceptionWithRegexpMessage() - { - $test = new ThrowExceptionTestCase('test'); - $test->setExpectedExceptionRegExp('RuntimeException', '/runtime .*? occurred/'); - - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertTrue($result->wasSuccessful()); - } - - public function testExceptionWithWrongRegexpMessage() - { - $test = new ThrowExceptionTestCase('test'); - $test->setExpectedExceptionRegExp('RuntimeException', '/logic .*? occurred/'); - - $result = $test->run(); - - $this->assertEquals(1, $result->failureCount()); - $this->assertEquals(1, count($result)); - $this->assertEquals( - "Failed asserting that exception message 'A runtime error occurred' matches '/logic .*? occurred/'.", - $test->getStatusMessage() - ); - } - - /** - * @covers PHPUnit_Framework_Constraint_ExceptionMessageRegExp - */ - public function testExceptionWithInvalidRegexpMessage() - { - $test = new ThrowExceptionTestCase('test'); - $test->setExpectedExceptionRegExp('RuntimeException', '#runtime .*? occurred/'); // wrong delimiter - - $result = $test->run(); - - $this->assertEquals( - "Invalid expected exception message regex given: '#runtime .*? occurred/'", - $test->getStatusMessage() - ); - } - - public function testNoException() - { - $test = new ThrowNoExceptionTestCase('test'); - $test->setExpectedException('RuntimeException'); - - $result = $test->run(); - - $this->assertEquals(1, $result->failureCount()); - $this->assertEquals(1, count($result)); - } - - public function testWrongException() - { - $test = new ThrowExceptionTestCase('test'); - $test->setExpectedException('InvalidArgumentException'); - - $result = $test->run(); - - $this->assertEquals(1, $result->failureCount()); - $this->assertEquals(1, count($result)); - } - - /** - * @backupGlobals enabled - */ - public function testGlobalsBackupPre() - { - global $a; - global $i; - - $this->assertEquals('a', $a); - $this->assertEquals('a', $GLOBALS['a']); - $this->assertEquals('b', $_ENV['b']); - $this->assertEquals('c', $_POST['c']); - $this->assertEquals('d', $_GET['d']); - $this->assertEquals('e', $_COOKIE['e']); - $this->assertEquals('f', $_SERVER['f']); - $this->assertEquals('g', $_FILES['g']); - $this->assertEquals('h', $_REQUEST['h']); - $this->assertEquals('i', $i); - $this->assertEquals('i', $GLOBALS['i']); - - $GLOBALS['a'] = 'aa'; - $GLOBALS['foo'] = 'bar'; - $_ENV['b'] = 'bb'; - $_POST['c'] = 'cc'; - $_GET['d'] = 'dd'; - $_COOKIE['e'] = 'ee'; - $_SERVER['f'] = 'ff'; - $_FILES['g'] = 'gg'; - $_REQUEST['h'] = 'hh'; - $GLOBALS['i'] = 'ii'; - - $this->assertEquals('aa', $a); - $this->assertEquals('aa', $GLOBALS['a']); - $this->assertEquals('bar', $GLOBALS['foo']); - $this->assertEquals('bb', $_ENV['b']); - $this->assertEquals('cc', $_POST['c']); - $this->assertEquals('dd', $_GET['d']); - $this->assertEquals('ee', $_COOKIE['e']); - $this->assertEquals('ff', $_SERVER['f']); - $this->assertEquals('gg', $_FILES['g']); - $this->assertEquals('hh', $_REQUEST['h']); - $this->assertEquals('ii', $i); - $this->assertEquals('ii', $GLOBALS['i']); - } - - public function testGlobalsBackupPost() - { - global $a; - global $i; - - $this->assertEquals('a', $a); - $this->assertEquals('a', $GLOBALS['a']); - $this->assertEquals('b', $_ENV['b']); - $this->assertEquals('c', $_POST['c']); - $this->assertEquals('d', $_GET['d']); - $this->assertEquals('e', $_COOKIE['e']); - $this->assertEquals('f', $_SERVER['f']); - $this->assertEquals('g', $_FILES['g']); - $this->assertEquals('h', $_REQUEST['h']); - $this->assertEquals('ii', $i); - $this->assertEquals('ii', $GLOBALS['i']); - - $this->assertArrayNotHasKey('foo', $GLOBALS); - } - - /** - * @backupGlobals enabled - * @backupStaticAttributes enabled - */ - public function testStaticAttributesBackupPre() - { - $GLOBALS['singleton'] = Singleton::getInstance(); - self::$_testStatic = 123; - } - - /** - * @depends testStaticAttributesBackupPre - */ - public function testStaticAttributesBackupPost() - { - $this->assertNotSame($GLOBALS['singleton'], Singleton::getInstance()); - $this->assertSame(0, self::$_testStatic); - } - - public function testIsInIsolationReturnsFalse() - { - $test = new IsolationTest('testIsInIsolationReturnsFalse'); - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertTrue($result->wasSuccessful()); - } - - public function testIsInIsolationReturnsTrue() - { - $test = new IsolationTest('testIsInIsolationReturnsTrue'); - $test->setRunTestInSeparateProcess(true); - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertTrue($result->wasSuccessful()); - } - - public function testExpectOutputStringFooActualFoo() - { - $test = new OutputTestCase('testExpectOutputStringFooActualFoo'); - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertTrue($result->wasSuccessful()); - } - - public function testExpectOutputStringFooActualBar() - { - $test = new OutputTestCase('testExpectOutputStringFooActualBar'); - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertFalse($result->wasSuccessful()); - } - - public function testExpectOutputRegexFooActualFoo() - { - $test = new OutputTestCase('testExpectOutputRegexFooActualFoo'); - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertTrue($result->wasSuccessful()); - } - - public function testExpectOutputRegexFooActualBar() - { - $test = new OutputTestCase('testExpectOutputRegexFooActualBar'); - $result = $test->run(); - - $this->assertEquals(1, count($result)); - $this->assertFalse($result->wasSuccessful()); - } - - public function testSkipsIfRequiresHigherVersionOfPHPUnit() - { - $test = new RequirementsTest('testAlwaysSkip'); - $result = $test->run(); - - $this->assertEquals(1, $result->skippedCount()); - $this->assertEquals( - 'PHPUnit 1111111 (or later) is required.', - $test->getStatusMessage() - ); - } - - public function testSkipsIfRequiresHigherVersionOfPHP() - { - $test = new RequirementsTest('testAlwaysSkip2'); - $result = $test->run(); - - $this->assertEquals(1, $result->skippedCount()); - $this->assertEquals( - 'PHP 9999999 (or later) is required.', - $test->getStatusMessage() - ); - } - - public function testSkipsIfRequiresNonExistingOs() - { - $test = new RequirementsTest('testAlwaysSkip3'); - $result = $test->run(); - - $this->assertEquals(1, $result->skippedCount()); - $this->assertEquals( - 'Operating system matching /DOESNOTEXIST/i is required.', - $test->getStatusMessage() - ); - } - - public function testSkipsIfRequiresNonExistingFunction() - { - $test = new RequirementsTest('testNine'); - $result = $test->run(); - - $this->assertEquals(1, $result->skippedCount()); - $this->assertEquals( - 'Function testFunc is required.', - $test->getStatusMessage() - ); - } - - public function testSkipsIfRequiresNonExistingExtension() - { - $test = new RequirementsTest('testTen'); - $result = $test->run(); - - $this->assertEquals( - 'Extension testExt is required.', - $test->getStatusMessage() - ); - } - - public function testSkipsProvidesMessagesForAllSkippingReasons() - { - $test = new RequirementsTest('testAllPossibleRequirements'); - $result = $test->run(); - - $this->assertEquals( - 'PHP 99-dev (or later) is required.' . PHP_EOL . - 'PHPUnit 9-dev (or later) is required.' . PHP_EOL . - 'Operating system matching /DOESNOTEXIST/i is required.' . PHP_EOL . - 'Function testFuncOne is required.' . PHP_EOL . - 'Function testFuncTwo is required.' . PHP_EOL . - 'Extension testExtOne is required.' . PHP_EOL . - 'Extension testExtTwo is required.', - $test->getStatusMessage() - ); - } - - public function testRequiringAnExistingMethodDoesNotSkip() - { - $test = new RequirementsTest('testExistingMethod'); - $result = $test->run(); - $this->assertEquals(0, $result->skippedCount()); - } - - public function testRequiringAnExistingFunctionDoesNotSkip() - { - $test = new RequirementsTest('testExistingFunction'); - $result = $test->run(); - $this->assertEquals(0, $result->skippedCount()); - } - - public function testRequiringAnExistingExtensionDoesNotSkip() - { - $test = new RequirementsTest('testExistingExtension'); - $result = $test->run(); - $this->assertEquals(0, $result->skippedCount()); - } - - public function testRequiringAnExistingOsDoesNotSkip() - { - $test = new RequirementsTest('testExistingOs'); - $result = $test->run(); - $this->assertEquals(0, $result->skippedCount()); - } - - public function testCurrentWorkingDirectoryIsRestored() - { - $expectedCwd = getcwd(); - - $test = new ChangeCurrentWorkingDirectoryTest('testSomethingThatChangesTheCwd'); - $test->run(); - - $this->assertSame($expectedCwd, getcwd()); - } - - /** - * @requires PHP 7 - * @expectedException TypeError - */ - public function testTypeErrorCanBeExpected() - { - $o = new ClassWithScalarTypeDeclarations; - $o->foo(null, null); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/TestFailureTest.php b/vendor/phpunit/phpunit/tests/Framework/TestFailureTest.php deleted file mode 100644 index 8df0a39..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/TestFailureTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since File available since Release 3.7.20 - */ -class Framework_TestFailureTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHPUnit_Framework_TestFailure::toString - */ - public function testToString() - { - $test = new self(__FUNCTION__); - $exception = new PHPUnit_Framework_Exception('message'); - $failure = new PHPUnit_Framework_TestFailure($test, $exception); - - $this->assertEquals(__METHOD__ . ': message', $failure->toString()); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/TestImplementorTest.php b/vendor/phpunit/phpunit/tests/Framework/TestImplementorTest.php deleted file mode 100644 index f10a509..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/TestImplementorTest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 2.0.0 - */ -class Framework_TestImplementorTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHPUnit_Framework_TestCase - */ - public function testSuccessfulRun() - { - $result = new PHPUnit_Framework_TestResult; - - $test = new DoubleTestCase(new Success); - $test->run($result); - - $this->assertEquals(count($test), count($result)); - $this->assertEquals(0, $result->errorCount()); - $this->assertEquals(0, $result->failureCount()); - } -} diff --git a/vendor/phpunit/phpunit/tests/Framework/TestListenerTest.php b/vendor/phpunit/phpunit/tests/Framework/TestListenerTest.php deleted file mode 100644 index 589741b..0000000 --- a/vendor/phpunit/phpunit/tests/Framework/TestListenerTest.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 2.0.0 - * @covers PHPUnit_Framework_TestCase - */ -class Framework_TestListenerTest extends PHPUnit_Framework_TestCase implements PHPUnit_Framework_TestListener -{ - protected $endCount; - protected $errorCount; - protected $failureCount; - protected $notImplementedCount; - protected $riskyCount; - protected $skippedCount; - protected $result; - protected $startCount; - - public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) - { - $this->errorCount++; - } - - public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) - { - $this->failureCount++; - } - - public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) - { - $this->notImplementedCount++; - } - - public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) - { - $this->riskyCount++; - } - - public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) - { - $this->skippedCount++; - } - - public function startTestSuite(PHPUnit_Framework_TestSuite $suite) - { - } - - public function endTestSuite(PHPUnit_Framework_TestSuite $suite) - { - } - - public function startTest(PHPUnit_Framework_Test $test) - { - $this->startCount++; - } - - public function endTest(PHPUnit_Framework_Test $test, $time) - { - $this->endCount++; - } - - protected function setUp() - { - $this->result = new PHPUnit_Framework_TestResult; - $this->result->addListener($this); - - $this->endCount = 0; - $this->failureCount = 0; - $this->notImplementedCount = 0; - $this->riskyCount = 0; - $this->skippedCount = 0; - $this->startCount = 0; - } - - public function testError() - { - $test = new TestError; - $test->run($this->result); - - $this->assertEquals(1, $this->errorCount); - $this->assertEquals(1, $this->endCount); - } - - public function testFailure() - { - $test = new Failure; - $test->run($this->result); - - $this->assertEquals(1, $this->failureCount); - $this->assertEquals(1, $this->endCount); - } - - public function testStartStop() - { - $test = new Success; - $test->run($this->result); - - $this->assertEquals(1, $this->startCount); - $this->assertEquals(1, $this->endCount); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/1021.phpt b/vendor/phpunit/phpunit/tests/Regression/1021.phpt deleted file mode 100644 index 45f4708..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/1021.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -#1021: Depending on a test that uses a data provider does not work ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/1021/Issue1021Test.php b/vendor/phpunit/phpunit/tests/Regression/1021/Issue1021Test.php deleted file mode 100644 index 5814e94..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/1021/Issue1021Test.php +++ /dev/null @@ -1,23 +0,0 @@ -assertTrue($data); - } - - /** - * @depends testSomething - */ - public function testSomethingElse() - { - } - - public function provider() - { - return array(array(true)); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/523.phpt b/vendor/phpunit/phpunit/tests/Regression/523.phpt deleted file mode 100644 index 6ba2e42..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/523.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -#523: assertAttributeEquals does not work with classes extending ArrayIterator ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/523/Issue523Test.php b/vendor/phpunit/phpunit/tests/Regression/523/Issue523Test.php deleted file mode 100644 index 80124f1..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/523/Issue523Test.php +++ /dev/null @@ -1,13 +0,0 @@ -assertAttributeEquals('foo', 'field', new Issue523()); - } -}; - -class Issue523 extends ArrayIterator -{ - protected $field = 'foo'; -} diff --git a/vendor/phpunit/phpunit/tests/Regression/578.phpt b/vendor/phpunit/phpunit/tests/Regression/578.phpt deleted file mode 100644 index c50d2e3..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/578.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -#578: Double printing of trace line for exceptions from notices and warnings ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -EEE - -Time: %s, Memory: %sMb - -There were 3 errors: - -1) Issue578Test::testNoticesDoublePrintStackTrace -Invalid error type specified - -%sIssue578Test.php:%i - -2) Issue578Test::testWarningsDoublePrintStackTrace -Invalid error type specified - -%sIssue578Test.php:%i - -3) Issue578Test::testUnexpectedExceptionsPrintsCorrectly -Exception: Double printed exception - -%sIssue578Test.php:%i - -FAILURES! -Tests: 3, Assertions: 0, Errors: 3. diff --git a/vendor/phpunit/phpunit/tests/Regression/578/Issue578Test.php b/vendor/phpunit/phpunit/tests/Regression/578/Issue578Test.php deleted file mode 100644 index 262d97f..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/578/Issue578Test.php +++ /dev/null @@ -1,20 +0,0 @@ -iniSet('error_reporting', E_ALL | E_NOTICE); - trigger_error('Stack Trace Test Notice', E_NOTICE); - } - - public function testWarningsDoublePrintStackTrace() - { - $this->iniSet('error_reporting', E_ALL | E_NOTICE); - trigger_error('Stack Trace Test Notice', E_WARNING); - } - - public function testUnexpectedExceptionsPrintsCorrectly() - { - throw new Exception('Double printed exception'); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/684.phpt b/vendor/phpunit/phpunit/tests/Regression/684.phpt deleted file mode 100644 index ca88a55..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/684.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -#684: Unable to find test class when no test methods exists ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Warning -No tests found in class "Foo_Bar_Issue684Test". - -FAILURES! -Tests: 1, Assertions: 0, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/684/Issue684Test.php b/vendor/phpunit/phpunit/tests/Regression/684/Issue684Test.php deleted file mode 100644 index e8e5d87..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/684/Issue684Test.php +++ /dev/null @@ -1,4 +0,0 @@ - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 0 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/783/ChildSuite.php b/vendor/phpunit/phpunit/tests/Regression/783/ChildSuite.php deleted file mode 100644 index 8bac514..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/783/ChildSuite.php +++ /dev/null @@ -1,15 +0,0 @@ -addTestSuite('OneTest'); - $suite->addTestSuite('TwoTest'); - - return $suite; - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/783/OneTest.php b/vendor/phpunit/phpunit/tests/Regression/783/OneTest.php deleted file mode 100644 index 7195158..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/783/OneTest.php +++ /dev/null @@ -1,10 +0,0 @@ -addTest(ChildSuite::suite()); - - return $suite; - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/783/TwoTest.php b/vendor/phpunit/phpunit/tests/Regression/783/TwoTest.php deleted file mode 100644 index 580246c..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/783/TwoTest.php +++ /dev/null @@ -1,10 +0,0 @@ - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.1.2 - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1149/Issue1149Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1149/Issue1149Test.php deleted file mode 100644 index 01ac870..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1149/Issue1149Test.php +++ /dev/null @@ -1,18 +0,0 @@ -assertTrue(true); - print '1'; - } - - /** - * @runInSeparateProcess - */ - public function testTwo() - { - $this->assertTrue(true); - print '2'; - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1216.phpt deleted file mode 100644 index d13403b..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -GH-1216: PHPUnit bootstrap must take globals vars even when the file is specified in command line ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - -Starting test 'Issue1216Test::testConfigAvailableInBootstrap'. -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216/Issue1216Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1216/Issue1216Test.php deleted file mode 100644 index cfceaf5..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216/Issue1216Test.php +++ /dev/null @@ -1,8 +0,0 @@ -assertTrue($_ENV['configAvailableInBootstrap']); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216/bootstrap1216.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1216/bootstrap1216.php deleted file mode 100644 index cec2724..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216/bootstrap1216.php +++ /dev/null @@ -1,2 +0,0 @@ - - - Issue1216Test.php - - - - - diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1265.phpt deleted file mode 100644 index a179d5d..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -GH-1265: Could not use "PHPUnit_Runner_StandardTestSuiteLoader" as loader ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265/Issue1265Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1265/Issue1265Test.php deleted file mode 100644 index 68d71b3..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265/Issue1265Test.php +++ /dev/null @@ -1,8 +0,0 @@ -assertTrue(true); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265/phpunit1265.xml b/vendor/phpunit/phpunit/tests/Regression/GitHub/1265/phpunit1265.xml deleted file mode 100644 index 27fdd52..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265/phpunit1265.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1330.phpt deleted file mode 100644 index c31073e..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -GH-1330: Allow non-ambiguous shortened longopts ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - -Starting test 'Issue1330Test::testTrue'. -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330/Issue1330Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1330/Issue1330Test.php deleted file mode 100644 index 0829cb9..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330/Issue1330Test.php +++ /dev/null @@ -1,8 +0,0 @@ -assertTrue(PHPUNIT_1330); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330/phpunit1330.xml b/vendor/phpunit/phpunit/tests/Regression/GitHub/1330/phpunit1330.xml deleted file mode 100644 index a61e0cc..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330/phpunit1330.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1335.phpt deleted file mode 100644 index cd6aade..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -GH-1335: exportVariable multiple backslash problem ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -............ - -Time: %s, Memory: %sMb - -OK (12 tests, 12 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335/Issue1335Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1335/Issue1335Test.php deleted file mode 100644 index 4407ec8..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335/Issue1335Test.php +++ /dev/null @@ -1,67 +0,0 @@ -assertEquals('Hello', $GLOBALS['globalString']); - } - - public function testGlobalIntTruthy() - { - $this->assertEquals(1, $GLOBALS['globalIntTruthy']); - } - - public function testGlobalIntFalsey() - { - $this->assertEquals(0, $GLOBALS['globalIntFalsey']); - } - - public function testGlobalFloat() - { - $this->assertEquals(1.123, $GLOBALS['globalFloat']); - } - - public function testGlobalBoolTrue() - { - $this->assertEquals(true, $GLOBALS['globalBoolTrue']); - } - - public function testGlobalBoolFalse() - { - $this->assertEquals(false, $GLOBALS['globalBoolFalse']); - } - - public function testGlobalNull() - { - $this->assertEquals(null, $GLOBALS['globalNull']); - } - - public function testGlobalArray() - { - $this->assertEquals(array('foo'), $GLOBALS['globalArray']); - } - - public function testGlobalNestedArray() - { - $this->assertEquals(array(array('foo')), $GLOBALS['globalNestedArray']); - } - - public function testGlobalObject() - { - $this->assertEquals((object) array('foo'=> 'bar'), $GLOBALS['globalObject']); - } - - public function testGlobalObjectWithBackSlashString() - { - $this->assertEquals((object) array('foo'=> 'back\\slash'), $GLOBALS['globalObjectWithBackSlashString']); - } - - public function testGlobalObjectWithDoubleBackSlashString() - { - $this->assertEquals((object) array('foo'=> 'back\\\\slash'), $GLOBALS['globalObjectWithDoubleBackSlashString']); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335/bootstrap1335.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1335/bootstrap1335.php deleted file mode 100644 index 073a87e..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335/bootstrap1335.php +++ /dev/null @@ -1,13 +0,0 @@ - 'bar'); -$globalObjectWithBackSlashString = (object) array('foo'=> 'back\\slash'); -$globalObjectWithDoubleBackSlashString = (object) array('foo'=> 'back\\\\slash'); diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1337.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1337.phpt deleted file mode 100644 index 9c1d76f..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1337.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -GH-1337: Data Provider with \ at the end of the name breaks with process isolation ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) \ No newline at end of file diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1337/Issue1337Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1337/Issue1337Test.php deleted file mode 100644 index b972b2a..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1337/Issue1337Test.php +++ /dev/null @@ -1,19 +0,0 @@ -assertTrue($a); - } - - public function dataProvider() - { - return array( - 'c:\\'=> array(true), - 0.9 => array(true) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1348.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1348.phpt deleted file mode 100644 index 82f94ec..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1348.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -GH-1348: STDOUT/STDERR IO streams should exist in process isolation ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. -STDOUT does not break test result -E - -Time: %s, Memory: %sMb - -There was 1 error: - -1) Issue1348Test::testSTDERR -PHPUnit_Framework_Exception: STDERR works as usual. - -FAILURES! -Tests: 2, Assertions: 1, Errors: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1348/Issue1348Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1348/Issue1348Test.php deleted file mode 100644 index d3c82f0..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1348/Issue1348Test.php +++ /dev/null @@ -1,14 +0,0 @@ -assertTrue(true); - } - - public function testSTDERR() - { - fwrite(STDERR, 'STDERR works as usual.'); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1351.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1351.phpt deleted file mode 100644 index 2dbc2af..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1351.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -GH-1351: Test result does not serialize test class in process isolation ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F.E.E - -Time: %s, Memory: %sMb - -There were 2 errors: - -1) Issue1351Test::testExceptionPre -RuntimeException: Expected rethrown exception. -%A -Caused by -LogicException: Expected exception. -%A - -2) Issue1351Test::testPhpCoreLanguageException -PDOException: SQLSTATE[HY000]: General error: 1 no such table: php_wtf -%A - --- - -There was 1 failure: - -1) Issue1351Test::testFailurePre -Expected failure. -%A -FAILURES! -Tests: 5, Assertions: 5, Errors: 2, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1351/ChildProcessClass1351.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1351/ChildProcessClass1351.php deleted file mode 100644 index 24c0537..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1351/ChildProcessClass1351.php +++ /dev/null @@ -1,4 +0,0 @@ -instance = new ChildProcessClass1351(); - $this->assertFalse(true, 'Expected failure.'); - } - - public function testFailurePost() - { - $this->assertNull($this->instance); - $this->assertFalse(class_exists('ChildProcessClass1351', false), 'ChildProcessClass1351 is not loaded.'); - } - - /** - * @runInSeparateProcess - */ - public function testExceptionPre() - { - $this->instance = new ChildProcessClass1351(); - try { - throw new LogicException('Expected exception.'); - } catch (LogicException $e) { - throw new RuntimeException('Expected rethrown exception.', 0, $e); - } - } - - public function testExceptionPost() - { - $this->assertNull($this->instance); - $this->assertFalse(class_exists('ChildProcessClass1351', false), 'ChildProcessClass1351 is not loaded.'); - } - - public function testPhpCoreLanguageException() - { - // User-space code cannot instantiate a PDOException with a string code, - // so trigger a real one. - $connection = new PDO('sqlite::memory:'); - $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $connection->query("DELETE FROM php_wtf WHERE exception_code = 'STRING'"); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1374.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1374.phpt deleted file mode 100644 index 84d13be..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1374.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -GH-1374: tearDown() is called despite unmet requirements ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -S - -Time: %s, Memory: %sMb - -OK, but incomplete, skipped, or risky tests! -Tests: 1, Assertions: 0, Skipped: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1374/Issue1374Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1374/Issue1374Test.php deleted file mode 100644 index ad6a3bf..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1374/Issue1374Test.php +++ /dev/null @@ -1,21 +0,0 @@ -fail('This should not be reached'); - } - - protected function tearDown() - { - print __FUNCTION__; - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1437.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1437.phpt deleted file mode 100644 index f9bd41b..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1437.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -GH-1437: Risky test messages mask failures ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Issue1437Test::testFailure -Failed asserting that false is true. - -%sIssue1437Test.php:%i - -FAILURES! -Tests: 1, Assertions: 1, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1437/Issue1437Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1437/Issue1437Test.php deleted file mode 100644 index bff4b20..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1437/Issue1437Test.php +++ /dev/null @@ -1,9 +0,0 @@ -assertTrue(false); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1468.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1468.phpt deleted file mode 100644 index 23c410b..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1468.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -GH-1468: Incomplete and @todo annotated tests are counted twice ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -I - -Time: %s, Memory: %sMb - -OK, but incomplete, skipped, or risky tests! -Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1468/Issue1468Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1468/Issue1468Test.php deleted file mode 100644 index 535b25b..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1468/Issue1468Test.php +++ /dev/null @@ -1,11 +0,0 @@ -markTestIncomplete(); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1471.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1471.phpt deleted file mode 100644 index 631d6e6..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1471.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -GH-1471: Output made while test is running is printed although expectOutputString() is used when an assertion fails ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Issue1471Test::testFailure -Failed asserting that false is true. - -%s/Issue1471Test.php:10 - -FAILURES! -Tests: 1, Assertions: 1, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1471/Issue1471Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1471/Issue1471Test.php deleted file mode 100644 index 28f1274..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1471/Issue1471Test.php +++ /dev/null @@ -1,12 +0,0 @@ -expectOutputString('*'); - - print '*'; - - $this->assertTrue(false); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1472.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1472.phpt deleted file mode 100644 index 3e605b4..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1472.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -GH-1472: assertEqualXMLStructure modifies the tested elements ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 4 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1472/Issue1472Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1472/Issue1472Test.php deleted file mode 100644 index a392773..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1472/Issue1472Test.php +++ /dev/null @@ -1,21 +0,0 @@ -loadXML(''); - - $xpath = new DOMXPath($doc); - - $labelElement = $doc->getElementsByTagName('label')->item(0); - - $this->assertEquals(1, $xpath->evaluate('count(//label[text() = "text content"])')); - - $expectedElmt = $doc->createElement('label', 'text content'); - $this->assertEqualXMLStructure($expectedElmt, $labelElement); - - // the following assertion fails, even though it passed before - which is due to the assertEqualXMLStructure() has modified the $labelElement - $this->assertEquals(1, $xpath->evaluate('count(//label[text() = "text content"])')); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1570.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1570.phpt deleted file mode 100644 index a94b961..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1570.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -GH-1570: Test that prints output is marked as failure and not as risky when --disallow-test-output is used ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -R* - -Time: %s, Memory: %sMb - -OK, but incomplete, skipped, or risky tests! -Tests: 1, Assertions: 0, Risky: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1570/Issue1570Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/1570/Issue1570Test.php deleted file mode 100644 index 0cb1b65..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1570/Issue1570Test.php +++ /dev/null @@ -1,8 +0,0 @@ - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.FFF - -Time: %s, Memory: %sMb - -There were 3 failures: - -1) Issue244Test::testFails -Failed asserting that '123StringCode' is equal to expected exception code 'OtherString'. - -2) Issue244Test::testFailsTooIfExpectationIsANumber -Failed asserting that '123StringCode' is equal to expected exception code 123. - -3) Issue244Test::testFailsTooIfExceptionCodeIsANumber -Failed asserting that 123 is equal to expected exception code '123String'. - -FAILURES! -Tests: 4, Assertions: 8, Failures: 3. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/244/Issue244Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/244/Issue244Test.php deleted file mode 100644 index 621c4cf..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/244/Issue244Test.php +++ /dev/null @@ -1,55 +0,0 @@ -code = '123StringCode'; - } -} - -class Issue244ExceptionIntCode extends Exception -{ - public function __construct() - { - $this->code = 123; - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/322.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/322.phpt deleted file mode 100644 index 0d892c7..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/322.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -GH-322: group commandline option should override group/exclude setting in phpunit.xml ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - -Starting test 'Issue322Test::testOne'. -. - -Time: %s, Memory: %sMb - -OK (1 test, 0 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/322/Issue322Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/322/Issue322Test.php deleted file mode 100644 index 618bcaa..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/322/Issue322Test.php +++ /dev/null @@ -1,17 +0,0 @@ - - - Test.php - - - - - one - - - diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/433.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/433.phpt deleted file mode 100644 index ead9437..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/433.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -GH-433: expectOutputString not completely working as expected ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -..F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Issue433Test::testNotMatchingOutput -Failed asserting that two strings are equal. ---- Expected -+++ Actual -@@ @@ --'foo' -+'bar' - -FAILURES! -Tests: 3, Assertions: 3, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/433/Issue433Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/433/Issue433Test.php deleted file mode 100644 index e0a91b3..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/433/Issue433Test.php +++ /dev/null @@ -1,21 +0,0 @@ -expectOutputString('test'); - print 'test'; - } - - public function testOutputWithExpectationAfter() - { - print 'test'; - $this->expectOutputString('test'); - } - - public function testNotMatchingOutput() - { - print 'bar'; - $this->expectOutputString('foo'); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/445.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/445.phpt deleted file mode 100644 index e57e7fb..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/445.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -GH-455: expectOutputString not working in strict mode ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -..F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Issue445Test::testNotMatchingOutput -Failed asserting that two strings are equal. ---- Expected -+++ Actual -@@ @@ --'foo' -+'bar' - -FAILURES! -Tests: 3, Assertions: 3, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/445/Issue445Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/445/Issue445Test.php deleted file mode 100644 index c309025..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/445/Issue445Test.php +++ /dev/null @@ -1,21 +0,0 @@ -expectOutputString('test'); - print 'test'; - } - - public function testOutputWithExpectationAfter() - { - print 'test'; - $this->expectOutputString('test'); - } - - public function testNotMatchingOutput() - { - print 'bar'; - $this->expectOutputString('foo'); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/498.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/498.phpt deleted file mode 100644 index 51dbe75..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/498.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -GH-498: The test methods won't be run if a dataProvider throws Exception and --group is added in command line ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Warning -The data provider specified for Issue498Test::shouldBeFalse is invalid. -Can't create the data - -FAILURES! -Tests: 1, Assertions: 0, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/498/Issue498Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/498/Issue498Test.php deleted file mode 100644 index 49fa764..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/498/Issue498Test.php +++ /dev/null @@ -1,44 +0,0 @@ -assertTrue(true); - } - - /** - * @test - * @dataProvider shouldBeFalseDataProvider - * @group trueOnly - */ - public function shouldBeFalse($testData) - { - $this->assertFalse(false); - } - - public function shouldBeTrueDataProvider() - { - - //throw new Exception("Can't create the data"); - return array( - array(true), - array(false) - ); - } - - public function shouldBeFalseDataProvider() - { - throw new Exception("Can't create the data"); - - return array( - array(true), - array(false) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/503.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/503.phpt deleted file mode 100644 index 2e7b30f..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/503.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -GH-503: assertEquals() Line Ending Differences Are Obscure ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Issue503Test::testCompareDifferentLineEndings -Failed asserting that two strings are identical. ---- Expected -+++ Actual -@@ @@ - #Warning: Strings contain different line endings! - foo - -%s:%i - -FAILURES! -Tests: 1, Assertions: 1, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/503/Issue503Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/503/Issue503Test.php deleted file mode 100644 index 75ca8d4..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/503/Issue503Test.php +++ /dev/null @@ -1,11 +0,0 @@ -assertSame( - "foo\n", - "foo\r\n" - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/581.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/581.phpt deleted file mode 100644 index c2d6545..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/581.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -GH-581: PHPUnit_Util_Type::export adds extra newlines in Windows ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Issue581Test::testExportingObjectsDoesNotBreakWindowsLineFeeds -Failed asserting that two objects are equal. ---- Expected -+++ Actual -@@ @@ - stdClass Object ( - 0 => 1 - 1 => 2 - 2 => 'Test\n' - 3 => 4 -- 4 => 5 -+ 4 => 1 - 5 => 6 - 6 => 7 - 7 => 8 - ) - -%s:%i - -FAILURES! -Tests: 1, Assertions: 1, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/581/Issue581Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/581/Issue581Test.php deleted file mode 100644 index 51de83b..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/581/Issue581Test.php +++ /dev/null @@ -1,11 +0,0 @@ -assertEquals( - (object) array(1, 2, "Test\r\n", 4, 5, 6, 7, 8), - (object) array(1, 2, "Test\r\n", 4, 1, 6, 7, 8) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/74.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/74.phpt deleted file mode 100644 index 8a4f79d..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/74.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -GH-74: catchable fatal error in 3.5 ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -E - -Time: %s, Memory: %sMb - -There was 1 error: - -1) Issue74Test::testCreateAndThrowNewExceptionInProcessIsolation -NewException: Testing GH-74 - -%sIssue74Test.php:7 - -FAILURES! -Tests: 1, Assertions: 0, Errors: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/74/Issue74Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/74/Issue74Test.php deleted file mode 100644 index 72f3592..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/74/Issue74Test.php +++ /dev/null @@ -1,9 +0,0 @@ - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Warning -The data provider specified for Issue765Test::testDependent is invalid. - -FAILURES! -Tests: 2, Assertions: 1, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/765/Issue765Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/765/Issue765Test.php deleted file mode 100644 index a47474b..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/765/Issue765Test.php +++ /dev/null @@ -1,22 +0,0 @@ -assertTrue(true); - } - - /** - * @depends testDependee - * @dataProvider dependentProvider - */ - public function testDependent($a) - { - $this->assertTrue(true); - } - - public function dependentProvider() - { - throw new Exception; - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/797.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/797.phpt deleted file mode 100644 index 4a6490f..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/797.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -GH-797: Disabled $preserveGlobalState does not load bootstrap.php. ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) \ No newline at end of file diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/797/Issue797Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/797/Issue797Test.php deleted file mode 100644 index b1c1b8f..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/797/Issue797Test.php +++ /dev/null @@ -1,10 +0,0 @@ -assertEquals(GITHUB_ISSUE, 797); - } -} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/797/bootstrap797.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/797/bootstrap797.php deleted file mode 100644 index 03890a3..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/797/bootstrap797.php +++ /dev/null @@ -1,6 +0,0 @@ - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -............................................................... 63 / 150 ( 42%) -............................................................... 126 / 150 ( 84%) -........................ - -Time: %s, Memory: %sMb - -OK (150 tests, 150 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/873-php5.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/873-php5.phpt deleted file mode 100644 index 89b7402..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/873-php5.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -GH-873: PHPUnit suppresses exceptions thrown outside of test case function ---SKIPIF-- - 5) { - print 'skip: PHP 5 is required'; -} -?> ---FILE-- - ---EXPECTF-- - -Fatal error: Uncaught exception 'Exception' with message 'PHPUnit suppresses exceptions thrown outside of test case function' in %s:%i -Stack trace: -%a diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/873-php7.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/873-php7.phpt deleted file mode 100644 index b022f99..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/873-php7.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -GH-873: PHPUnit suppresses exceptions thrown outside of test case function ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Uncaught Exception: PHPUnit suppresses exceptions thrown outside of test case function in %s:%i -Stack trace: -%a diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/873/Issue873Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/873/Issue873Test.php deleted file mode 100644 index 70fd904..0000000 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/873/Issue873Test.php +++ /dev/null @@ -1,9 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 2.0.0 - * @covers PHPUnit_Runner_BaseTestRunner - */ -class Runner_BaseTestRunnerTest extends PHPUnit_Framework_TestCase -{ - public function testInvokeNonStaticSuite() - { - $runner = new MockRunner; - $runner->getTest('NonStatic'); - } -} diff --git a/vendor/phpunit/phpunit/tests/TextUI/abstract-test-class.phpt b/vendor/phpunit/phpunit/tests/TextUI/abstract-test-class.phpt deleted file mode 100644 index 8d6c07a..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/abstract-test-class.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -phpunit AbstractTest ../_files/AbstractTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Warning -Cannot instantiate class "AbstractTest". - -FAILURES! -Tests: 1, Assertions: 0, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/colors-always.phpt b/vendor/phpunit/phpunit/tests/TextUI/colors-always.phpt deleted file mode 100644 index 28b527d..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/colors-always.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit --colors=always BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -%s[30;42mOK (3 tests, 3 assertions)%s[0m diff --git a/vendor/phpunit/phpunit/tests/TextUI/concrete-test-class.phpt b/vendor/phpunit/phpunit/tests/TextUI/concrete-test-class.phpt deleted file mode 100644 index f01bd79..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/concrete-test-class.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit ConcreteTest ../_files/ConcreteTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 0 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-debug.phpt b/vendor/phpunit/phpunit/tests/TextUI/custom-printer-debug.phpt deleted file mode 100644 index 19b9e05..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-debug.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -phpunit -c ../_files/configuration.custom-printer.xml --debug BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - -Starting test 'BankAccountTest::testBalanceIsInitiallyZero'. -. -Starting test 'BankAccountTest::testBalanceCannotBecomeNegative'. -. -Starting test 'BankAccountTest::testBalanceCannotBecomeNegative2'. -. - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-verbose.phpt b/vendor/phpunit/phpunit/tests/TextUI/custom-printer-verbose.phpt deleted file mode 100644 index 2e2a990..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-verbose.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -phpunit -c ../_files/configuration.custom-printer.xml --verbose IncompleteTest ../_files/IncompleteTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Runtime: %s -Configuration: %sconfiguration.custom-printer.xml - -I - -Time: %s, Memory: %sMb - -There was 1 incomplete test: - -1) IncompleteTest::testIncomplete -Test incomplete - -%s - -OK, but incomplete, skipped, or risky tests! -Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-debug.phpt b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-debug.phpt deleted file mode 100644 index e7e49b4..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-debug.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -phpunit --debug DataProviderDebugTest ../_files/DataProviderDebugTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - -Starting test 'DataProviderDebugTest::testProvider with data set #0 (null, true, 1, 1.0)'. -. -Starting test 'DataProviderDebugTest::testProvider with data set #1 (1.2, resource(%d) of type (stream), '1')'. -. -Starting test 'DataProviderDebugTest::testProvider with data set #2 (array(array(1, 2, 3), array(3, 4, 5)))'. -. -Starting test 'DataProviderDebugTest::testProvider with data set #3 ('this\nis\na\nvery\nvery\nvery\nvery...g\ntext')'. -. -Starting test 'DataProviderDebugTest::testProvider with data set #4 (stdClass Object (), stdClass Object (...), array(), SplObjectStorage Object (...), stdClass Object (...))'. -. -Starting test 'DataProviderDebugTest::testProvider with data set #5 (Binary String: 0x000102030405, Binary String: 0x0e0f101112131...c1d1e1f)'. -. -Starting test 'DataProviderDebugTest::testProvider with data set #6 (Binary String: 0x0009)'. -. - -Time: %s, Memory: %sMb - -OK (7 tests, 7 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml-isolation.phpt deleted file mode 100644 index e1c4571..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml-isolation.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -phpunit --process-isolation --log-junit php://stdout DataProviderTest ../_files/DataProviderTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -..F. - - - - - - - DataProviderTest::testAdd with data set #2 (1, 1, 3) -Failed asserting that 2 matches expected 3. - -%s:%i - - - - - - - - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) DataProviderTest::testAdd with data set #2 (1, 1, 3) -Failed asserting that 2 matches expected 3. - -%s:%i - -FAILURES! -Tests: 4, Assertions: 4, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml.phpt b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml.phpt deleted file mode 100644 index a14b466..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -phpunit --log-junit php://stdout DataProviderTest ../_files/DataProviderTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -..F. - - - - - - - DataProviderTest::testAdd with data set #2 (1, 1, 3) -Failed asserting that 2 matches expected 3. - -%s:%i - - - - - - - - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) DataProviderTest::testAdd with data set #2 (1, 1, 3) -Failed asserting that 2 matches expected 3. - -%s:%i - -FAILURES! -Tests: 4, Assertions: 4, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-testdox.phpt b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-testdox.phpt deleted file mode 100644 index 75973fe..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-testdox.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -phpunit --testdox DataProviderTest ../_files/DataProviderTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -DataProvider - [ ] Add diff --git a/vendor/phpunit/phpunit/tests/TextUI/debug.phpt b/vendor/phpunit/phpunit/tests/TextUI/debug.phpt deleted file mode 100644 index 1639484..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/debug.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -phpunit --debug BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - -Starting test 'BankAccountTest::testBalanceIsInitiallyZero'. -. -Starting test 'BankAccountTest::testBalanceCannotBecomeNegative'. -. -Starting test 'BankAccountTest::testBalanceCannotBecomeNegative2'. -. - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/default-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/default-isolation.phpt deleted file mode 100644 index 864484c..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/default-isolation.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -phpunit --process-isolation BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/default.phpt b/vendor/phpunit/phpunit/tests/TextUI/default.phpt deleted file mode 100644 index 9fefe1a..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/default.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies-isolation.phpt deleted file mode 100644 index 226d3d8..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies-isolation.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -phpunit --process-isolation --verbose DependencyTestSuite ../_files/DependencyTestSuite.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Runtime: %s - -...FSS - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) DependencyFailureTest::testOne - -%s:%i - --- - -There were 2 skipped tests: - -1) DependencyFailureTest::testTwo -This test depends on "DependencyFailureTest::testOne" to pass. - -2) DependencyFailureTest::testThree -This test depends on "DependencyFailureTest::testTwo" to pass. - -FAILURES! -Tests: 4, Assertions: 0, Failures: 1, Skipped: 2. diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies.phpt deleted file mode 100644 index 593088f..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -phpunit --verbose DependencyTestSuite ../_files/DependencyTestSuite.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Runtime: %s - -...FSS - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) DependencyFailureTest::testOne - -%s:%i - --- - -There were 2 skipped tests: - -1) DependencyFailureTest::testTwo -This test depends on "DependencyFailureTest::testOne" to pass. - -2) DependencyFailureTest::testThree -This test depends on "DependencyFailureTest::testTwo" to pass. - -FAILURES! -Tests: 4, Assertions: 0, Failures: 1, Skipped: 2. diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies2-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies2-isolation.phpt deleted file mode 100644 index bd88351..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies2-isolation.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -phpunit --process-isolation StackTest ../_files/StackTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 5 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies2.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies2.phpt deleted file mode 100644 index d05b79d..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies2.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit StackTest ../_files/StackTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 5 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies3-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies3-isolation.phpt deleted file mode 100644 index 37d2e63..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies3-isolation.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -phpunit --process-isolation MultiDependencyTest ../_files/MultiDependencyTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies3.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies3.phpt deleted file mode 100644 index 6c5d3b1..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies3.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit MultiDependencyTest ../_files/MultiDependencyTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/empty-testcase.phpt b/vendor/phpunit/phpunit/tests/TextUI/empty-testcase.phpt deleted file mode 100644 index 3de7055..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/empty-testcase.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -phpunit EmptyTestCaseTest ../_files/EmptyTestCaseTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -F - -Time: %s, Memory: %sMb - -There was 1 failure: - -1) Warning -No tests found in class "EmptyTestCaseTest". - -FAILURES! -Tests: 1, Assertions: 0, Failures: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/exception-stack.phpt b/vendor/phpunit/phpunit/tests/TextUI/exception-stack.phpt deleted file mode 100644 index db585bf..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/exception-stack.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -phpunit ExceptionStackTest ../_files/ExceptionStackTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -EE - -Time: %s, Memory: %sMb - -There were 2 errors: - -1) ExceptionStackTest::testPrintingChildException -PHPUnit_Framework_Exception: Child exception -message -Failed asserting that two arrays are equal. ---- Expected -+++ Actual -@@ @@ - Array ( -- 0 => 1 -+ 0 => 2 - ) - - -%s:%i - -Caused by -message -Failed asserting that two arrays are equal. ---- Expected -+++ Actual -@@ @@ - Array ( -- 0 => 1 -+ 0 => 2 - ) - -%s:%i - -2) ExceptionStackTest::testNestedExceptions -Exception: One - -%s:%i - -Caused by -InvalidArgumentException: Two - -%s:%i - -Caused by -Exception: Three - -%s:%i - -FAILURES! -Tests: 2, Assertions: 1, Errors: 2. diff --git a/vendor/phpunit/phpunit/tests/TextUI/exclude-group-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/exclude-group-isolation.phpt deleted file mode 100644 index 736feda..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/exclude-group-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --exclude-group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/exclude-group.phpt b/vendor/phpunit/phpunit/tests/TextUI/exclude-group.phpt deleted file mode 100644 index f75d611..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/exclude-group.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --exclude-group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/failure-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/failure-isolation.phpt deleted file mode 100644 index 7df4f10..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/failure-isolation.phpt +++ /dev/null @@ -1,142 +0,0 @@ ---TEST-- -phpunit --process-isolation FailureTest ../_files/FailureTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -FFFFFFFFFFFFF - -Time: %s, Memory: %sMb - -There were 13 failures: - -1) FailureTest::testAssertArrayEqualsArray -message -Failed asserting that two arrays are equal. ---- Expected -+++ Actual -@@ @@ - Array ( -- 0 => 1 -+ 0 => 2 - ) - -%s:%i - -2) FailureTest::testAssertIntegerEqualsInteger -message -Failed asserting that 2 matches expected 1. - -%s:%i - -3) FailureTest::testAssertObjectEqualsObject -message -Failed asserting that two objects are equal. ---- Expected -+++ Actual -@@ @@ - stdClass Object ( -- 'foo' => 'bar' -+ 'bar' => 'foo' - ) - -%s:%i - -4) FailureTest::testAssertNullEqualsString -message -Failed asserting that 'bar' matches expected null. - -%s:%i - -5) FailureTest::testAssertStringEqualsString -message -Failed asserting that two strings are equal. ---- Expected -+++ Actual -@@ @@ --'foo' -+'bar' - -%s:%i - -6) FailureTest::testAssertTextEqualsText -message -Failed asserting that two strings are equal. ---- Expected -+++ Actual -@@ @@ - 'foo --bar -+baz - ' - -%s:%i - -7) FailureTest::testAssertStringMatchesFormat -message -Failed asserting that format description matches text. ---- Expected -+++ Actual -@@ @@ --*%s* -+** - -%s:%i - -8) FailureTest::testAssertNumericEqualsNumeric -message -Failed asserting that 2 matches expected 1. - -%s:%i - -9) FailureTest::testAssertTextSameText -message -Failed asserting that two strings are identical. ---- Expected -+++ Actual -@@ @@ --foo -+bar - -%s:%i - -10) FailureTest::testAssertObjectSameObject -message -Failed asserting that two variables reference the same object. - -%s:%i - -11) FailureTest::testAssertObjectSameNull -message -Failed asserting that null is identical to an object of class "stdClass". - -%s:%i - -12) FailureTest::testAssertFloatSameFloat -message -Failed asserting that 1.5 is identical to 1.0. - -%s:%i - -13) FailureTest::testAssertStringMatchesFormatFile -Failed asserting that format description matches text. ---- Expected -+++ Actual -@@ @@ --FOO -- -+...BAR... - -%s:%i - -FAILURES! -Tests: 13, Assertions: 14, Failures: 13. diff --git a/vendor/phpunit/phpunit/tests/TextUI/failure.phpt b/vendor/phpunit/phpunit/tests/TextUI/failure.phpt deleted file mode 100644 index 23415e9..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/failure.phpt +++ /dev/null @@ -1,141 +0,0 @@ ---TEST-- -phpunit FailureTest ../_files/FailureTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -FFFFFFFFFFFFF - -Time: %s, Memory: %sMb - -There were 13 failures: - -1) FailureTest::testAssertArrayEqualsArray -message -Failed asserting that two arrays are equal. ---- Expected -+++ Actual -@@ @@ - Array ( -- 0 => 1 -+ 0 => 2 - ) - -%s:%i - -2) FailureTest::testAssertIntegerEqualsInteger -message -Failed asserting that 2 matches expected 1. - -%s:%i - -3) FailureTest::testAssertObjectEqualsObject -message -Failed asserting that two objects are equal. ---- Expected -+++ Actual -@@ @@ - stdClass Object ( -- 'foo' => 'bar' -+ 'bar' => 'foo' - ) - -%s:%i - -4) FailureTest::testAssertNullEqualsString -message -Failed asserting that 'bar' matches expected null. - -%s:%i - -5) FailureTest::testAssertStringEqualsString -message -Failed asserting that two strings are equal. ---- Expected -+++ Actual -@@ @@ --'foo' -+'bar' - -%s:%i - -6) FailureTest::testAssertTextEqualsText -message -Failed asserting that two strings are equal. ---- Expected -+++ Actual -@@ @@ - 'foo --bar -+baz - ' - -%s:%i - -7) FailureTest::testAssertStringMatchesFormat -message -Failed asserting that format description matches text. ---- Expected -+++ Actual -@@ @@ --*%s* -+** - -%s:%i - -8) FailureTest::testAssertNumericEqualsNumeric -message -Failed asserting that 2 matches expected 1. - -%s:%i - -9) FailureTest::testAssertTextSameText -message -Failed asserting that two strings are identical. ---- Expected -+++ Actual -@@ @@ --foo -+bar - -%s:%i - -10) FailureTest::testAssertObjectSameObject -message -Failed asserting that two variables reference the same object. - -%s:%i - -11) FailureTest::testAssertObjectSameNull -message -Failed asserting that null is identical to an object of class "stdClass". - -%s:%i - -12) FailureTest::testAssertFloatSameFloat -message -Failed asserting that 1.5 is identical to 1.0. - -%s:%i - -13) FailureTest::testAssertStringMatchesFormatFile -Failed asserting that format description matches text. ---- Expected -+++ Actual -@@ @@ --FOO -- -+...BAR... - -%s:%i - -FAILURES! -Tests: 13, Assertions: 14, Failures: 13. diff --git a/vendor/phpunit/phpunit/tests/TextUI/fatal-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/fatal-isolation.phpt deleted file mode 100644 index ec7f91a..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/fatal-isolation.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -phpunit FatalTest --process-isolation ../_files/FatalTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -E - -Time: %s, Memory: %sMb - -There was 1 error: - -1) FatalTest::testFatalError -%s - -FAILURES! -Tests: 1, Assertions: 0, Errors: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-class-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-class-isolation.phpt deleted file mode 100644 index 31cf060..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-class-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter BankAccountTest BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-class.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-class.phpt deleted file mode 100644 index 7b3c8dd..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-class.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter BankAccountTest BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range-isolation.phpt deleted file mode 100644 index f90a691..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter DataProviderFilterTest#1-3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range.phpt deleted file mode 100644 index 9c1e689..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter DataProviderFilterTest#1-3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number-isolation.phpt deleted file mode 100644 index 0d2ea77..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter testTrue#3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number.phpt deleted file mode 100644 index 79bf643..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter testTrue#3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range-isolation.phpt deleted file mode 100644 index 2dfdd0c..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter \#1-3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range.phpt deleted file mode 100644 index c3d344c..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter \#1-3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp-isolation.phpt deleted file mode 100644 index d109cfb..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter @false.* DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp.phpt deleted file mode 100644 index d87b304..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter @false.* DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string-isolation.phpt deleted file mode 100644 index 07c4002..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter @false\ test DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string.phpt deleted file mode 100644 index 0cf91eb..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter @false\ test DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range-isolation.phpt deleted file mode 100644 index 2231b4d..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter testTrue#1-3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range.phpt deleted file mode 100644 index 2f2aa1d..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter testTrue#1-3 DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp-isolation.phpt deleted file mode 100644 index 3a46c51..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter testFalse@false.* DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp.phpt deleted file mode 100644 index fdbd8bd..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter testFalse@false.* DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -.. - -Time: %s, Memory: %sMb - -OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string-isolation.phpt deleted file mode 100644 index d91ca73..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter testFalse@false\ test DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string.phpt deleted file mode 100644 index eb3e6af..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter testFalse@false\ test DataProviderFilterTest ../_files/DataProviderFilterTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-insensitive.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-insensitive.phpt deleted file mode 100644 index 55519a1..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-insensitive.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter /balanceIsInitiallyZero/i BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-sensitive-no-result.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-sensitive-no-result.phpt deleted file mode 100644 index 0551054..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-sensitive-no-result.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - - -Time: %s, Memory: %sMb - -No tests executed! diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method-isolation.phpt deleted file mode 100644 index 9cd16ef..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter testBalanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method.phpt deleted file mode 100644 index 9f5b01c..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter testBalanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-no-results.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-no-results.phpt deleted file mode 100644 index a2720c8..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-no-results.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --filter doesNotExist BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - - - -Time: %s, Memory: %sMb - -No tests executed! diff --git a/vendor/phpunit/phpunit/tests/TextUI/group-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/group-isolation.phpt deleted file mode 100644 index 9fc0d02..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/group-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation --group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/group.phpt b/vendor/phpunit/phpunit/tests/TextUI/group.phpt deleted file mode 100644 index 858456b..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/group.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/help.phpt b/vendor/phpunit/phpunit/tests/TextUI/help.phpt deleted file mode 100644 index c56cbe3..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/help.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -phpunit ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Usage: phpunit [options] UnitTest [UnitTest.php] - phpunit [options] - -Code Coverage Options: - - --coverage-clover Generate code coverage report in Clover XML format. - --coverage-crap4j Generate code coverage report in Crap4J XML format. - --coverage-html Generate code coverage report in HTML format. - --coverage-php Export PHP_CodeCoverage object to file. - --coverage-text= Generate code coverage report in text format. - Default: Standard output. - --coverage-xml Generate code coverage report in PHPUnit XML format. - -Logging Options: - - --log-junit Log test execution in JUnit XML format to file. - --log-tap Log test execution in TAP format to file. - --log-json Log test execution in JSON format. - --testdox-html Write agile documentation in HTML format to file. - --testdox-text Write agile documentation in Text format to file. - -Test Selection Options: - - --filter Filter which tests to run. - --testsuite Filter which testsuite to run. - --group ... Only runs tests from the specified group(s). - --exclude-group ... Exclude tests from the specified group(s). - --list-groups List available test groups. - --test-suffix ... Only search for test in files with specified - suffix(es). Default: Test.php,.phpt - -Test Execution Options: - - --report-useless-tests Be strict about tests that do not test anything. - --strict-coverage Be strict about unintentionally covered code. - --strict-global-state Be strict about changes to global state - --disallow-test-output Be strict about output during tests. - --enforce-time-limit Enforce time limit based on test size. - --disallow-todo-tests Disallow @todo-annotated tests. - - --process-isolation Run each test in a separate PHP process. - --no-globals-backup Do not backup and restore $GLOBALS for each test. - --static-backup Backup and restore static attributes for each test. - - --colors= Use colors in output ("never", "auto" or "always"). - --columns Number of columns to use for progress output. - --columns max Use maximum number of columns for progress output. - --stderr Write to STDERR instead of STDOUT. - --stop-on-error Stop execution upon first error. - --stop-on-failure Stop execution upon first error or failure. - --stop-on-risky Stop execution upon first risky test. - --stop-on-skipped Stop execution upon first skipped test. - --stop-on-incomplete Stop execution upon first incomplete test. - -v|--verbose Output more verbose information. - --debug Display debugging information during test execution. - - --loader TestSuiteLoader implementation to use. - --repeat Runs the test(s) repeatedly. - --tap Report test execution progress in TAP format. - --testdox Report test execution progress in TestDox format. - --printer TestListener implementation to use. - -Configuration Options: - - --bootstrap A "bootstrap" PHP file that is run before the tests. - -c|--configuration Read configuration from XML file. - --no-configuration Ignore default configuration file (phpunit.xml). - --no-coverage Ignore code coverage configuration. - --include-path Prepend PHP's include_path with given path(s). - -d key[=value] Sets a php.ini value. - -Miscellaneous Options: - - -h|--help Prints this usage information. - --version Prints the version and exits. diff --git a/vendor/phpunit/phpunit/tests/TextUI/help2.phpt b/vendor/phpunit/phpunit/tests/TextUI/help2.phpt deleted file mode 100644 index 97d69db..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/help2.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -phpunit --help ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Usage: phpunit [options] UnitTest [UnitTest.php] - phpunit [options] - -Code Coverage Options: - - --coverage-clover Generate code coverage report in Clover XML format. - --coverage-crap4j Generate code coverage report in Crap4J XML format. - --coverage-html Generate code coverage report in HTML format. - --coverage-php Export PHP_CodeCoverage object to file. - --coverage-text= Generate code coverage report in text format. - Default: Standard output. - --coverage-xml Generate code coverage report in PHPUnit XML format. - -Logging Options: - - --log-junit Log test execution in JUnit XML format to file. - --log-tap Log test execution in TAP format to file. - --log-json Log test execution in JSON format. - --testdox-html Write agile documentation in HTML format to file. - --testdox-text Write agile documentation in Text format to file. - -Test Selection Options: - - --filter Filter which tests to run. - --testsuite Filter which testsuite to run. - --group ... Only runs tests from the specified group(s). - --exclude-group ... Exclude tests from the specified group(s). - --list-groups List available test groups. - --test-suffix ... Only search for test in files with specified - suffix(es). Default: Test.php,.phpt - -Test Execution Options: - - --report-useless-tests Be strict about tests that do not test anything. - --strict-coverage Be strict about unintentionally covered code. - --strict-global-state Be strict about changes to global state - --disallow-test-output Be strict about output during tests. - --enforce-time-limit Enforce time limit based on test size. - --disallow-todo-tests Disallow @todo-annotated tests. - - --process-isolation Run each test in a separate PHP process. - --no-globals-backup Do not backup and restore $GLOBALS for each test. - --static-backup Backup and restore static attributes for each test. - - --colors= Use colors in output ("never", "auto" or "always"). - --columns Number of columns to use for progress output. - --columns max Use maximum number of columns for progress output. - --stderr Write to STDERR instead of STDOUT. - --stop-on-error Stop execution upon first error. - --stop-on-failure Stop execution upon first error or failure. - --stop-on-risky Stop execution upon first risky test. - --stop-on-skipped Stop execution upon first skipped test. - --stop-on-incomplete Stop execution upon first incomplete test. - -v|--verbose Output more verbose information. - --debug Display debugging information during test execution. - - --loader TestSuiteLoader implementation to use. - --repeat Runs the test(s) repeatedly. - --tap Report test execution progress in TAP format. - --testdox Report test execution progress in TestDox format. - --printer TestListener implementation to use. - -Configuration Options: - - --bootstrap A "bootstrap" PHP file that is run before the tests. - -c|--configuration Read configuration from XML file. - --no-configuration Ignore default configuration file (phpunit.xml). - --no-coverage Ignore code coverage configuration. - --include-path Prepend PHP's include_path with given path(s). - -d key[=value] Sets a php.ini value. - -Miscellaneous Options: - - -h|--help Prints this usage information. - --version Prints the version and exits. diff --git a/vendor/phpunit/phpunit/tests/TextUI/ini-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/ini-isolation.phpt deleted file mode 100644 index ee002df..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/ini-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --process-isolation -d default_mimetype=application/x-test IniTest ../_files/IniTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/list-groups.phpt b/vendor/phpunit/phpunit/tests/TextUI/list-groups.phpt deleted file mode 100644 index fba9868..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/list-groups.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit --list-groups BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Available test group(s): - - balanceCannotBecomeNegative - - balanceIsInitiallyZero - - specification diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-json-no-pretty-print.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-json-no-pretty-print.phpt deleted file mode 100644 index b2b4ae8..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/log-json-no-pretty-print.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -phpunit --log-json php://stdout BankAccountTest ../_files/BankAccountTest.php ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -{"event":"suiteStart","suite":"BankAccountTest","tests":3}{"event":"testStart","suite":"BankAccountTest","test":"BankAccountTest::testBalanceIsInitiallyZero"}.{"event":"test","suite":"BankAccountTest","test":"BankAccountTest::testBalanceIsInitiallyZero","status":"pass","time":%f,"trace":[],"message":"","output":""}{"event":"testStart","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative"}.{"event":"test","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative","status":"pass","time":%f,"trace":[],"message":"","output":""}{"event":"testStart","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative2"}.{"event":"test","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative2","status":"pass","time":%f,"trace":[],"message":"","output":""} - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-json-post-66021.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-json-post-66021.phpt deleted file mode 100644 index 9a85314..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/log-json-post-66021.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -phpunit --log-json php://stdout BankAccountTest ../_files/BankAccountTest.php ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -{ - "event": "suiteStart", - "suite": "BankAccountTest", - "tests": 3 -}{ - "event": "testStart", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceIsInitiallyZero" -}.{ - "event": "test", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceIsInitiallyZero", - "status": "pass", - "time": %f, - "trace": [], - "message": "", - "output": "" -}{ - "event": "testStart", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative" -}.{ - "event": "test", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative", - "status": "pass", - "time": %f, - "trace": [], - "message": "", - "output": "" -}{ - "event": "testStart", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative2" -}.{ - "event": "test", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative2", - "status": "pass", - "time": %f, - "trace": [], - "message": "", - "output": "" -} - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-json-pre-66021.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-json-pre-66021.phpt deleted file mode 100644 index 866134a..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/log-json-pre-66021.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -phpunit --log-json php://stdout BankAccountTest ../_files/BankAccountTest.php ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -{ - "event": "suiteStart", - "suite": "BankAccountTest", - "tests": 3 -}{ - "event": "testStart", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceIsInitiallyZero" -}.{ - "event": "test", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceIsInitiallyZero", - "status": "pass", - "time": %f, - "trace": [ - - ], - "message": "", - "output": "" -}{ - "event": "testStart", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative" -}.{ - "event": "test", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative", - "status": "pass", - "time": %f, - "trace": [ - - ], - "message": "", - "output": "" -}{ - "event": "testStart", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative2" -}.{ - "event": "test", - "suite": "BankAccountTest", - "test": "BankAccountTest::testBalanceCannotBecomeNegative2", - "status": "pass", - "time": %f, - "trace": [ - - ], - "message": "", - "output": "" -} - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-tap.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-tap.phpt deleted file mode 100644 index 6e13626..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/log-tap.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -phpunit --log-tap php://stdout BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -TAP version 13 -.ok 1 - BankAccountTest::testBalanceIsInitiallyZero -.ok 2 - BankAccountTest::testBalanceCannotBecomeNegative -.ok 3 - BankAccountTest::testBalanceCannotBecomeNegative2 -1..3 - - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-xml.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-xml.phpt deleted file mode 100644 index a031c85..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/log-xml.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -phpunit --log-junit php://stdout BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - - - - - - - - - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/options-after-arguments.phpt b/vendor/phpunit/phpunit/tests/TextUI/options-after-arguments.phpt deleted file mode 100644 index d4cdc1a..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/options-after-arguments.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit BankAccountTest ../_files/BankAccountTest.php --colors ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -%s[30;42mOK (3 tests, 3 assertions)%s[0m diff --git a/vendor/phpunit/phpunit/tests/TextUI/output-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/output-isolation.phpt deleted file mode 100644 index 128a7e2..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/output-isolation.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter testExpectOutputStringFooActualFoo ../_files/OutputTestCase.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -. - -Time: %s, Memory: %sMb - -OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/repeat.phpt b/vendor/phpunit/phpunit/tests/TextUI/repeat.phpt deleted file mode 100644 index db5eddb..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/repeat.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --repeat 3 BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -......... - -Time: %s, Memory: %sMb - -OK (9 tests, 9 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-incomplete.phpt b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-incomplete.phpt deleted file mode 100644 index 9bc4c2d..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-incomplete.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --report-useless-tests IncompleteTest ../_files/IncompleteTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -I - -Time: %s, Memory: %sMb - -OK, but incomplete, skipped, or risky tests! -Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-isolation.phpt deleted file mode 100644 index 9401b26..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-isolation.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -phpunit --report-useless-tests --process-isolation IncompleteTest ../_files/IncompleteTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -R - -Time: %s, Memory: %sMb - -OK, but incomplete, skipped, or risky tests! -Tests: 1, Assertions: 0, Risky: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests.phpt b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests.phpt deleted file mode 100644 index 9eb22df..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --report-useless-tests NothingTest ../_files/NothingTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -R - -Time: %s, Memory: %sMb - -OK, but incomplete, skipped, or risky tests! -Tests: 1, Assertions: 0, Risky: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/tap.phpt b/vendor/phpunit/phpunit/tests/TextUI/tap.phpt deleted file mode 100644 index ca5676d..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/tap.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -phpunit --tap BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -TAP version 13 -ok 1 - BankAccountTest::testBalanceIsInitiallyZero -ok 2 - BankAccountTest::testBalanceCannotBecomeNegative -ok 3 - BankAccountTest::testBalanceCannotBecomeNegative2 -1..3 diff --git a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-multiple.phpt b/vendor/phpunit/phpunit/tests/TextUI/test-suffix-multiple.phpt deleted file mode 100644 index 417f065..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-multiple.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -phpunit --test-suffix .test.php,.my.php ../_files/ ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -..... - -Time: %s, Memory: %sMb - -OK (5 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-single.phpt b/vendor/phpunit/phpunit/tests/TextUI/test-suffix-single.phpt deleted file mode 100644 index 6c35937..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-single.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -phpunit --test-suffix .test.php ../_files/ ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -... - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/testdox-html.phpt b/vendor/phpunit/phpunit/tests/TextUI/testdox-html.phpt deleted file mode 100644 index 95e4405..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/testdox-html.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --testdox-html php://stdout BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -

BankAccount

    ...
  • Balance is initially zero
  • Balance cannot become negative
- -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/testdox-text.phpt b/vendor/phpunit/phpunit/tests/TextUI/testdox-text.phpt deleted file mode 100644 index 79c6755..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/testdox-text.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -phpunit --testdox-text php://stdout BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -BankAccount -... [x] Balance is initially zero - [x] Balance cannot become negative - - - -Time: %s, Memory: %sMb - -OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/testdox.phpt b/vendor/phpunit/phpunit/tests/TextUI/testdox.phpt deleted file mode 100644 index fb24e94..0000000 --- a/vendor/phpunit/phpunit/tests/TextUI/testdox.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -phpunit --testdox php://stdout BankAccountTest ../_files/BankAccountTest.php ---FILE-- - ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -BankAccount - [x] Balance is initially zero - [x] Balance cannot become negative - diff --git a/vendor/phpunit/phpunit/tests/Util/ConfigurationTest.php b/vendor/phpunit/phpunit/tests/Util/ConfigurationTest.php deleted file mode 100644 index 8bccf14..0000000 --- a/vendor/phpunit/phpunit/tests/Util/ConfigurationTest.php +++ /dev/null @@ -1,500 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 3.3.0 - */ -class Util_ConfigurationTest extends PHPUnit_Framework_TestCase -{ - protected $configuration; - - protected function setUp() - { - $this->configuration = PHPUnit_Util_Configuration::getInstance( - dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.xml' - ); - } - - /** - * @covers PHPUnit_Util_Configuration::getInstance - * @expectedException PHPUnit_Framework_Exception - */ - public function testExceptionIsThrownForNotExistingConfigurationFile() - { - PHPUnit_Util_Configuration::getInstance('not_existing_file.xml'); - } - - /** - * @covers PHPUnit_Util_Configuration::getPHPUnitConfiguration - */ - public function testShouldReadColorsWhenTrueInConfigurationfile() - { - $configurationFilename = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.true.xml'; - $configurationInstance = PHPUnit_Util_Configuration::getInstance($configurationFilename); - $configurationValues = $configurationInstance->getPHPUnitConfiguration(); - - $this->assertEquals(PHPUnit_TextUI_ResultPrinter::COLOR_AUTO, $configurationValues['colors']); - } - - /** - * @covers PHPUnit_Util_Configuration::getPHPUnitConfiguration - */ - public function testShouldReadColorsWhenFalseInConfigurationfile() - { - $configurationFilename = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.false.xml'; - $configurationInstance = PHPUnit_Util_Configuration::getInstance($configurationFilename); - $configurationValues = $configurationInstance->getPHPUnitConfiguration(); - - $this->assertEquals(PHPUnit_TextUI_ResultPrinter::COLOR_NEVER, $configurationValues['colors']); - } - - /** - * @covers PHPUnit_Util_Configuration::getPHPUnitConfiguration - */ - public function testShouldReadColorsWhenEmptyInConfigurationfile() - { - $configurationFilename = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.empty.xml'; - $configurationInstance = PHPUnit_Util_Configuration::getInstance($configurationFilename); - $configurationValues = $configurationInstance->getPHPUnitConfiguration(); - - $this->assertEquals(PHPUnit_TextUI_ResultPrinter::COLOR_NEVER, $configurationValues['colors']); - } - - /** - * @covers PHPUnit_Util_Configuration::getPHPUnitConfiguration - */ - public function testShouldReadColorsWhenInvalidInConfigurationfile() - { - $configurationFilename = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.invalid.xml'; - $configurationInstance = PHPUnit_Util_Configuration::getInstance($configurationFilename); - $configurationValues = $configurationInstance->getPHPUnitConfiguration(); - - $this->assertEquals(PHPUnit_TextUI_ResultPrinter::COLOR_NEVER, $configurationValues['colors']); - } - - /** - * @covers PHPUnit_Util_Configuration::getFilterConfiguration - */ - public function testFilterConfigurationIsReadCorrectly() - { - $this->assertEquals( - array( - 'blacklist' => - array( - 'include' => - array( - 'directory' => - array( - 0 => - array( - 'path' => '/path/to/files', - 'prefix' => '', - 'suffix' => '.php', - 'group' => 'DEFAULT' - ), - ), - 'file' => - array( - 0 => '/path/to/file', - ), - ), - 'exclude' => - array( - 'directory' => - array( - 0 => - array( - 'path' => '/path/to/files', - 'prefix' => '', - 'suffix' => '.php', - 'group' => 'DEFAULT' - ), - ), - 'file' => - array( - 0 => '/path/to/file', - ), - ), - ), - 'whitelist' => - array( - 'addUncoveredFilesFromWhitelist' => true, - 'processUncoveredFilesFromWhitelist' => false, - 'include' => - array( - 'directory' => - array( - 0 => - array( - 'path' => '/path/to/files', - 'prefix' => '', - 'suffix' => '.php', - 'group' => 'DEFAULT' - ), - ), - 'file' => - array( - 0 => '/path/to/file', - ), - ), - 'exclude' => - array( - 'directory' => - array( - 0 => - array( - 'path' => '/path/to/files', - 'prefix' => '', - 'suffix' => '.php', - 'group' => 'DEFAULT' - ), - ), - 'file' => - array( - 0 => '/path/to/file', - ), - ), - ), - ), - $this->configuration->getFilterConfiguration() - ); - } - - /** - * @covers PHPUnit_Util_Configuration::getGroupConfiguration - */ - public function testGroupConfigurationIsReadCorrectly() - { - $this->assertEquals( - array( - 'include' => - array( - 0 => 'name', - ), - 'exclude' => - array( - 0 => 'name', - ), - ), - $this->configuration->getGroupConfiguration() - ); - } - - /** - * @covers PHPUnit_Util_Configuration::getListenerConfiguration - */ - public function testListenerConfigurationIsReadCorrectly() - { - $dir = __DIR__; - $includePath = ini_get('include_path'); - - ini_set('include_path', $dir . PATH_SEPARATOR . $includePath); - - $this->assertEquals( - array( - 0 => - array( - 'class' => 'MyListener', - 'file' => '/optional/path/to/MyListener.php', - 'arguments' => - array( - 0 => - array( - 0 => 'Sebastian', - ), - 1 => 22, - 2 => 'April', - 3 => 19.78, - 4 => null, - 5 => new stdClass, - 6 => dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyTestFile.php', - 7 => dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyRelativePath', - ), - ), - array( - 'class' => 'IncludePathListener', - 'file' => __FILE__, - 'arguments' => array() - ), - array( - 'class' => 'CompactArgumentsListener', - 'file' => '/CompactArgumentsListener.php', - 'arguments' => - array( - 0 => 42 - ), - ), - ), - $this->configuration->getListenerConfiguration() - ); - - ini_set('include_path', $includePath); - } - - /** - * @covers PHPUnit_Util_Configuration::getLoggingConfiguration - */ - public function testLoggingConfigurationIsReadCorrectly() - { - $this->assertEquals( - array( - 'lowUpperBound' => '50', - 'highLowerBound' => '90', - 'coverage-html' => '/tmp/report', - 'coverage-clover' => '/tmp/clover.xml', - 'json' => '/tmp/logfile.json', - 'plain' => '/tmp/logfile.txt', - 'tap' => '/tmp/logfile.tap', - 'logIncompleteSkipped' => false, - 'junit' => '/tmp/logfile.xml', - 'testdox-html' => '/tmp/testdox.html', - 'testdox-text' => '/tmp/testdox.txt', - ), - $this->configuration->getLoggingConfiguration() - ); - } - - /** - * @covers PHPUnit_Util_Configuration::getPHPConfiguration - */ - public function testPHPConfigurationIsReadCorrectly() - { - $this->assertEquals( - array( - 'include_path' => - array( - dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.', - '/path/to/lib' - ), - 'ini' => array('foo' => 'bar'), - 'const' => array('FOO' => false, 'BAR' => true), - 'var' => array('foo' => false), - 'env' => array('foo' => true), - 'post' => array('foo' => 'bar'), - 'get' => array('foo' => 'bar'), - 'cookie' => array('foo' => 'bar'), - 'server' => array('foo' => 'bar'), - 'files' => array('foo' => 'bar'), - 'request'=> array('foo' => 'bar'), - ), - $this->configuration->getPHPConfiguration() - ); - } - - /** - * @backupGlobals enabled - * @covers PHPUnit_Util_Configuration::handlePHPConfiguration - */ - public function testPHPConfigurationIsHandledCorrectly() - { - $this->configuration->handlePHPConfiguration(); - - $path = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.' . PATH_SEPARATOR . '/path/to/lib'; - $this->assertStringStartsWith($path, ini_get('include_path')); - $this->assertEquals(false, FOO); - $this->assertEquals(true, BAR); - $this->assertEquals(false, $GLOBALS['foo']); - $this->assertEquals(true, $_ENV['foo']); - $this->assertEquals(true, getenv('foo')); - $this->assertEquals('bar', $_POST['foo']); - $this->assertEquals('bar', $_GET['foo']); - $this->assertEquals('bar', $_COOKIE['foo']); - $this->assertEquals('bar', $_SERVER['foo']); - $this->assertEquals('bar', $_FILES['foo']); - $this->assertEquals('bar', $_REQUEST['foo']); - } - - /** - * @backupGlobals enabled - * @see https://github.com/sebastianbergmann/phpunit/issues/1181 - */ - public function testHandlePHPConfigurationDoesNotOverwrittenExistingEnvArrayVariables() - { - $_ENV['foo'] = false; - $this->configuration->handlePHPConfiguration(); - - $this->assertEquals(false, $_ENV['foo']); - $this->assertEquals(true, getenv('foo')); - } - - /** - * @backupGlobals enabled - * @see https://github.com/sebastianbergmann/phpunit/issues/1181 - */ - public function testHandlePHPConfigurationDoesNotOverriteVariablesFromPutEnv() - { - putenv('foo=putenv'); - $this->configuration->handlePHPConfiguration(); - - $this->assertEquals(true, $_ENV['foo']); - $this->assertEquals('putenv', getenv('foo')); - } - - /** - * @covers PHPUnit_Util_Configuration::getPHPUnitConfiguration - */ - public function testPHPUnitConfigurationIsReadCorrectly() - { - $this->assertEquals( - array( - 'backupGlobals' => true, - 'backupStaticAttributes' => false, - 'disallowChangesToGlobalState' => false, - 'bootstrap' => '/path/to/bootstrap.php', - 'cacheTokens' => false, - 'columns' => 80, - 'colors' => 'never', - 'stderr' => false, - 'convertErrorsToExceptions' => true, - 'convertNoticesToExceptions' => true, - 'convertWarningsToExceptions' => true, - 'forceCoversAnnotation' => false, - 'mapTestClassNameToCoveredClassName' => false, - 'printerClass' => 'PHPUnit_TextUI_ResultPrinter', - 'stopOnFailure' => false, - 'reportUselessTests' => false, - 'strictCoverage' => false, - 'disallowTestOutput' => false, - 'enforceTimeLimit' => false, - 'disallowTodoAnnotatedTests' => false, - 'testSuiteLoaderClass' => 'PHPUnit_Runner_StandardTestSuiteLoader', - 'verbose' => false, - 'timeoutForSmallTests' => 1, - 'timeoutForMediumTests' => 10, - 'timeoutForLargeTests' => 60 - ), - $this->configuration->getPHPUnitConfiguration() - ); - } - - /** - * @covers PHPUnit_Util_Configuration::getSeleniumBrowserConfiguration - */ - public function testSeleniumBrowserConfigurationIsReadCorrectly() - { - $this->assertEquals( - array( - 0 => - array( - 'name' => 'Firefox on Linux', - 'browser' => '*firefox /usr/lib/firefox/firefox-bin', - 'host' => 'my.linux.box', - 'port' => 4444, - 'timeout' => 30000, - ), - ), - $this->configuration->getSeleniumBrowserConfiguration() - ); - } - - /** - * @covers PHPUnit_Util_Configuration::getInstance - */ - public function testXincludeInConfiguration() - { - $configurationWithXinclude = PHPUnit_Util_Configuration::getInstance( - dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration_xinclude.xml' - ); - - $this->assertConfigurationEquals( - $this->configuration, - $configurationWithXinclude - ); - } - - /** - * @ticket 1311 - * @covers PHPUnit_Util_Configuration::getLoggingConfiguration - * @covers PHPUnit_Util_Configuration::getPHPConfiguration - * @covers PHPUnit_Util_Configuration::getPHPUnitConfiguration - * @covers PHPUnit_Util_Configuration::getTestSuiteConfiguration - * @covers PHPUnit_Util_Configuration::getFilterConfiguration - * @uses PHPUnit_Util_Configuration::getInstance - */ - public function testWithEmptyConfigurations() - { - $emptyConfiguration = PHPUnit_Util_Configuration::getInstance( - dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration_empty.xml' - ); - - $logging = $emptyConfiguration->getLoggingConfiguration(); - $this->assertEmpty($logging); - - $php = $emptyConfiguration->getPHPConfiguration(); - $this->assertEmpty($php['include_path']); - - $phpunit = $emptyConfiguration->getPHPUnitConfiguration(); - $this->assertArrayNotHasKey('bootstrap', $phpunit); - $this->assertArrayNotHasKey('testSuiteLoaderFile', $phpunit); - $this->assertArrayNotHasKey('printerFile', $phpunit); - - $suite = $emptyConfiguration->getTestSuiteConfiguration(); - $this->assertEmpty($suite->getGroups()); - - $filter = $emptyConfiguration->getFilterConfiguration(); - $this->assertEmpty($filter['blacklist']['include']['directory']); - $this->assertEmpty($filter['blacklist']['include']['file']); - $this->assertEmpty($filter['blacklist']['exclude']['directory']); - $this->assertEmpty($filter['blacklist']['exclude']['file']); - $this->assertEmpty($filter['whitelist']['include']['directory']); - $this->assertEmpty($filter['whitelist']['include']['file']); - $this->assertEmpty($filter['whitelist']['exclude']['directory']); - $this->assertEmpty($filter['whitelist']['exclude']['file']); - } - - /** - * Asserts that the values in $actualConfiguration equal $expectedConfiguration. - * - * @param PHPUnit_Util_Configuration $expectedConfiguration - * @param PHPUnit_Util_Configuration $actualConfiguration - */ - protected function assertConfigurationEquals(PHPUnit_Util_Configuration $expectedConfiguration, PHPUnit_Util_Configuration $actualConfiguration) - { - $this->assertEquals( - $expectedConfiguration->getFilterConfiguration(), - $actualConfiguration->getFilterConfiguration() - ); - - $this->assertEquals( - $expectedConfiguration->getGroupConfiguration(), - $actualConfiguration->getGroupConfiguration() - ); - - $this->assertEquals( - $expectedConfiguration->getListenerConfiguration(), - $actualConfiguration->getListenerConfiguration() - ); - - $this->assertEquals( - $expectedConfiguration->getLoggingConfiguration(), - $actualConfiguration->getLoggingConfiguration() - ); - - $this->assertEquals( - $expectedConfiguration->getPHPConfiguration(), - $actualConfiguration->getPHPConfiguration() - ); - - $this->assertEquals( - $expectedConfiguration->getPHPUnitConfiguration(), - $actualConfiguration->getPHPUnitConfiguration() - ); - - $this->assertEquals( - $expectedConfiguration->getSeleniumBrowserConfiguration(), - $actualConfiguration->getSeleniumBrowserConfiguration() - ); - - $this->assertEquals( - $expectedConfiguration->getTestSuiteConfiguration(), - $actualConfiguration->getTestSuiteConfiguration() - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Util/GetoptTest.php b/vendor/phpunit/phpunit/tests/Util/GetoptTest.php deleted file mode 100644 index 8e7ad4d..0000000 --- a/vendor/phpunit/phpunit/tests/Util/GetoptTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - */ -class Util_GetoptTest extends PHPUnit_Framework_TestCase -{ - public function testItIncludeTheLongOptionsAfterTheArgument() - { - $args = array( - 'command', - 'myArgument', - '--colors', - ); - $actual = PHPUnit_Util_Getopt::getopt($args, '', array('colors==')); - - $expected = array( - array( - array( - '--colors', - null, - ), - ), - array( - 'myArgument', - ), - ); - - $this->assertEquals($expected, $actual); - } - - public function testItIncludeTheShortOptionsAfterTheArgument() - { - $args = array( - 'command', - 'myArgument', - '-v', - ); - $actual = PHPUnit_Util_Getopt::getopt($args, 'v'); - - $expected = array( - array( - array( - 'v', - null, - ), - ), - array( - 'myArgument', - ), - ); - - $this->assertEquals($expected, $actual); - } -} diff --git a/vendor/phpunit/phpunit/tests/Util/GlobalStateTest.php b/vendor/phpunit/phpunit/tests/Util/GlobalStateTest.php deleted file mode 100644 index 5810ee3..0000000 --- a/vendor/phpunit/phpunit/tests/Util/GlobalStateTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - */ -class Util_GlobalStateTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHPUnit_Util_GlobalState::processIncludedFilesAsString - */ - public function testIncludedFilesAsStringSkipsVfsProtocols() - { - $dir = __DIR__; - $files = array( - 'phpunit', // The 0 index is not used - $dir . '/ConfigurationTest.php', - $dir . '/GlobalStateTest.php', - 'vfs://' . $dir . '/RegexTest.php', - 'phpvfs53e46260465c7://' . $dir . '/TestTest.php', - 'file://' . $dir . '/XMLTest.php' - ); - - $this->assertEquals( - "require_once '" . $dir . "/ConfigurationTest.php';\n" . - "require_once '" . $dir . "/GlobalStateTest.php';\n" . - "require_once 'file://" . $dir . "/XMLTest.php';\n", PHPUnit_Util_GlobalState::processIncludedFilesAsString($files)); - } -} diff --git a/vendor/phpunit/phpunit/tests/Util/RegexTest.php b/vendor/phpunit/phpunit/tests/Util/RegexTest.php deleted file mode 100644 index 7242654..0000000 --- a/vendor/phpunit/phpunit/tests/Util/RegexTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 4.2.0 - */ -class Util_RegexTest extends PHPUnit_Framework_TestCase -{ - public function validRegexpProvider() - { - return array( - array('#valid regexp#', 'valid regexp', 1), - array(';val.*xp;', 'valid regexp', 1), - array('/val.*xp/i', 'VALID REGEXP', 1), - array('/a val.*p/','valid regexp', 0), - ); - } - - public function invalidRegexpProvider() - { - return array( - array('valid regexp', 'valid regexp'), - array(';val.*xp', 'valid regexp'), - array('val.*xp/i', 'VALID REGEXP'), - ); - } - - /** - * @dataProvider validRegexpProvider - * @covers PHPUnit_Util_Regex::pregMatchSafe - */ - public function testValidRegex($pattern, $subject, $return) - { - $this->assertEquals($return, PHPUnit_Util_Regex::pregMatchSafe($pattern, $subject)); - } - - /** - * @dataProvider invalidRegexpProvider - * @covers PHPUnit_Util_Regex::pregMatchSafe - */ - public function testInvalidRegex($pattern, $subject) - { - $this->assertFalse(PHPUnit_Util_Regex::pregMatchSafe($pattern, $subject)); - } -} diff --git a/vendor/phpunit/phpunit/tests/Util/TestDox/NamePrettifierTest.php b/vendor/phpunit/phpunit/tests/Util/TestDox/NamePrettifierTest.php deleted file mode 100644 index 30b9be4..0000000 --- a/vendor/phpunit/phpunit/tests/Util/TestDox/NamePrettifierTest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 2.1.0 - */ -class Util_TestDox_NamePrettifierTest extends PHPUnit_Framework_TestCase -{ - protected $namePrettifier; - - protected function setUp() - { - $this->namePrettifier = new PHPUnit_Util_TestDox_NamePrettifier; - } - - /** - * @covers PHPUnit_Util_TestDox_NamePrettifier::prettifyTestClass - */ - public function testTitleHasSensibleDefaults() - { - $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('FooTest')); - $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('TestFoo')); - $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('TestFooTest')); - $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('Test\FooTest')); - } - - /** - * @covers PHPUnit_Util_TestDox_NamePrettifier::prettifyTestClass - */ - public function testCaterForUserDefinedSuffix() - { - $this->namePrettifier->setSuffix('TestCase'); - $this->namePrettifier->setPrefix(null); - - $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('FooTestCase')); - $this->assertEquals('TestFoo', $this->namePrettifier->prettifyTestClass('TestFoo')); - $this->assertEquals('FooTest', $this->namePrettifier->prettifyTestClass('FooTest')); - } - - /** - * @covers PHPUnit_Util_TestDox_NamePrettifier::prettifyTestClass - */ - public function testCaterForUserDefinedPrefix() - { - $this->namePrettifier->setSuffix(null); - $this->namePrettifier->setPrefix('XXX'); - - $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('XXXFoo')); - $this->assertEquals('TestXXX', $this->namePrettifier->prettifyTestClass('TestXXX')); - $this->assertEquals('XXX', $this->namePrettifier->prettifyTestClass('XXXXXX')); - } - - /** - * @covers PHPUnit_Util_TestDox_NamePrettifier::prettifyTestMethod - */ - public function testTestNameIsConvertedToASentence() - { - $this->assertEquals('This is a test', $this->namePrettifier->prettifyTestMethod('testThisIsATest')); - $this->assertEquals('This is a test', $this->namePrettifier->prettifyTestMethod('testThisIsATest2')); - $this->assertEquals('this is a test', $this->namePrettifier->prettifyTestMethod('this_is_a_test')); - $this->assertEquals('Foo for bar is 0', $this->namePrettifier->prettifyTestMethod('testFooForBarIs0')); - $this->assertEquals('Foo for baz is 1', $this->namePrettifier->prettifyTestMethod('testFooForBazIs1')); - } - - /** - * @covers PHPUnit_Util_TestDox_NamePrettifier::prettifyTestMethod - * @ticket 224 - */ - public function testTestNameIsNotGroupedWhenNotInSequence() - { - $this->assertEquals('Sets redirect header on 301', $this->namePrettifier->prettifyTestMethod('testSetsRedirectHeaderOn301')); - $this->assertEquals('Sets redirect header on 302', $this->namePrettifier->prettifyTestMethod('testSetsRedirectHeaderOn302')); - } -} diff --git a/vendor/phpunit/phpunit/tests/Util/TestTest.php b/vendor/phpunit/phpunit/tests/Util/TestTest.php deleted file mode 100644 index 0eb13fa..0000000 --- a/vendor/phpunit/phpunit/tests/Util/TestTest.php +++ /dev/null @@ -1,669 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(__DIR__) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require TEST_FILES_PATH . 'CoverageNamespacedFunctionTest.php'; -require TEST_FILES_PATH . 'NamespaceCoveredFunction.php'; - -/** - * @since Class available since Release 3.3.6 - */ -class Util_TestTest extends PHPUnit_Framework_TestCase -{ - /** - * @covers PHPUnit_Util_Test::getExpectedException - * @todo Split up in separate tests - */ - public function testGetExpectedException() - { - $this->assertArraySubset( - array('class' => 'FooBarBaz', 'code' => null, 'message' => ''), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testOne') - ); - - $this->assertArraySubset( - array('class' => 'Foo_Bar_Baz', 'code' => null, 'message' => ''), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testTwo') - ); - - $this->assertArraySubset( - array('class' => 'Foo\Bar\Baz', 'code' => null, 'message' => ''), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testThree') - ); - - $this->assertArraySubset( - array('class' => 'ほげ', 'code' => null, 'message' => ''), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testFour') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => 1234, 'message' => 'Message'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testFive') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => 1234, 'message' => 'Message'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSix') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => 'ExceptionCode', 'message' => 'Message'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSeven') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => 0, 'message' => 'Message'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testEight') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => ExceptionTest::ERROR_CODE, 'message' => ExceptionTest::ERROR_MESSAGE), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testNine') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => null, 'message' => ''), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSingleLine') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => My\Space\ExceptionNamespaceTest::ERROR_CODE, 'message' => My\Space\ExceptionNamespaceTest::ERROR_MESSAGE), - PHPUnit_Util_Test::getExpectedException('My\Space\ExceptionNamespaceTest', 'testConstants') - ); - - // Ensure the Class::CONST expression is only evaluated when the constant really exists - $this->assertArraySubset( - array('class' => 'Class', 'code' => 'ExceptionTest::UNKNOWN_CODE_CONSTANT', 'message' => 'ExceptionTest::UNKNOWN_MESSAGE_CONSTANT'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testUnknownConstants') - ); - - $this->assertArraySubset( - array('class' => 'Class', 'code' => 'My\Space\ExceptionNamespaceTest::UNKNOWN_CODE_CONSTANT', 'message' => 'My\Space\ExceptionNamespaceTest::UNKNOWN_MESSAGE_CONSTANT'), - PHPUnit_Util_Test::getExpectedException('My\Space\ExceptionNamespaceTest', 'testUnknownConstants') - ); - } - - /** - * @covers PHPUnit_Util_Test::getExpectedException - */ - public function testGetExpectedRegExp() - { - $this->assertArraySubset( - array('message_regex' => '#regex#'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testWithRegexMessage') - ); - - $this->assertArraySubset( - array('message_regex' => '#regex#'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testWithRegexMessageFromClassConstant') - ); - - $this->assertArraySubset( - array('message_regex' => 'ExceptionTest::UNKNOWN_MESSAGE_REGEX_CONSTANT'), - PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testWithUnknowRegexMessageFromClassConstant') - ); - } - - /** - * @covers PHPUnit_Util_Test::getRequirements - * @dataProvider requirementsProvider - */ - public function testGetRequirements($test, $result) - { - $this->assertEquals( - $result, - PHPUnit_Util_Test::getRequirements('RequirementsTest', $test) - ); - } - - public function requirementsProvider() - { - return array( - array('testOne', array()), - array('testTwo', array('PHPUnit' => '1.0')), - array('testThree', array('PHP' => '2.0')), - array('testFour', array('PHPUnit'=>'2.0', 'PHP' => '1.0')), - array('testFive', array('PHP' => '5.4.0RC6')), - array('testSix', array('PHP' => '5.4.0-alpha1')), - array('testSeven', array('PHP' => '5.4.0beta2')), - array('testEight', array('PHP' => '5.4-dev')), - array('testNine', array('functions' => array('testFunc'))), - array('testTen', array('extensions' => array('testExt'))), - array('testEleven', array('OS' => '/Linux/i')), - array( - 'testSpace', - array( - 'extensions' => array('spl'), - 'OS' => '/.*/i' - ) - ), - array( - 'testAllPossibleRequirements', - array( - 'PHP' => '99-dev', - 'PHPUnit' => '9-dev', - 'OS' => '/DOESNOTEXIST/i', - 'functions' => array( - 'testFuncOne', - 'testFuncTwo', - ), - 'extensions' => array( - 'testExtOne', - 'testExtTwo', - ) - ) - ) - ); - } - - /** - * @covers PHPUnit_Util_Test::getRequirements - */ - public function testGetRequirementsMergesClassAndMethodDocBlocks() - { - $expectedAnnotations = array( - 'PHP' => '5.4', - 'PHPUnit' => '3.7', - 'OS' => '/WINNT/i', - 'functions' => array( - 'testFuncClass', - 'testFuncMethod', - ), - 'extensions' => array( - 'testExtClass', - 'testExtMethod', - ) - ); - - $this->assertEquals( - $expectedAnnotations, - PHPUnit_Util_Test::getRequirements('RequirementsClassDocBlockTest', 'testMethod') - ); - } - - /** - * @covers PHPUnit_Util_Test::getMissingRequirements - * @dataProvider missingRequirementsProvider - */ - public function testGetMissingRequirements($test, $result) - { - $this->assertEquals( - $result, - PHPUnit_Util_Test::getMissingRequirements('RequirementsTest', $test) - ); - } - - public function missingRequirementsProvider() - { - return array( - array('testOne', array()), - array('testNine', array('Function testFunc is required.')), - array('testTen', array('Extension testExt is required.')), - array('testAlwaysSkip', array('PHPUnit 1111111 (or later) is required.')), - array('testAlwaysSkip2', array('PHP 9999999 (or later) is required.')), - array('testAlwaysSkip3', array('Operating system matching /DOESNOTEXIST/i is required.')), - array('testAllPossibleRequirements', array( - 'PHP 99-dev (or later) is required.', - 'PHPUnit 9-dev (or later) is required.', - 'Operating system matching /DOESNOTEXIST/i is required.', - 'Function testFuncOne is required.', - 'Function testFuncTwo is required.', - 'Extension testExtOne is required.', - 'Extension testExtTwo is required.', - )), - ); - } - - /** - * @coversNothing - * @todo This test does not really test functionality of PHPUnit_Util_Test - */ - public function testGetProvidedDataRegEx() - { - $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider method', $matches); - $this->assertEquals(1, $result); - $this->assertEquals('method', $matches[1]); - - $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider class::method', $matches); - $this->assertEquals(1, $result); - $this->assertEquals('class::method', $matches[1]); - - $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider namespace\class::method', $matches); - $this->assertEquals(1, $result); - $this->assertEquals('namespace\class::method', $matches[1]); - - $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider namespace\namespace\class::method', $matches); - $this->assertEquals(1, $result); - $this->assertEquals('namespace\namespace\class::method', $matches[1]); - - $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider メソッド', $matches); - $this->assertEquals(1, $result); - $this->assertEquals('メソッド', $matches[1]); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithEmptyAnnotation() - { - $result = PHPUnit_Util_Test::getDataFromTestWithAnnotation("/**\n * @anotherAnnotation\n */"); - $this->assertNull($result); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithSimpleCase() - { - $result = PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** - * @testWith [1] - */'); - $this->assertEquals(array(array(1)), $result); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithMultiLineMultiParameterCase() - { - $result = PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** - * @testWith [1, 2] - * [3, 4] - */'); - $this->assertEquals(array(array(1, 2), array(3, 4)), $result); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithVariousTypes() - { - $result = PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** - * @testWith ["ab"] - * [true] - * [null] - */'); - $this->assertEquals(array(array('ab'), array(true), array(null)), $result); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithAnnotationAfter() - { - $result = PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** - * @testWith [1] - * [2] - * @annotation - */'); - $this->assertEquals(array(array(1), array(2)), $result); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithSimpleTextAfter() - { - $result = PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** - * @testWith [1] - * [2] - * blah blah - */'); - $this->assertEquals(array(array(1), array(2)), $result); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithCharacterEscape() - { - $result = PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** - * @testWith ["\"", "\""] - */'); - $this->assertEquals(array(array('"', '"')), $result); - } - - /** - * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation - */ - public function testTestWithThrowsProperExceptionIfDatasetCannotBeParsed() - { - $this->setExpectedExceptionRegExp( - 'PHPUnit_Framework_Exception', - '/^The dataset for the @testWith annotation cannot be parsed.$/' - ); - PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** - * @testWith [s] - */'); - } - - /** - * @covers PHPUnit_Util_Test::getDependencies - * @todo Not sure what this test tests (name is misleading at least) - */ - public function testParseAnnotation() - { - $this->assertEquals( - array('Foo', 'ほげ'), - PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotation') - ); - } - - /** - * @depends Foo - * @depends ほげ - * @todo Remove fixture from test class - */ - public function methodForTestParseAnnotation() - { - } - - /** - * @covers PHPUnit_Util_Test::getDependencies - */ - public function testParseAnnotationThatIsOnlyOneLine() - { - $this->assertEquals( - array('Bar'), - PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotationThatIsOnlyOneLine') - ); - } - - /** @depends Bar */ - public function methodForTestParseAnnotationThatIsOnlyOneLine() - { - // TODO Remove fixture from test class - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - * @covers PHPUnit_Util_Test::resolveElementToReflectionObjects - * @dataProvider getLinesToBeCoveredProvider - */ - public function testGetLinesToBeCovered($test, $lines) - { - if (strpos($test, 'Namespace') === 0) { - $expected = array( - TEST_FILES_PATH . 'NamespaceCoveredClass.php' => $lines - ); - } elseif ($test === 'CoverageNoneTest') { - $expected = array(); - } elseif ($test === 'CoverageNothingTest') { - $expected = false; - } elseif ($test === 'CoverageFunctionTest') { - $expected = array( - TEST_FILES_PATH . 'CoveredFunction.php' => $lines - ); - } else { - $expected = array(TEST_FILES_PATH . 'CoveredClass.php' => $lines); - } - - $this->assertEquals( - $expected, - PHPUnit_Util_Test::getLinesToBeCovered( - $test, 'testSomething' - ) - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - * @covers PHPUnit_Util_Test::resolveElementToReflectionObjects - * @expectedException PHPUnit_Framework_CodeCoverageException - */ - public function testGetLinesToBeCovered2() - { - PHPUnit_Util_Test::getLinesToBeCovered( - 'NotExistingCoveredElementTest', 'testOne' - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - * @covers PHPUnit_Util_Test::resolveElementToReflectionObjects - * @expectedException PHPUnit_Framework_CodeCoverageException - */ - public function testGetLinesToBeCovered3() - { - PHPUnit_Util_Test::getLinesToBeCovered( - 'NotExistingCoveredElementTest', 'testTwo' - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - * @covers PHPUnit_Util_Test::resolveElementToReflectionObjects - * @expectedException PHPUnit_Framework_CodeCoverageException - */ - public function testGetLinesToBeCovered4() - { - PHPUnit_Util_Test::getLinesToBeCovered( - 'NotExistingCoveredElementTest', 'testThree' - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - */ - public function testGetLinesToBeCoveredSkipsNonExistentMethods() - { - $this->assertSame( - array(), - PHPUnit_Util_Test::getLinesToBeCovered( - 'NotExistingCoveredElementTest', - 'methodDoesNotExist' - ) - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - * @expectedException PHPUnit_Framework_CodeCoverageException - */ - public function testTwoCoversDefaultClassAnnoationsAreNotAllowed() - { - PHPUnit_Util_Test::getLinesToBeCovered( - 'CoverageTwoDefaultClassAnnotations', - 'testSomething' - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - */ - public function testFunctionParenthesesAreAllowed() - { - $this->assertSame( - array(TEST_FILES_PATH . 'CoveredFunction.php' => range(2, 4)), - PHPUnit_Util_Test::getLinesToBeCovered( - 'CoverageFunctionParenthesesTest', - 'testSomething' - ) - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - */ - public function testFunctionParenthesesAreAllowedWithWhitespace() - { - $this->assertSame( - array(TEST_FILES_PATH . 'CoveredFunction.php' => range(2, 4)), - PHPUnit_Util_Test::getLinesToBeCovered( - 'CoverageFunctionParenthesesWhitespaceTest', - 'testSomething' - ) - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - */ - public function testMethodParenthesesAreAllowed() - { - $this->assertSame( - array(TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35)), - PHPUnit_Util_Test::getLinesToBeCovered( - 'CoverageMethodParenthesesTest', - 'testSomething' - ) - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - */ - public function testMethodParenthesesAreAllowedWithWhitespace() - { - $this->assertSame( - array(TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35)), - PHPUnit_Util_Test::getLinesToBeCovered( - 'CoverageMethodParenthesesWhitespaceTest', - 'testSomething' - ) - ); - } - - /** - * @covers PHPUnit_Util_Test::getLinesToBeCovered - * @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed - */ - public function testNamespacedFunctionCanBeCoveredOrUsed() - { - $this->assertEquals( - array( - TEST_FILES_PATH . 'NamespaceCoveredFunction.php' => range(4, 7) - ), - PHPUnit_Util_Test::getLinesToBeCovered( - 'CoverageNamespacedFunctionTest', - 'testFunc' - ) - ); - } - - public function getLinesToBeCoveredProvider() - { - return array( - array( - 'CoverageNoneTest', - array() - ), - array( - 'CoverageClassExtendedTest', - array_merge(range(19, 36), range(2, 17)) - ), - array( - 'CoverageClassTest', - range(19, 36) - ), - array( - 'CoverageMethodTest', - range(31, 35) - ), - array( - 'CoverageMethodOneLineAnnotationTest', - range(31, 35) - ), - array( - 'CoverageNotPrivateTest', - array_merge(range(25, 29), range(31, 35)) - ), - array( - 'CoverageNotProtectedTest', - array_merge(range(21, 23), range(31, 35)) - ), - array( - 'CoverageNotPublicTest', - array_merge(range(21, 23), range(25, 29)) - ), - array( - 'CoveragePrivateTest', - range(21, 23) - ), - array( - 'CoverageProtectedTest', - range(25, 29) - ), - array( - 'CoveragePublicTest', - range(31, 35) - ), - array( - 'CoverageFunctionTest', - range(2, 4) - ), - array( - 'NamespaceCoverageClassExtendedTest', - array_merge(range(21, 38), range(4, 19)) - ), - array( - 'NamespaceCoverageClassTest', - range(21, 38) - ), - array( - 'NamespaceCoverageMethodTest', - range(33, 37) - ), - array( - 'NamespaceCoverageNotPrivateTest', - array_merge(range(27, 31), range(33, 37)) - ), - array( - 'NamespaceCoverageNotProtectedTest', - array_merge(range(23, 25), range(33, 37)) - ), - array( - 'NamespaceCoverageNotPublicTest', - array_merge(range(23, 25), range(27, 31)) - ), - array( - 'NamespaceCoveragePrivateTest', - range(23, 25) - ), - array( - 'NamespaceCoverageProtectedTest', - range(27, 31) - ), - array( - 'NamespaceCoveragePublicTest', - range(33, 37) - ), - array( - 'NamespaceCoverageCoversClassTest', - array_merge(range(23, 25), range(27, 31), range(33, 37), range(6, 8), range(10, 13), range(15, 18)) - ), - array( - 'NamespaceCoverageCoversClassPublicTest', - range(33, 37) - ), - array( - 'CoverageNothingTest', - false - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/Util/XMLTest.php b/vendor/phpunit/phpunit/tests/Util/XMLTest.php deleted file mode 100644 index 086b738..0000000 --- a/vendor/phpunit/phpunit/tests/Util/XMLTest.php +++ /dev/null @@ -1,318 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @since Class available since Release 3.3.0 - * @covers PHPUnit_Util_XML - */ -class Util_XMLTest extends PHPUnit_Framework_TestCase -{ - public function testAssertValidKeysValidKeys() - { - $options = array('testA' => 1, 'testB' => 2, 'testC' => 3); - $valid = array('testA', 'testB', 'testC'); - $expected = array('testA' => 1, 'testB' => 2, 'testC' => 3); - $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); - - $this->assertEquals($expected, $validated); - } - - public function testAssertValidKeysValidKeysEmpty() - { - $options = array('testA' => 1, 'testB' => 2); - $valid = array('testA', 'testB', 'testC'); - $expected = array('testA' => 1, 'testB' => 2, 'testC' => null); - $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); - - $this->assertEquals($expected, $validated); - } - - public function testAssertValidKeysDefaultValuesA() - { - $options = array('testA' => 1, 'testB' => 2); - $valid = array('testA' => 23, 'testB' => 24, 'testC' => 25); - $expected = array('testA' => 1, 'testB' => 2, 'testC' => 25); - $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); - - $this->assertEquals($expected, $validated); - } - - public function testAssertValidKeysDefaultValuesB() - { - $options = array(); - $valid = array('testA' => 23, 'testB' => 24, 'testC' => 25); - $expected = array('testA' => 23, 'testB' => 24, 'testC' => 25); - $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); - - $this->assertEquals($expected, $validated); - } - - public function testAssertValidKeysInvalidKey() - { - $options = array('testA' => 1, 'testB' => 2, 'testD' => 3); - $valid = array('testA', 'testB', 'testC'); - - try { - $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); - $this->fail(); - } catch (PHPUnit_Framework_Exception $e) { - $this->assertEquals('Unknown key(s): testD', $e->getMessage()); - } - } - - public function testAssertValidKeysInvalidKeys() - { - $options = array('testA' => 1, 'testD' => 2, 'testE' => 3); - $valid = array('testA', 'testB', 'testC'); - - try { - $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); - $this->fail(); - } catch (PHPUnit_Framework_Exception $e) { - $this->assertEquals('Unknown key(s): testD, testE', $e->getMessage()); - } - } - - public function testConvertAssertSelect() - { - $selector = 'div#folder.open a[href="http://www.xerox.com"][title="xerox"].selected.big > span + h1'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', - 'id' => 'folder', - 'class' => 'open', - 'descendant' => array('tag' => 'a', - 'class' => 'selected big', - 'attributes' => array('href' => 'http://www.xerox.com', - 'title' => 'xerox'), - 'child' => array('tag' => 'span', - 'adjacent-sibling' => array('tag' => 'h1')))); - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectElt() - { - $selector = 'div'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertClass() - { - $selector = '.foo'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('class' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertId() - { - $selector = '#foo'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('id' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertAttribute() - { - $selector = '[foo="bar"]'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('attributes' => array('foo' => 'bar')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertAttributeSpaces() - { - $selector = '[foo="bar baz"] div[value="foo bar"]'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('attributes' => array('foo' => 'bar baz'), - 'descendant' => array('tag' => 'div', - 'attributes' => array('value' => 'foo bar'))); - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertAttributeMultipleSpaces() - { - $selector = '[foo="bar baz"] div[value="foo bar baz"]'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('attributes' => array('foo' => 'bar baz'), - 'descendant' => array('tag' => 'div', - 'attributes' => array('value' => 'foo bar baz'))); - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltClass() - { - $selector = 'div.foo'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'class' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltId() - { - $selector = 'div#foo'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'id' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltAttrEqual() - { - $selector = 'div[foo="bar"]'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'attributes' => array('foo' => 'bar')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltMultiAttrEqual() - { - $selector = 'div[foo="bar"][baz="fob"]'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'attributes' => array('foo' => 'bar', 'baz' => 'fob')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltAttrHasOne() - { - $selector = 'div[foo~="bar"]'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'attributes' => array('foo' => 'regexp:/.*\bbar\b.*/')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltAttrContains() - { - $selector = 'div[foo*="bar"]'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'attributes' => array('foo' => 'regexp:/.*bar.*/')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltChild() - { - $selector = 'div > a'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'child' => array('tag' => 'a')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltAdjacentSibling() - { - $selector = 'div + a'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'adjacent-sibling' => array('tag' => 'a')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectEltDescendant() - { - $selector = 'div a'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector); - $tag = array('tag' => 'div', 'descendant' => array('tag' => 'a')); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectContent() - { - $selector = '#foo'; - $content = 'div contents'; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); - $tag = array('id' => 'foo', 'content' => 'div contents'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectTrue() - { - $selector = '#foo'; - $content = true; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); - $tag = array('id' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertSelectFalse() - { - $selector = '#foo'; - $content = false; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); - $tag = array('id' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertNumber() - { - $selector = '.foo'; - $content = 3; - $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); - $tag = array('class' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - public function testConvertAssertRange() - { - $selector = '#foo'; - $content = array('greater_than' => 5, 'less_than' => 10); - $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); - $tag = array('id' => 'foo'); - - $this->assertEquals($tag, $converted); - } - - /** - * @dataProvider charProvider - */ - public function testPrepareString($char) - { - $e = null; - - $escapedString = PHPUnit_Util_XML::prepareString($char); - $xml = "$escapedString"; - $dom = new DomDocument('1.0', 'UTF-8'); - - try { - $dom->loadXML($xml); - } catch (Exception $e) { - } - - $this->assertNull($e, sprintf( - 'PHPUnit_Util_XML::prepareString("\x%02x") should not crash DomDocument', - ord($char) - )); - } - - public function charProvider() - { - $data = array(); - - for ($i = 0; $i < 256; $i++) { - $data[] = array(chr($i)); - } - - return $data; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/AbstractTest.php b/vendor/phpunit/phpunit/tests/_files/AbstractTest.php deleted file mode 100644 index 556e7db..0000000 --- a/vendor/phpunit/phpunit/tests/_files/AbstractTest.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * An author. - * - * @since Class available since Release 3.6.0 - */ -class Author -{ - // the order of properties is important for testing the cycle! - public $books = array(); - - private $name = ''; - - public function __construct($name) - { - $this->name = $name; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/BankAccount.php b/vendor/phpunit/phpunit/tests/_files/BankAccount.php deleted file mode 100644 index 7b13443..0000000 --- a/vendor/phpunit/phpunit/tests/_files/BankAccount.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class BankAccountException extends RuntimeException -{ -} - -/** - * A bank account. - * - * @since Class available since Release 2.3.0 - */ -class BankAccount -{ - /** - * The bank account's balance. - * - * @var float - */ - protected $balance = 0; - - /** - * Returns the bank account's balance. - * - * @return float - */ - public function getBalance() - { - return $this->balance; - } - - /** - * Sets the bank account's balance. - * - * @param float $balance - * @throws BankAccountException - */ - protected function setBalance($balance) - { - if ($balance >= 0) { - $this->balance = $balance; - } else { - throw new BankAccountException; - } - } - - /** - * Deposits an amount of money to the bank account. - * - * @param float $balance - * @throws BankAccountException - */ - public function depositMoney($balance) - { - $this->setBalance($this->getBalance() + $balance); - - return $this->getBalance(); - } - - /** - * Withdraws an amount of money from the bank account. - * - * @param float $balance - * @throws BankAccountException - */ - public function withdrawMoney($balance) - { - $this->setBalance($this->getBalance() - $balance); - - return $this->getBalance(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/BankAccountTest.php b/vendor/phpunit/phpunit/tests/_files/BankAccountTest.php deleted file mode 100644 index b8e7061..0000000 --- a/vendor/phpunit/phpunit/tests/_files/BankAccountTest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the BankAccount class. - * - * @since Class available since Release 2.3.0 - */ -class BankAccountTest extends PHPUnit_Framework_TestCase -{ - protected $ba; - - protected function setUp() - { - $this->ba = new BankAccount; - } - - /** - * @covers BankAccount::getBalance - * @group balanceIsInitiallyZero - * @group specification - */ - public function testBalanceIsInitiallyZero() - { - $this->assertEquals(0, $this->ba->getBalance()); - } - - /** - * @covers BankAccount::withdrawMoney - * @group balanceCannotBecomeNegative - * @group specification - */ - public function testBalanceCannotBecomeNegative() - { - try { - $this->ba->withdrawMoney(1); - } catch (BankAccountException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /** - * @covers BankAccount::depositMoney - * @group balanceCannotBecomeNegative - * @group specification - */ - public function testBalanceCannotBecomeNegative2() - { - try { - $this->ba->depositMoney(-1); - } catch (BankAccountException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /* - * @covers BankAccount::getBalance - * @covers BankAccount::depositMoney - * @covers BankAccount::withdrawMoney - * @group balanceCannotBecomeNegative - */ - /* - public function testDepositingAndWithdrawingMoneyWorks() - { - $this->assertEquals(0, $this->ba->getBalance()); - $this->ba->depositMoney(1); - $this->assertEquals(1, $this->ba->getBalance()); - $this->ba->withdrawMoney(1); - $this->assertEquals(0, $this->ba->getBalance()); - } - */ -} diff --git a/vendor/phpunit/phpunit/tests/_files/BankAccountTest.test.php b/vendor/phpunit/phpunit/tests/_files/BankAccountTest.test.php deleted file mode 100644 index 371cc77..0000000 --- a/vendor/phpunit/phpunit/tests/_files/BankAccountTest.test.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Tests for the BankAccount class. - * - * @since Class available since Release 2.3.0 - */ -class BankAccountWithCustomExtensionTest extends PHPUnit_Framework_TestCase -{ - protected $ba; - - protected function setUp() - { - $this->ba = new BankAccount; - } - - /** - * @covers BankAccount::getBalance - * @group balanceIsInitiallyZero - * @group specification - */ - public function testBalanceIsInitiallyZero() - { - $this->assertEquals(0, $this->ba->getBalance()); - } - - /** - * @covers BankAccount::withdrawMoney - * @group balanceCannotBecomeNegative - * @group specification - */ - public function testBalanceCannotBecomeNegative() - { - try { - $this->ba->withdrawMoney(1); - } catch (BankAccountException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /** - * @covers BankAccount::depositMoney - * @group balanceCannotBecomeNegative - * @group specification - */ - public function testBalanceCannotBecomeNegative2() - { - try { - $this->ba->depositMoney(-1); - } catch (BankAccountException $e) { - $this->assertEquals(0, $this->ba->getBalance()); - - return; - } - - $this->fail(); - } - - /* - * @covers BankAccount::getBalance - * @covers BankAccount::depositMoney - * @covers BankAccount::withdrawMoney - * @group balanceCannotBecomeNegative - */ - /* - public function testDepositingAndWithdrawingMoneyWorks() - { - $this->assertEquals(0, $this->ba->getBalance()); - $this->ba->depositMoney(1); - $this->assertEquals(1, $this->ba->getBalance()); - $this->ba->withdrawMoney(1); - $this->assertEquals(0, $this->ba->getBalance()); - } - */ -} diff --git a/vendor/phpunit/phpunit/tests/_files/BaseTestListenerSample.php b/vendor/phpunit/phpunit/tests/_files/BaseTestListenerSample.php deleted file mode 100644 index 7753b28..0000000 --- a/vendor/phpunit/phpunit/tests/_files/BaseTestListenerSample.php +++ /dev/null @@ -1,11 +0,0 @@ -endCount++; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/BeforeAndAfterTest.php b/vendor/phpunit/phpunit/tests/_files/BeforeAndAfterTest.php deleted file mode 100644 index 0b52526..0000000 --- a/vendor/phpunit/phpunit/tests/_files/BeforeAndAfterTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A book. - * - * @since Class available since Release 3.6.0 - */ -class Book -{ - // the order of properties is important for testing the cycle! - public $author = null; -} diff --git a/vendor/phpunit/phpunit/tests/_files/Calculator.php b/vendor/phpunit/phpunit/tests/_files/Calculator.php deleted file mode 100644 index e269bd6..0000000 --- a/vendor/phpunit/phpunit/tests/_files/Calculator.php +++ /dev/null @@ -1,14 +0,0 @@ -assertTrue(true); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ClassWithNonPublicAttributes.php b/vendor/phpunit/phpunit/tests/_files/ClassWithNonPublicAttributes.php deleted file mode 100644 index abc8ff6..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ClassWithNonPublicAttributes.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * A class with a __toString() method. - * - * @since Class available since Release 3.6.0 - */ -class ClassWithToString -{ - public function __toString() - { - return 'string representation'; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ConcreteTest.my.php b/vendor/phpunit/phpunit/tests/_files/ConcreteTest.my.php deleted file mode 100644 index fe01cee..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ConcreteTest.my.php +++ /dev/null @@ -1,7 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageClassTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageClassTest.php deleted file mode 100644 index 7f569ae..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageClassTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageFunctionParenthesesTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageFunctionParenthesesTest.php deleted file mode 100644 index 33b5fe3..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageFunctionParenthesesTest.php +++ /dev/null @@ -1,11 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageMethodParenthesesTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageMethodParenthesesTest.php deleted file mode 100644 index 4223004..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageMethodParenthesesTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageMethodParenthesesWhitespaceTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageMethodParenthesesWhitespaceTest.php deleted file mode 100644 index d1be1c6..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageMethodParenthesesWhitespaceTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageMethodTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageMethodTest.php deleted file mode 100644 index 167b3db..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageMethodTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageNamespacedFunctionTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageNamespacedFunctionTest.php deleted file mode 100644 index 9fc056f..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageNamespacedFunctionTest.php +++ /dev/null @@ -1,11 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageNotPrivateTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageNotPrivateTest.php deleted file mode 100644 index 12b56e8..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageNotPrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageNotProtectedTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageNotProtectedTest.php deleted file mode 100644 index c69d261..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageNotProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageNotPublicTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageNotPublicTest.php deleted file mode 100644 index aebfe4b..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageNotPublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageNothingTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageNothingTest.php deleted file mode 100644 index 5d5680d..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageNothingTest.php +++ /dev/null @@ -1,13 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoveragePrivateTest.php b/vendor/phpunit/phpunit/tests/_files/CoveragePrivateTest.php deleted file mode 100644 index f09560d..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoveragePrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageProtectedTest.php b/vendor/phpunit/phpunit/tests/_files/CoverageProtectedTest.php deleted file mode 100644 index 9b3acbf..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoveragePublicTest.php b/vendor/phpunit/phpunit/tests/_files/CoveragePublicTest.php deleted file mode 100644 index 480a522..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoveragePublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoverageTwoDefaultClassAnnotations.php b/vendor/phpunit/phpunit/tests/_files/CoverageTwoDefaultClassAnnotations.php deleted file mode 100644 index 1011769..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoverageTwoDefaultClassAnnotations.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoveredClass.php b/vendor/phpunit/phpunit/tests/_files/CoveredClass.php deleted file mode 100644 index f382ce9..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoveredClass.php +++ /dev/null @@ -1,36 +0,0 @@ -privateMethod(); - } - - public function publicMethod() - { - $this->protectedMethod(); - } -} - -class CoveredClass extends CoveredParentClass -{ - private function privateMethod() - { - } - - protected function protectedMethod() - { - parent::protectedMethod(); - $this->privateMethod(); - } - - public function publicMethod() - { - parent::publicMethod(); - $this->protectedMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/CoveredFunction.php b/vendor/phpunit/phpunit/tests/_files/CoveredFunction.php deleted file mode 100644 index 9989eb0..0000000 --- a/vendor/phpunit/phpunit/tests/_files/CoveredFunction.php +++ /dev/null @@ -1,4 +0,0 @@ -assertTrue(true); - } - - public static function provider() - { - $obj2 = new \stdClass(); - $obj2->foo = 'bar'; - - $obj3 = (object) array(1,2,"Test\r\n",4,5,6,7,8); - - $obj = new \stdClass(); - //@codingStandardsIgnoreStart - $obj->null = null; - //@codingStandardsIgnoreEnd - $obj->boolean = true; - $obj->integer = 1; - $obj->double = 1.2; - $obj->string = '1'; - $obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"; - $obj->object = $obj2; - $obj->objectagain = $obj2; - $obj->array = array('foo' => 'bar'); - $obj->self = $obj; - - $storage = new \SplObjectStorage(); - $storage->attach($obj2); - $storage->foo = $obj2; - - return array( - array(null, true, 1, 1.0), - array(1.2, fopen('php://memory', 'r'), '1'), - array(array(array(1,2,3), array(3,4,5))), - // \n\r and \r is converted to \n - array("this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"), - array(new \stdClass(), $obj, array(), $storage, $obj3), - array(chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5), implode('', array_map('chr', range(0x0e, 0x1f)))), - array(chr(0x00) . chr(0x09)) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DataProviderFilterTest.php b/vendor/phpunit/phpunit/tests/_files/DataProviderFilterTest.php deleted file mode 100644 index a872bc9..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DataProviderFilterTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertTrue($truth); - } - - public static function truthProvider() - { - return array( - array(true), - array(true), - array(true), - array(true) - ); - } - - /** - * @dataProvider falseProvider - */ - public function testFalse($false) - { - $this->assertFalse($false); - } - - public static function falseProvider() - { - return array( - 'false test' => array(false), - 'false test 2' => array(false), - 'other false test' => array(false), - 'other false test2'=> array(false) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DataProviderIncompleteTest.php b/vendor/phpunit/phpunit/tests/_files/DataProviderIncompleteTest.php deleted file mode 100644 index e0efb5b..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DataProviderIncompleteTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertTrue(true); - } - - /** - * @dataProvider providerMethod - */ - public function testAdd($a, $b, $c) - { - $this->assertEquals($c, $a + $b); - } - - public function incompleteTestProviderMethod() - { - $this->markTestIncomplete('incomplete'); - - return array( - array(0, 0, 0), - array(0, 1, 1), - ); - } - - public static function providerMethod() - { - return array( - array(0, 0, 0), - array(0, 1, 1), - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DataProviderSkippedTest.php b/vendor/phpunit/phpunit/tests/_files/DataProviderSkippedTest.php deleted file mode 100644 index ec67ce5..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DataProviderSkippedTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertTrue(true); - } - - /** - * @dataProvider providerMethod - */ - public function testAdd($a, $b, $c) - { - $this->assertEquals($c, $a + $b); - } - - public function skippedTestProviderMethod() - { - $this->markTestSkipped('skipped'); - - return array( - array(0, 0, 0), - array(0, 1, 1), - ); - } - - public static function providerMethod() - { - return array( - array(0, 0, 0), - array(0, 1, 1), - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DataProviderTest.php b/vendor/phpunit/phpunit/tests/_files/DataProviderTest.php deleted file mode 100644 index d940a05..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DataProviderTest.php +++ /dev/null @@ -1,21 +0,0 @@ -assertEquals($c, $a + $b); - } - - public static function providerMethod() - { - return array( - array(0, 0, 0), - array(0, 1, 1), - array(1, 1, 3), - array(1, 0, 1) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DependencyFailureTest.php b/vendor/phpunit/phpunit/tests/_files/DependencyFailureTest.php deleted file mode 100644 index d83aecd..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DependencyFailureTest.php +++ /dev/null @@ -1,22 +0,0 @@ -fail(); - } - - /** - * @depends testOne - */ - public function testTwo() - { - } - - /** - * @depends testTwo - */ - public function testThree() - { - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DependencySuccessTest.php b/vendor/phpunit/phpunit/tests/_files/DependencySuccessTest.php deleted file mode 100644 index 0e4b5dd..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DependencySuccessTest.php +++ /dev/null @@ -1,21 +0,0 @@ -addTestSuite('DependencySuccessTest'); - $suite->addTestSuite('DependencyFailureTest'); - - return $suite; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DoubleTestCase.php b/vendor/phpunit/phpunit/tests/_files/DoubleTestCase.php deleted file mode 100644 index b1f00a8..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DoubleTestCase.php +++ /dev/null @@ -1,25 +0,0 @@ -testCase = $testCase; - } - - public function count() - { - return 2; - } - - public function run(PHPUnit_Framework_TestResult $result = null) - { - $result->startTest($this); - - $this->testCase->runBare(); - $this->testCase->runBare(); - - $result->endTest($this, 0); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/DummyException.php b/vendor/phpunit/phpunit/tests/_files/DummyException.php deleted file mode 100644 index 29a69b9..0000000 --- a/vendor/phpunit/phpunit/tests/_files/DummyException.php +++ /dev/null @@ -1,5 +0,0 @@ -setUp = true; - } - - protected function assertPreConditions() - { - $this->assertPreConditions = true; - } - - public function testSomething() - { - $this->testSomething = true; - } - - protected function assertPostConditions() - { - $this->assertPostConditions = true; - throw new Exception; - } - - protected function tearDown() - { - $this->tearDown = true; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ExceptionInAssertPreConditionsTest.php b/vendor/phpunit/phpunit/tests/_files/ExceptionInAssertPreConditionsTest.php deleted file mode 100644 index a375d05..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ExceptionInAssertPreConditionsTest.php +++ /dev/null @@ -1,35 +0,0 @@ -setUp = true; - } - - protected function assertPreConditions() - { - $this->assertPreConditions = true; - throw new Exception; - } - - public function testSomething() - { - $this->testSomething = true; - } - - protected function assertPostConditions() - { - $this->assertPostConditions = true; - } - - protected function tearDown() - { - $this->tearDown = true; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ExceptionInSetUpTest.php b/vendor/phpunit/phpunit/tests/_files/ExceptionInSetUpTest.php deleted file mode 100644 index 193b9a8..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ExceptionInSetUpTest.php +++ /dev/null @@ -1,35 +0,0 @@ -setUp = true; - throw new Exception; - } - - protected function assertPreConditions() - { - $this->assertPreConditions = true; - } - - public function testSomething() - { - $this->testSomething = true; - } - - protected function assertPostConditions() - { - $this->assertPostConditions = true; - } - - protected function tearDown() - { - $this->tearDown = true; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ExceptionInTearDownTest.php b/vendor/phpunit/phpunit/tests/_files/ExceptionInTearDownTest.php deleted file mode 100644 index 5ee4a9d..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ExceptionInTearDownTest.php +++ /dev/null @@ -1,35 +0,0 @@ -setUp = true; - } - - protected function assertPreConditions() - { - $this->assertPreConditions = true; - } - - public function testSomething() - { - $this->testSomething = true; - } - - protected function assertPostConditions() - { - $this->assertPostConditions = true; - } - - protected function tearDown() - { - $this->tearDown = true; - throw new Exception; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ExceptionInTest.php b/vendor/phpunit/phpunit/tests/_files/ExceptionInTest.php deleted file mode 100644 index 32c7e24..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ExceptionInTest.php +++ /dev/null @@ -1,35 +0,0 @@ -setUp = true; - } - - protected function assertPreConditions() - { - $this->assertPreConditions = true; - } - - public function testSomething() - { - $this->testSomething = true; - throw new Exception; - } - - protected function assertPostConditions() - { - $this->assertPostConditions = true; - } - - protected function tearDown() - { - $this->tearDown = true; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ExceptionNamespaceTest.php b/vendor/phpunit/phpunit/tests/_files/ExceptionNamespaceTest.php deleted file mode 100644 index 22f3760..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ExceptionNamespaceTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals(array(1), array(2), 'message'); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { - $message = $e->getMessage() . $e->getComparisonFailure()->getDiff(); - throw new PHPUnit_Framework_Exception("Child exception\n$message", 101, $e); - } - } - - public function testNestedExceptions() - { - $exceptionThree = new Exception('Three'); - $exceptionTwo = new InvalidArgumentException('Two', 0, $exceptionThree); - $exceptionOne = new Exception('One', 0, $exceptionTwo); - throw $exceptionOne; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ExceptionTest.php b/vendor/phpunit/phpunit/tests/_files/ExceptionTest.php deleted file mode 100644 index 0213805..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ExceptionTest.php +++ /dev/null @@ -1,139 +0,0 @@ -fail(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/FailureTest.php b/vendor/phpunit/phpunit/tests/_files/FailureTest.php deleted file mode 100644 index e9df755..0000000 --- a/vendor/phpunit/phpunit/tests/_files/FailureTest.php +++ /dev/null @@ -1,75 +0,0 @@ -assertEquals(array(1), array(2), 'message'); - } - - public function testAssertIntegerEqualsInteger() - { - $this->assertEquals(1, 2, 'message'); - } - - public function testAssertObjectEqualsObject() - { - $a = new StdClass; - $a->foo = 'bar'; - - $b = new StdClass; - $b->bar = 'foo'; - - $this->assertEquals($a, $b, 'message'); - } - - public function testAssertNullEqualsString() - { - $this->assertEquals(null, 'bar', 'message'); - } - - public function testAssertStringEqualsString() - { - $this->assertEquals('foo', 'bar', 'message'); - } - - public function testAssertTextEqualsText() - { - $this->assertEquals("foo\nbar\n", "foo\nbaz\n", 'message'); - } - - public function testAssertStringMatchesFormat() - { - $this->assertStringMatchesFormat('*%s*', '**', 'message'); - } - - public function testAssertNumericEqualsNumeric() - { - $this->assertEquals(1, 2, 'message'); - } - - public function testAssertTextSameText() - { - $this->assertSame('foo', 'bar', 'message'); - } - - public function testAssertObjectSameObject() - { - $this->assertSame(new StdClass, new StdClass, 'message'); - } - - public function testAssertObjectSameNull() - { - $this->assertSame(new StdClass, null, 'message'); - } - - public function testAssertFloatSameFloat() - { - $this->assertSame(1.0, 1.5, 'message'); - } - - // Note that due to the implementation of this assertion it counts as 2 asserts - public function testAssertStringMatchesFormatFile() - { - $this->assertStringMatchesFormatFile(__DIR__ . '/expectedFileFormat.txt', '...BAR...'); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/FatalTest.php b/vendor/phpunit/phpunit/tests/_files/FatalTest.php deleted file mode 100644 index bf005f9..0000000 --- a/vendor/phpunit/phpunit/tests/_files/FatalTest.php +++ /dev/null @@ -1,13 +0,0 @@ -markTestIncomplete('Test incomplete'); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/Inheritance/InheritanceA.php b/vendor/phpunit/phpunit/tests/_files/Inheritance/InheritanceA.php deleted file mode 100644 index e189b7d..0000000 --- a/vendor/phpunit/phpunit/tests/_files/Inheritance/InheritanceA.php +++ /dev/null @@ -1,7 +0,0 @@ -assertEquals('application/x-test', ini_get('default_mimetype')); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/IsolationTest.php b/vendor/phpunit/phpunit/tests/_files/IsolationTest.php deleted file mode 100644 index df95c91..0000000 --- a/vendor/phpunit/phpunit/tests/_files/IsolationTest.php +++ /dev/null @@ -1,13 +0,0 @@ -assertFalse($this->isInIsolation()); - } - - public function testIsInIsolationReturnsTrue() - { - $this->assertTrue($this->isInIsolation()); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/JsonData/arrayObject.json b/vendor/phpunit/phpunit/tests/_files/JsonData/arrayObject.json deleted file mode 100644 index 8a74fc5..0000000 --- a/vendor/phpunit/phpunit/tests/_files/JsonData/arrayObject.json +++ /dev/null @@ -1 +0,0 @@ -["Mascott", "Tux", "OS", "Linux"] diff --git a/vendor/phpunit/phpunit/tests/_files/JsonData/simpleObject.json b/vendor/phpunit/phpunit/tests/_files/JsonData/simpleObject.json deleted file mode 100644 index 27085be..0000000 --- a/vendor/phpunit/phpunit/tests/_files/JsonData/simpleObject.json +++ /dev/null @@ -1 +0,0 @@ -{"Mascott":"Tux"} \ No newline at end of file diff --git a/vendor/phpunit/phpunit/tests/_files/MockRunner.php b/vendor/phpunit/phpunit/tests/_files/MockRunner.php deleted file mode 100644 index b3bc0cc..0000000 --- a/vendor/phpunit/phpunit/tests/_files/MockRunner.php +++ /dev/null @@ -1,7 +0,0 @@ -assertEquals('foo', $a); - $this->assertEquals('bar', $b); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageClassExtendedTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageClassExtendedTest.php deleted file mode 100644 index d0954cb..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageClassExtendedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageClassTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageClassTest.php deleted file mode 100644 index 63912c0..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageClassTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageCoversClassPublicTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageCoversClassPublicTest.php deleted file mode 100644 index 45f583b..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageCoversClassPublicTest.php +++ /dev/null @@ -1,15 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageCoversClassTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageCoversClassTest.php deleted file mode 100644 index b336745..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageCoversClassTest.php +++ /dev/null @@ -1,20 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageMethodTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageMethodTest.php deleted file mode 100644 index 35dfb8b..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageMethodTest.php +++ /dev/null @@ -1,12 +0,0 @@ -publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotPrivateTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotPrivateTest.php deleted file mode 100644 index 552c9ec..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotPrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotProtectedTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotProtectedTest.php deleted file mode 100644 index 33fc8c7..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotPublicTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotPublicTest.php deleted file mode 100644 index ccbc500..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageNotPublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveragePrivateTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoveragePrivateTest.php deleted file mode 100644 index cce7ba9..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveragePrivateTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageProtectedTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageProtectedTest.php deleted file mode 100644 index dbbcc1c..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoverageProtectedTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveragePublicTest.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoveragePublicTest.php deleted file mode 100644 index bf1bff8..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveragePublicTest.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ - public function testSomething() - { - $o = new Foo\CoveredClass; - $o->publicMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveredClass.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoveredClass.php deleted file mode 100644 index 5bd0ddf..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveredClass.php +++ /dev/null @@ -1,38 +0,0 @@ -privateMethod(); - } - - public function publicMethod() - { - $this->protectedMethod(); - } -} - -class CoveredClass extends CoveredParentClass -{ - private function privateMethod() - { - } - - protected function protectedMethod() - { - parent::protectedMethod(); - $this->privateMethod(); - } - - public function publicMethod() - { - parent::publicMethod(); - $this->protectedMethod(); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveredFunction.php b/vendor/phpunit/phpunit/tests/_files/NamespaceCoveredFunction.php deleted file mode 100644 index afc00d7..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NamespaceCoveredFunction.php +++ /dev/null @@ -1,7 +0,0 @@ - - */ - public function testThree() - { - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/NotPublicTestCase.php b/vendor/phpunit/phpunit/tests/_files/NotPublicTestCase.php deleted file mode 100644 index a391010..0000000 --- a/vendor/phpunit/phpunit/tests/_files/NotPublicTestCase.php +++ /dev/null @@ -1,11 +0,0 @@ -expectOutputString('foo'); - print 'foo'; - } - - public function testExpectOutputStringFooActualBar() - { - $this->expectOutputString('foo'); - print 'bar'; - } - - public function testExpectOutputRegexFooActualFoo() - { - $this->expectOutputRegex('/foo/'); - print 'foo'; - } - - public function testExpectOutputRegexFooActualBar() - { - $this->expectOutputRegex('/foo/'); - print 'bar'; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/OverrideTestCase.php b/vendor/phpunit/phpunit/tests/_files/OverrideTestCase.php deleted file mode 100644 index fcc276c..0000000 --- a/vendor/phpunit/phpunit/tests/_files/OverrideTestCase.php +++ /dev/null @@ -1,7 +0,0 @@ -container = array(); - } - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/SampleClass.php b/vendor/phpunit/phpunit/tests/_files/SampleClass.php deleted file mode 100644 index 06c51c5..0000000 --- a/vendor/phpunit/phpunit/tests/_files/SampleClass.php +++ /dev/null @@ -1,14 +0,0 @@ -a = $a; - $this->b = $b; - $this->c = $c; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/Singleton.php b/vendor/phpunit/phpunit/tests/_files/Singleton.php deleted file mode 100644 index bfdf3bb..0000000 --- a/vendor/phpunit/phpunit/tests/_files/Singleton.php +++ /dev/null @@ -1,22 +0,0 @@ -assertEquals(0, count($stack)); - - array_push($stack, 'foo'); - $this->assertEquals('foo', $stack[count($stack)-1]); - $this->assertEquals(1, count($stack)); - - return $stack; - } - - /** - * @depends testPush - */ - public function testPop(array $stack) - { - $this->assertEquals('foo', array_pop($stack)); - $this->assertEquals(0, count($stack)); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/Struct.php b/vendor/phpunit/phpunit/tests/_files/Struct.php deleted file mode 100644 index 12977a9..0000000 --- a/vendor/phpunit/phpunit/tests/_files/Struct.php +++ /dev/null @@ -1,10 +0,0 @@ -var = $var; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/Success.php b/vendor/phpunit/phpunit/tests/_files/Success.php deleted file mode 100644 index 6d3dd61..0000000 --- a/vendor/phpunit/phpunit/tests/_files/Success.php +++ /dev/null @@ -1,7 +0,0 @@ -assertTrue(true); - } - - public function testTwo() - { - print __METHOD__ . "\n"; - $this->assertTrue(false); - } - - protected function assertPostConditions() - { - print __METHOD__ . "\n"; - } - - protected function tearDown() - { - print __METHOD__ . "\n"; - } - - public static function tearDownAfterClass() - { - print __METHOD__ . "\n"; - } - - protected function onNotSuccessfulTest(Exception $e) - { - print __METHOD__ . "\n"; - throw $e; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/TestIncomplete.php b/vendor/phpunit/phpunit/tests/_files/TestIncomplete.php deleted file mode 100644 index 743a761..0000000 --- a/vendor/phpunit/phpunit/tests/_files/TestIncomplete.php +++ /dev/null @@ -1,8 +0,0 @@ -markTestIncomplete('Incomplete test'); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/TestIterator.php b/vendor/phpunit/phpunit/tests/_files/TestIterator.php deleted file mode 100644 index 01135e3..0000000 --- a/vendor/phpunit/phpunit/tests/_files/TestIterator.php +++ /dev/null @@ -1,36 +0,0 @@ -array = $array; - } - - public function rewind() - { - $this->position = 0; - } - - public function valid() - { - return $this->position < count($this->array); - } - - public function key() - { - return $this->position; - } - - public function current() - { - return $this->array[$this->position]; - } - - public function next() - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/TestIterator2.php b/vendor/phpunit/phpunit/tests/_files/TestIterator2.php deleted file mode 100644 index 3b47fa3..0000000 --- a/vendor/phpunit/phpunit/tests/_files/TestIterator2.php +++ /dev/null @@ -1,35 +0,0 @@ -data = $array; - } - - public function current() - { - return current($this->data); - } - - public function next() - { - next($this->data); - } - - public function key() - { - return key($this->data); - } - - public function valid() - { - return key($this->data) !== null; - } - - public function rewind() - { - reset($this->data); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/TestSkipped.php b/vendor/phpunit/phpunit/tests/_files/TestSkipped.php deleted file mode 100644 index c2d68b2..0000000 --- a/vendor/phpunit/phpunit/tests/_files/TestSkipped.php +++ /dev/null @@ -1,8 +0,0 @@ -markTestSkipped('Skipped test'); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/TestTestError.php b/vendor/phpunit/phpunit/tests/_files/TestTestError.php deleted file mode 100644 index 6f61b8e..0000000 --- a/vendor/phpunit/phpunit/tests/_files/TestTestError.php +++ /dev/null @@ -1,8 +0,0 @@ -assertEquals($c, $a + $b); - } - - public static function providerMethod() - { - return array( - array(0, 0, 0), - array(0, 1, 1), - array(1, 1, 3), - array(1, 0, 1) - ); - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/ThrowExceptionTestCase.php b/vendor/phpunit/phpunit/tests/_files/ThrowExceptionTestCase.php deleted file mode 100644 index 1d2a769..0000000 --- a/vendor/phpunit/phpunit/tests/_files/ThrowExceptionTestCase.php +++ /dev/null @@ -1,8 +0,0 @@ -wasRun = true; - } -} diff --git a/vendor/phpunit/phpunit/tests/_files/bar.xml b/vendor/phpunit/phpunit/tests/_files/bar.xml deleted file mode 100644 index 5d3fa28..0000000 --- a/vendor/phpunit/phpunit/tests/_files/bar.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/phpunit/phpunit/tests/_files/configuration.colors.empty.xml b/vendor/phpunit/phpunit/tests/_files/configuration.colors.empty.xml deleted file mode 100644 index 5f9e055..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration.colors.empty.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/phpunit/phpunit/tests/_files/configuration.colors.false.xml b/vendor/phpunit/phpunit/tests/_files/configuration.colors.false.xml deleted file mode 100644 index dcd4aa4..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration.colors.false.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/phpunit/phpunit/tests/_files/configuration.colors.invalid.xml b/vendor/phpunit/phpunit/tests/_files/configuration.colors.invalid.xml deleted file mode 100644 index c5bd699..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration.colors.invalid.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/phpunit/phpunit/tests/_files/configuration.colors.true.xml b/vendor/phpunit/phpunit/tests/_files/configuration.colors.true.xml deleted file mode 100644 index 1efe413..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration.colors.true.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/phpunit/phpunit/tests/_files/configuration.custom-printer.xml b/vendor/phpunit/phpunit/tests/_files/configuration.custom-printer.xml deleted file mode 100644 index 7a5a1f1..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration.custom-printer.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/vendor/phpunit/phpunit/tests/_files/configuration.xml b/vendor/phpunit/phpunit/tests/_files/configuration.xml deleted file mode 100644 index e83bfd3..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - /path/to/files - /path/to/MyTest.php - - - - - - name - - - name - - - - - - /path/to/files - /path/to/file - - /path/to/files - /path/to/file - - - - /path/to/files - /path/to/file - - /path/to/files - /path/to/file - - - - - - - - - - Sebastian - - - 22 - April - 19.78 - - - MyTestFile.php - MyRelativePath - - - - 42 - - - - - - - - - - - - - - - . - /path/to/lib - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/tests/_files/configuration_empty.xml b/vendor/phpunit/phpunit/tests/_files/configuration_empty.xml deleted file mode 100644 index 13c8b71..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration_empty.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/tests/_files/configuration_xinclude.xml b/vendor/phpunit/phpunit/tests/_files/configuration_xinclude.xml deleted file mode 100644 index 4307629..0000000 --- a/vendor/phpunit/phpunit/tests/_files/configuration_xinclude.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - . - /path/to/lib - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/tests/_files/expectedFileFormat.txt b/vendor/phpunit/phpunit/tests/_files/expectedFileFormat.txt deleted file mode 100644 index b7d6715..0000000 --- a/vendor/phpunit/phpunit/tests/_files/expectedFileFormat.txt +++ /dev/null @@ -1 +0,0 @@ -FOO diff --git a/vendor/phpunit/phpunit/tests/_files/foo.xml b/vendor/phpunit/phpunit/tests/_files/foo.xml deleted file mode 100644 index f1999f8..0000000 --- a/vendor/phpunit/phpunit/tests/_files/foo.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/phpunit/phpunit/tests/_files/structureAttributesAreSameButValuesAreNot.xml b/vendor/phpunit/phpunit/tests/_files/structureAttributesAreSameButValuesAreNot.xml deleted file mode 100644 index a5d9ab3..0000000 --- a/vendor/phpunit/phpunit/tests/_files/structureAttributesAreSameButValuesAreNot.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - Image 1: Dette er en test caption - - - diff --git a/vendor/phpunit/phpunit/tests/_files/structureExpected.xml b/vendor/phpunit/phpunit/tests/_files/structureExpected.xml deleted file mode 100644 index d900105..0000000 --- a/vendor/phpunit/phpunit/tests/_files/structureExpected.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - Image 1: Dette er en test caption - - - diff --git a/vendor/phpunit/phpunit/tests/_files/structureIgnoreTextNodes.xml b/vendor/phpunit/phpunit/tests/_files/structureIgnoreTextNodes.xml deleted file mode 100644 index 0771b60..0000000 --- a/vendor/phpunit/phpunit/tests/_files/structureIgnoreTextNodes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - textnode - - textnode - - textnode - Image 1: Dette er en test caption - textnode - - - diff --git a/vendor/phpunit/phpunit/tests/_files/structureIsSameButDataIsNot.xml b/vendor/phpunit/phpunit/tests/_files/structureIsSameButDataIsNot.xml deleted file mode 100644 index 2ba21b9..0000000 --- a/vendor/phpunit/phpunit/tests/_files/structureIsSameButDataIsNot.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - Image is not the same 1: Dette er en test caption - - - diff --git a/vendor/phpunit/phpunit/tests/_files/structureWrongNumberOfAttributes.xml b/vendor/phpunit/phpunit/tests/_files/structureWrongNumberOfAttributes.xml deleted file mode 100644 index af9b974..0000000 --- a/vendor/phpunit/phpunit/tests/_files/structureWrongNumberOfAttributes.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - Image 1: Dette er en test caption - - - diff --git a/vendor/phpunit/phpunit/tests/_files/structureWrongNumberOfNodes.xml b/vendor/phpunit/phpunit/tests/_files/structureWrongNumberOfNodes.xml deleted file mode 100644 index 9a394e2..0000000 --- a/vendor/phpunit/phpunit/tests/_files/structureWrongNumberOfNodes.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/vendor/phpunit/phpunit/tests/bootstrap.php b/vendor/phpunit/phpunit/tests/bootstrap.php deleted file mode 100644 index cc79889..0000000 --- a/vendor/phpunit/phpunit/tests/bootstrap.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\ArrayComparator - * - */ -class ArrayComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new ArrayComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsFailsProvider() - { - return array( - array(array(), null), - array(null, array()), - array(null, null) - ); - } - - public function assertEqualsSucceedsProvider() - { - return array( - array( - array('a' => 1, 'b' => 2), - array('b' => 2, 'a' => 1) - ), - array( - array(1), - array('1') - ), - array( - array(3, 2, 1), - array(2, 3, 1), - 0, - true - ), - array( - array(2.3), - array(2.5), - 0.5 - ), - array( - array(array(2.3)), - array(array(2.5)), - 0.5 - ), - array( - array(new Struct(2.3)), - array(new Struct(2.5)), - 0.5 - ), - ); - } - - public function assertEqualsFailsProvider() - { - return array( - array( - array(), - array(0 => 1) - ), - array( - array(0 => 1), - array() - ), - array( - array(0 => null), - array() - ), - array( - array(0 => 1, 1 => 2), - array(0 => 1, 1 => 3) - ), - array( - array('a', 'b' => array(1, 2)), - array('a', 'b' => array(2, 1)) - ), - array( - array(2.3), - array(4.2), - 0.5 - ), - array( - array(array(2.3)), - array(array(4.2)), - 0.5 - ), - array( - array(new Struct(2.3)), - array(new Struct(4.2)), - 0.5 - ) - ); - } - - /** - * @covers ::accepts - */ - public function testAcceptsSucceeds() - { - $this->assertTrue( - $this->comparator->accepts(array(), array()) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0, $canonicalize = false) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta, $canonicalize); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual,$delta = 0.0, $canonicalize = false) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', - 'Failed asserting that two arrays are equal' - ); - $this->comparator->assertEquals($expected, $actual, $delta, $canonicalize); - } -} diff --git a/vendor/sebastian/comparator/tests/DOMNodeComparatorTest.php b/vendor/sebastian/comparator/tests/DOMNodeComparatorTest.php deleted file mode 100644 index a769b84..0000000 --- a/vendor/sebastian/comparator/tests/DOMNodeComparatorTest.php +++ /dev/null @@ -1,162 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -use DOMNode; -use DOMDocument; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\DOMNodeComparator - * - */ -class DOMNodeComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new DOMNodeComparator; - } - - public function acceptsSucceedsProvider() - { - $document = new DOMDocument; - $node = new DOMNode; - - return array( - array($document, $document), - array($node, $node), - array($document, $node), - array($node, $document) - ); - } - - public function acceptsFailsProvider() - { - $document = new DOMDocument; - - return array( - array($document, null), - array(null, $document), - array(null, null) - ); - } - - public function assertEqualsSucceedsProvider() - { - return array( - array( - $this->createDOMDocument(''), - $this->createDOMDocument('') - ), - array( - $this->createDOMDocument(''), - $this->createDOMDocument('') - ), - array( - $this->createDOMDocument(''), - $this->createDOMDocument('') - ), - array( - $this->createDOMDocument("\n \n"), - $this->createDOMDocument('') - ), - ); - } - - public function assertEqualsFailsProvider() - { - return array( - array( - $this->createDOMDocument(''), - $this->createDOMDocument('') - ), - array( - $this->createDOMDocument(''), - $this->createDOMDocument('') - ), - array( - $this->createDOMDocument(' bar '), - $this->createDOMDocument('') - ), - array( - $this->createDOMDocument(''), - $this->createDOMDocument('') - ), - array( - $this->createDOMDocument(' bar '), - $this->createDOMDocument(' bir ') - ) - ); - } - - private function createDOMDocument($content) - { - $document = new DOMDocument; - $document->preserveWhiteSpace = false; - $document->loadXML($content); - - return $document; - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', - 'Failed asserting that two DOM' - ); - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/DateTimeComparatorTest.php b/vendor/sebastian/comparator/tests/DateTimeComparatorTest.php deleted file mode 100644 index 9abcff7..0000000 --- a/vendor/sebastian/comparator/tests/DateTimeComparatorTest.php +++ /dev/null @@ -1,216 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -use DateTime; -use DateTimeImmutable; -use DateTimeZone; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\DateTimeComparator - * - */ -class DateTimeComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new DateTimeComparator; - } - - public function acceptsFailsProvider() - { - $datetime = new DateTime; - - return array( - array($datetime, null), - array(null, $datetime), - array(null, null) - ); - } - - public function assertEqualsSucceedsProvider() - { - return array( - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')) - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:25', new DateTimeZone('America/New_York')), - 10 - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:14:40', new DateTimeZone('America/New_York')), - 65 - ), - array( - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29', new DateTimeZone('America/New_York')) - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/Chicago')) - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:49', new DateTimeZone('America/Chicago')), - 15 - ), - array( - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 23:00:00', new DateTimeZone('America/Chicago')) - ), - array( - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 23:01:30', new DateTimeZone('America/Chicago')), - 100 - ), - array( - new DateTime('@1364616000'), - new DateTime('2013-03-29 23:00:00', new DateTimeZone('America/Chicago')) - ), - array( - new DateTime('2013-03-29T05:13:35-0500'), - new DateTime('2013-03-29T04:13:35-0600') - ) - ); - } - - public function assertEqualsFailsProvider() - { - return array( - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')) - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/New_York')), - 3500 - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 05:13:35', new DateTimeZone('America/New_York')), - 3500 - ), - array( - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/New_York')) - ), - array( - new DateTime('2013-03-29', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - 43200 - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')), - ), - array( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/Chicago')), - 3500 - ), - array( - new DateTime('2013-03-30', new DateTimeZone('America/New_York')), - new DateTime('2013-03-30', new DateTimeZone('America/Chicago')) - ), - array( - new DateTime('2013-03-29T05:13:35-0600'), - new DateTime('2013-03-29T04:13:35-0600') - ), - array( - new DateTime('2013-03-29T05:13:35-0600'), - new DateTime('2013-03-29T05:13:35-0500') - ), - ); - } - - /** - * @covers ::accepts - */ - public function testAcceptsSucceeds() - { - $this->assertTrue( - $this->comparator->accepts( - new DateTime, - new DateTime - ) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $delta = 0.0) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', - 'Failed asserting that two DateTime objects are equal.' - ); - $this->comparator->assertEquals($expected, $actual, $delta); - } - - /** - * @requires PHP 5.5 - * @covers ::accepts - */ - public function testAcceptsDateTimeInterface() - { - $this->assertTrue($this->comparator->accepts(new DateTime, new DateTimeImmutable)); - } - - /** - * @requires PHP 5.5 - * @covers ::assertEquals - */ - public function testSupportsDateTimeInterface() - { - $this->comparator->assertEquals( - new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York')), - new DateTimeImmutable('2013-03-29 04:13:35', new DateTimeZone('America/New_York')) - ); - } -} diff --git a/vendor/sebastian/comparator/tests/DoubleComparatorTest.php b/vendor/sebastian/comparator/tests/DoubleComparatorTest.php deleted file mode 100644 index 6b898ba..0000000 --- a/vendor/sebastian/comparator/tests/DoubleComparatorTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\DoubleComparator - * - */ -class DoubleComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new DoubleComparator; - } - - public function acceptsSucceedsProvider() - { - return array( - array(0, 5.0), - array(5.0, 0), - array('5', 4.5), - array(1.2e3, 7E-10), - array(3, acos(8)), - array(acos(8), 3), - array(acos(8), acos(8)) - ); - } - - public function acceptsFailsProvider() - { - return array( - array(5, 5), - array('4.5', 5), - array(0x539, 02471), - array(5.0, false), - array(null, 5.0) - ); - } - - public function assertEqualsSucceedsProvider() - { - return array( - array(2.3, 2.3), - array('2.3', 2.3), - array(5.0, 5), - array(5, 5.0), - array(5.0, '5'), - array(1.2e3, 1200), - array(2.3, 2.5, 0.5), - array(3, 3.05, 0.05), - array(1.2e3, 1201, 1), - array((string)(1/3), 1 - 2/3), - array(1/3, (string)(1 - 2/3)) - ); - } - - public function assertEqualsFailsProvider() - { - return array( - array(2.3, 4.2), - array('2.3', 4.2), - array(5.0, '4'), - array(5.0, 6), - array(1.2e3, 1201), - array(2.3, 2.5, 0.2), - array(3, 3.05, 0.04), - array(3, acos(8)), - array(acos(8), 3), - array(acos(8), acos(8)) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $delta = 0.0) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', 'matches expected' - ); - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/ExceptionComparatorTest.php b/vendor/sebastian/comparator/tests/ExceptionComparatorTest.php deleted file mode 100644 index fa8cc0a..0000000 --- a/vendor/sebastian/comparator/tests/ExceptionComparatorTest.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -use \Exception; -use \RuntimeException; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\ExceptionComparator - * - */ -class ExceptionComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new ExceptionComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsSucceedsProvider() - { - return array( - array(new Exception, new Exception), - array(new RuntimeException, new RuntimeException), - array(new Exception, new RuntimeException) - ); - } - - public function acceptsFailsProvider() - { - return array( - array(new Exception, null), - array(null, new Exception), - array(null, null) - ); - } - - public function assertEqualsSucceedsProvider() - { - $exception1 = new Exception; - $exception2 = new Exception; - - $exception3 = new RunTimeException('Error', 100); - $exception4 = new RunTimeException('Error', 100); - - return array( - array($exception1, $exception1), - array($exception1, $exception2), - array($exception3, $exception3), - array($exception3, $exception4) - ); - } - - public function assertEqualsFailsProvider() - { - $typeMessage = 'not instance of expected class'; - $equalMessage = 'Failed asserting that two objects are equal.'; - - $exception1 = new Exception('Error', 100); - $exception2 = new Exception('Error', 101); - $exception3 = new Exception('Errors', 101); - - $exception4 = new RunTimeException('Error', 100); - $exception5 = new RunTimeException('Error', 101); - - return array( - array($exception1, $exception2, $equalMessage), - array($exception1, $exception3, $equalMessage), - array($exception1, $exception4, $typeMessage), - array($exception2, $exception3, $equalMessage), - array($exception4, $exception5, $equalMessage) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', $message - ); - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/FactoryTest.php b/vendor/sebastian/comparator/tests/FactoryTest.php deleted file mode 100644 index cb58c20..0000000 --- a/vendor/sebastian/comparator/tests/FactoryTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\Factory - * - */ -class FactoryTest extends \PHPUnit_Framework_TestCase -{ - public function instanceProvider() - { - $tmpfile = tmpfile(); - - return array( - array(NULL, NULL, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array(NULL, TRUE, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array(TRUE, NULL, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array(TRUE, TRUE, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array(FALSE, FALSE, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array(TRUE, FALSE, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array(FALSE, TRUE, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array('', '', 'SebastianBergmann\\Comparator\\ScalarComparator'), - array('0', '0', 'SebastianBergmann\\Comparator\\ScalarComparator'), - array('0', 0, 'SebastianBergmann\\Comparator\\NumericComparator'), - array(0, '0', 'SebastianBergmann\\Comparator\\NumericComparator'), - array(0, 0, 'SebastianBergmann\\Comparator\\NumericComparator'), - array(1.0, 0, 'SebastianBergmann\\Comparator\\DoubleComparator'), - array(0, 1.0, 'SebastianBergmann\\Comparator\\DoubleComparator'), - array(1.0, 1.0, 'SebastianBergmann\\Comparator\\DoubleComparator'), - array(array(1), array(1), 'SebastianBergmann\\Comparator\\ArrayComparator'), - array($tmpfile, $tmpfile, 'SebastianBergmann\\Comparator\\ResourceComparator'), - array(new \stdClass, new \stdClass, 'SebastianBergmann\\Comparator\\ObjectComparator'), - array(new \DateTime, new \DateTime, 'SebastianBergmann\\Comparator\\DateTimeComparator'), - array(new \SplObjectStorage, new \SplObjectStorage, 'SebastianBergmann\\Comparator\\SplObjectStorageComparator'), - array(new \Exception, new \Exception, 'SebastianBergmann\\Comparator\\ExceptionComparator'), - array(new \DOMDocument, new \DOMDocument, 'SebastianBergmann\\Comparator\\DOMNodeComparator'), - // mixed types - array($tmpfile, array(1), 'SebastianBergmann\\Comparator\\TypeComparator'), - array(array(1), $tmpfile, 'SebastianBergmann\\Comparator\\TypeComparator'), - array($tmpfile, '1', 'SebastianBergmann\\Comparator\\TypeComparator'), - array('1', $tmpfile, 'SebastianBergmann\\Comparator\\TypeComparator'), - array($tmpfile, new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'), - array(new \stdClass, $tmpfile, 'SebastianBergmann\\Comparator\\TypeComparator'), - array(new \stdClass, array(1), 'SebastianBergmann\\Comparator\\TypeComparator'), - array(array(1), new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'), - array(new \stdClass, '1', 'SebastianBergmann\\Comparator\\TypeComparator'), - array('1', new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'), - array(new ClassWithToString, '1', 'SebastianBergmann\\Comparator\\ScalarComparator'), - array('1', new ClassWithToString, 'SebastianBergmann\\Comparator\\ScalarComparator'), - array(1.0, new \stdClass, 'SebastianBergmann\\Comparator\\TypeComparator'), - array(new \stdClass, 1.0, 'SebastianBergmann\\Comparator\\TypeComparator'), - array(1.0, array(1), 'SebastianBergmann\\Comparator\\TypeComparator'), - array(array(1), 1.0, 'SebastianBergmann\\Comparator\\TypeComparator'), - ); - } - - /** - * @dataProvider instanceProvider - * @covers ::getComparatorFor - * @covers ::__construct - */ - public function testGetComparatorFor($a, $b, $expected) - { - $factory = new Factory; - $actual = $factory->getComparatorFor($a, $b); - $this->assertInstanceOf($expected, $actual); - } - - /** - * @covers ::register - */ - public function testRegister() - { - $comparator = new TestClassComparator; - - $factory = new Factory; - $factory->register($comparator); - - $a = new TestClass; - $b = new TestClass; - $expected = 'SebastianBergmann\\Comparator\\TestClassComparator'; - $actual = $factory->getComparatorFor($a, $b); - - $factory->unregister($comparator); - $this->assertInstanceOf($expected, $actual); - } - - /** - * @covers ::unregister - */ - public function testUnregister() - { - $comparator = new TestClassComparator; - - $factory = new Factory; - $factory->register($comparator); - $factory->unregister($comparator); - - $a = new TestClass; - $b = new TestClass; - $expected = 'SebastianBergmann\\Comparator\\ObjectComparator'; - $actual = $factory->getComparatorFor($a, $b); - - $this->assertInstanceOf($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/MockObjectComparatorTest.php b/vendor/sebastian/comparator/tests/MockObjectComparatorTest.php deleted file mode 100644 index 7910ad7..0000000 --- a/vendor/sebastian/comparator/tests/MockObjectComparatorTest.php +++ /dev/null @@ -1,166 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\MockObjectComparator - * - */ -class MockObjectComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new MockObjectComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsSucceedsProvider() - { - $testmock = $this->getMock('SebastianBergmann\\Comparator\\TestClass'); - $stdmock = $this->getMock('stdClass'); - - return array( - array($testmock, $testmock), - array($stdmock, $stdmock), - array($stdmock, $testmock) - ); - } - - public function acceptsFailsProvider() - { - $stdmock = $this->getMock('stdClass'); - - return array( - array($stdmock, null), - array(null, $stdmock), - array(null, null) - ); - } - - public function assertEqualsSucceedsProvider() - { - // cyclic dependencies - $book1 = $this->getMock('SebastianBergmann\\Comparator\\Book', null); - $book1->author = $this->getMock('SebastianBergmann\\Comparator\\Author', null, array('Terry Pratchett')); - $book1->author->books[] = $book1; - $book2 = $this->getMock('SebastianBergmann\\Comparator\\Book', null); - $book2->author = $this->getMock('SebastianBergmann\\Comparator\\Author', null, array('Terry Pratchett')); - $book2->author->books[] = $book2; - - $object1 = $this->getMock('SebastianBergmann\\Comparator\\SampleClass', null, array(4, 8, 15)); - $object2 = $this->getMock('SebastianBergmann\\Comparator\\SampleClass', null, array(4, 8, 15)); - - return array( - array($object1, $object1), - array($object1, $object2), - array($book1, $book1), - array($book1, $book2), - array( - $this->getMock('SebastianBergmann\\Comparator\\Struct', null, array(2.3)), - $this->getMock('SebastianBergmann\\Comparator\\Struct', null, array(2.5)), - 0.5 - ) - ); - } - - public function assertEqualsFailsProvider() - { - $typeMessage = 'is not instance of expected class'; - $equalMessage = 'Failed asserting that two objects are equal.'; - - // cyclic dependencies - $book1 = $this->getMock('SebastianBergmann\\Comparator\\Book', null); - $book1->author = $this->getMock('SebastianBergmann\\Comparator\\Author', null, array('Terry Pratchett')); - $book1->author->books[] = $book1; - $book2 = $this->getMock('SebastianBergmann\\Comparator\\Book', null); - $book2->author = $this->getMock('SebastianBergmann\\Comparator\\Author', null, array('Terry Pratch')); - $book2->author->books[] = $book2; - - $book3 = $this->getMock('SebastianBergmann\\Comparator\\Book', null); - $book3->author = 'Terry Pratchett'; - $book4 = $this->getMock('stdClass'); - $book4->author = 'Terry Pratchett'; - - $object1 = $this->getMock('SebastianBergmann\\Comparator\\SampleClass', null, array(4, 8, 15)); - $object2 = $this->getMock('SebastianBergmann\\Comparator\\SampleClass', null, array(16, 23, 42)); - - return array( - array( - $this->getMock('SebastianBergmann\\Comparator\\SampleClass', null, array(4, 8, 15)), - $this->getMock('SebastianBergmann\\Comparator\\SampleClass', null, array(16, 23, 42)), - $equalMessage - ), - array($object1, $object2, $equalMessage), - array($book1, $book2, $equalMessage), - array($book3, $book4, $typeMessage), - array( - $this->getMock('SebastianBergmann\\Comparator\\Struct', null, array(2.3)), - $this->getMock('SebastianBergmann\\Comparator\\Struct', null, array(4.2)), - $equalMessage, - 0.5 - ) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message, $delta = 0.0) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', $message - ); - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/NumericComparatorTest.php b/vendor/sebastian/comparator/tests/NumericComparatorTest.php deleted file mode 100644 index fec7d00..0000000 --- a/vendor/sebastian/comparator/tests/NumericComparatorTest.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\NumericComparator - * - */ -class NumericComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new NumericComparator; - } - - public function acceptsSucceedsProvider() - { - return array( - array(5, 10), - array(8, '0'), - array('10', 0), - array(0x74c3b00c, 42), - array(0755, 0777) - ); - } - - public function acceptsFailsProvider() - { - return array( - array('5', '10'), - array(8, 5.0), - array(5.0, 8), - array(10, null), - array(false, 12) - ); - } - - public function assertEqualsSucceedsProvider() - { - return array( - array(1337, 1337), - array('1337', 1337), - array(0x539, 1337), - array(02471, 1337), - array(1337, 1338, 1), - array('1337', 1340, 5), - ); - } - - public function assertEqualsFailsProvider() - { - return array( - array(1337, 1338), - array('1338', 1337), - array(0x539, 1338), - array(1337, 1339, 1), - array('1337', 1340, 2), - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $delta = 0.0) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', 'matches expected' - ); - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/ObjectComparatorTest.php b/vendor/sebastian/comparator/tests/ObjectComparatorTest.php deleted file mode 100644 index a958232..0000000 --- a/vendor/sebastian/comparator/tests/ObjectComparatorTest.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -use stdClass; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\ObjectComparator - * - */ -class ObjectComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new ObjectComparator; - $this->comparator->setFactory(new Factory); - } - - public function acceptsSucceedsProvider() - { - return array( - array(new TestClass, new TestClass), - array(new stdClass, new stdClass), - array(new stdClass, new TestClass) - ); - } - - public function acceptsFailsProvider() - { - return array( - array(new stdClass, null), - array(null, new stdClass), - array(null, null) - ); - } - - public function assertEqualsSucceedsProvider() - { - // cyclic dependencies - $book1 = new Book; - $book1->author = new Author('Terry Pratchett'); - $book1->author->books[] = $book1; - $book2 = new Book; - $book2->author = new Author('Terry Pratchett'); - $book2->author->books[] = $book2; - - $object1 = new SampleClass(4, 8, 15); - $object2 = new SampleClass(4, 8, 15); - - return array( - array($object1, $object1), - array($object1, $object2), - array($book1, $book1), - array($book1, $book2), - array(new Struct(2.3), new Struct(2.5), 0.5) - ); - } - - public function assertEqualsFailsProvider() - { - $typeMessage = 'is not instance of expected class'; - $equalMessage = 'Failed asserting that two objects are equal.'; - - // cyclic dependencies - $book1 = new Book; - $book1->author = new Author('Terry Pratchett'); - $book1->author->books[] = $book1; - $book2 = new Book; - $book2->author = new Author('Terry Pratch'); - $book2->author->books[] = $book2; - - $book3 = new Book; - $book3->author = 'Terry Pratchett'; - $book4 = new stdClass; - $book4->author = 'Terry Pratchett'; - - $object1 = new SampleClass( 4, 8, 15); - $object2 = new SampleClass(16, 23, 42); - - return array( - array(new SampleClass(4, 8, 15), new SampleClass(16, 23, 42), $equalMessage), - array($object1, $object2, $equalMessage), - array($book1, $book2, $equalMessage), - array($book3, $book4, $typeMessage), - array(new Struct(2.3), new Struct(4.2), $equalMessage, 0.5) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $delta = 0.0) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, $delta); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message, $delta = 0.0) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', $message - ); - $this->comparator->assertEquals($expected, $actual, $delta); - } -} diff --git a/vendor/sebastian/comparator/tests/ResourceComparatorTest.php b/vendor/sebastian/comparator/tests/ResourceComparatorTest.php deleted file mode 100644 index a9e9e95..0000000 --- a/vendor/sebastian/comparator/tests/ResourceComparatorTest.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\ResourceComparator - * - */ -class ResourceComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new ResourceComparator; - } - - public function acceptsSucceedsProvider() - { - $tmpfile1 = tmpfile(); - $tmpfile2 = tmpfile(); - - return array( - array($tmpfile1, $tmpfile1), - array($tmpfile2, $tmpfile2), - array($tmpfile1, $tmpfile2) - ); - } - - public function acceptsFailsProvider() - { - $tmpfile1 = tmpfile(); - - return array( - array($tmpfile1, null), - array(null, $tmpfile1), - array(null, null) - ); - } - - public function assertEqualsSucceedsProvider() - { - $tmpfile1 = tmpfile(); - $tmpfile2 = tmpfile(); - - return array( - array($tmpfile1, $tmpfile1), - array($tmpfile2, $tmpfile2) - ); - } - - public function assertEqualsFailsProvider() - { - $tmpfile1 = tmpfile(); - $tmpfile2 = tmpfile(); - - return array( - array($tmpfile1, $tmpfile2), - array($tmpfile2, $tmpfile1) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual) - { - $this->setExpectedException('SebastianBergmann\\Comparator\\ComparisonFailure'); - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/ScalarComparatorTest.php b/vendor/sebastian/comparator/tests/ScalarComparatorTest.php deleted file mode 100644 index e5156aa..0000000 --- a/vendor/sebastian/comparator/tests/ScalarComparatorTest.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\ScalarComparator - * - */ -class ScalarComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new ScalarComparator; - } - - public function acceptsSucceedsProvider() - { - return array( - array("string", "string"), - array(new ClassWithToString, "string"), - array("string", new ClassWithToString), - array("string", null), - array(false, "string"), - array(false, true), - array(null, false), - array(null, null), - array("10", 10), - array("", false), - array("1", true), - array(1, true), - array(0, false), - array(0.1, "0.1") - ); - } - - public function acceptsFailsProvider() - { - return array( - array(array(), array()), - array("string", array()), - array(new ClassWithToString, new ClassWithToString), - array(false, new ClassWithToString), - array(tmpfile(), tmpfile()) - ); - } - - public function assertEqualsSucceedsProvider() - { - return array( - array("string", "string"), - array(new ClassWithToString, new ClassWithToString), - array("string representation", new ClassWithToString), - array(new ClassWithToString, "string representation"), - array("string", "STRING", true), - array("STRING", "string", true), - array("String Representation", new ClassWithToString, true), - array(new ClassWithToString, "String Representation", true), - array("10", 10), - array("", false), - array("1", true), - array(1, true), - array(0, false), - array(0.1, "0.1"), - array(false, null), - array(false, false), - array(true, true), - array(null, null) - ); - } - - public function assertEqualsFailsProvider() - { - $stringException = 'Failed asserting that two strings are equal.'; - $otherException = 'matches expected'; - - return array( - array("string", "other string", $stringException), - array("string", "STRING", $stringException), - array("STRING", "string", $stringException), - array("string", "other string", $stringException), - // https://github.com/sebastianbergmann/phpunit/issues/1023 - array('9E6666666','9E7777777', $stringException), - array(new ClassWithToString, "does not match", $otherException), - array("does not match", new ClassWithToString, $otherException), - array(0, 'Foobar', $otherException), - array('Foobar', 0, $otherException), - array("10", 25, $otherException), - array("1", false, $otherException), - array("", true, $otherException), - array(false, true, $otherException), - array(true, false, $otherException), - array(null, true, $otherException), - array(0, true, $otherException) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual, $ignoreCase = false) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual, 0.0, false, $ignoreCase); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual, $message) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', $message - ); - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/SplObjectStorageComparatorTest.php b/vendor/sebastian/comparator/tests/SplObjectStorageComparatorTest.php deleted file mode 100644 index 766dd2d..0000000 --- a/vendor/sebastian/comparator/tests/SplObjectStorageComparatorTest.php +++ /dev/null @@ -1,137 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -use SplObjectStorage; -use stdClass; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\SplObjectStorageComparator - * - */ -class SplObjectStorageComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new SplObjectStorageComparator; - } - - public function acceptsFailsProvider() - { - return array( - array(new SplObjectStorage, new stdClass), - array(new stdClass, new SplObjectStorage), - array(new stdClass, new stdClass) - ); - } - - public function assertEqualsSucceedsProvider() - { - $object1 = new stdClass(); - $object2 = new stdClass(); - - $storage1 = new SplObjectStorage(); - $storage2 = new SplObjectStorage(); - - $storage3 = new SplObjectStorage(); - $storage3->attach($object1); - $storage3->attach($object2); - - $storage4 = new SplObjectStorage(); - $storage4->attach($object2); - $storage4->attach($object1); - - return array( - array($storage1, $storage1), - array($storage1, $storage2), - array($storage3, $storage3), - array($storage3, $storage4) - ); - } - - public function assertEqualsFailsProvider() - { - $object1 = new stdClass; - $object2 = new stdClass; - - $storage1 = new SplObjectStorage; - - $storage2 = new SplObjectStorage; - $storage2->attach($object1); - - $storage3 = new SplObjectStorage; - $storage3->attach($object2); - $storage3->attach($object1); - - return array( - array($storage1, $storage2), - array($storage1, $storage3), - array($storage2, $storage3), - ); - } - - /** - * @covers ::accepts - */ - public function testAcceptsSucceeds() - { - $this->assertTrue( - $this->comparator->accepts( - new SplObjectStorage, - new SplObjectStorage - ) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsFailsProvider - */ - public function testAcceptsFails($expected, $actual) - { - $this->assertFalse( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual) - { - $this->setExpectedException( - 'SebastianBergmann\\Comparator\\ComparisonFailure', - 'Failed asserting that two objects are equal.' - ); - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/TypeComparatorTest.php b/vendor/sebastian/comparator/tests/TypeComparatorTest.php deleted file mode 100644 index bb51f8a..0000000 --- a/vendor/sebastian/comparator/tests/TypeComparatorTest.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -use stdClass; - -/** - * @coversDefaultClass SebastianBergmann\Comparator\TypeComparator - * - */ -class TypeComparatorTest extends \PHPUnit_Framework_TestCase -{ - private $comparator; - - protected function setUp() - { - $this->comparator = new TypeComparator; - } - - public function acceptsSucceedsProvider() - { - return array( - array(true, 1), - array(false, array(1)), - array(null, new stdClass), - array(1.0, 5), - array("", "") - ); - } - - public function assertEqualsSucceedsProvider() - { - return array( - array(true, true), - array(true, false), - array(false, false), - array(null, null), - array(new stdClass, new stdClass), - array(0, 0), - array(1.0, 2.0), - array("hello", "world"), - array("", ""), - array(array(), array(1,2,3)) - ); - } - - public function assertEqualsFailsProvider() - { - return array( - array(true, null), - array(null, false), - array(1.0, 0), - array(new stdClass, array()), - array("1", 1) - ); - } - - /** - * @covers ::accepts - * @dataProvider acceptsSucceedsProvider - */ - public function testAcceptsSucceeds($expected, $actual) - { - $this->assertTrue( - $this->comparator->accepts($expected, $actual) - ); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsSucceedsProvider - */ - public function testAssertEqualsSucceeds($expected, $actual) - { - $exception = null; - - try { - $this->comparator->assertEquals($expected, $actual); - } - - catch (ComparisonFailure $exception) { - } - - $this->assertNull($exception, 'Unexpected ComparisonFailure'); - } - - /** - * @covers ::assertEquals - * @dataProvider assertEqualsFailsProvider - */ - public function testAssertEqualsFails($expected, $actual) - { - $this->setExpectedException('SebastianBergmann\\Comparator\\ComparisonFailure', 'does not match expected type'); - $this->comparator->assertEquals($expected, $actual); - } -} diff --git a/vendor/sebastian/comparator/tests/_files/Author.php b/vendor/sebastian/comparator/tests/_files/Author.php deleted file mode 100644 index ae698c3..0000000 --- a/vendor/sebastian/comparator/tests/_files/Author.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * An author. - * - */ -class Author -{ - // the order of properties is important for testing the cycle! - public $books = array(); - - private $name = ''; - - public function __construct($name) - { - $this->name = $name; - } -} diff --git a/vendor/sebastian/comparator/tests/_files/Book.php b/vendor/sebastian/comparator/tests/_files/Book.php deleted file mode 100644 index 6171bc3..0000000 --- a/vendor/sebastian/comparator/tests/_files/Book.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * A book. - * - */ -class Book -{ - // the order of properties is important for testing the cycle! - public $author = null; -} diff --git a/vendor/sebastian/comparator/tests/_files/ClassWithToString.php b/vendor/sebastian/comparator/tests/_files/ClassWithToString.php deleted file mode 100644 index e8e03bc..0000000 --- a/vendor/sebastian/comparator/tests/_files/ClassWithToString.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -class ClassWithToString -{ - public function __toString() - { - return 'string representation'; - } -} diff --git a/vendor/sebastian/comparator/tests/_files/SampleClass.php b/vendor/sebastian/comparator/tests/_files/SampleClass.php deleted file mode 100644 index 6079dd3..0000000 --- a/vendor/sebastian/comparator/tests/_files/SampleClass.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * A sample class. - * - */ -class SampleClass -{ - public $a; - protected $b; - protected $c; - - public function __construct($a, $b, $c) - { - $this->a = $a; - $this->b = $b; - $this->c = $c; - } -} diff --git a/vendor/sebastian/comparator/tests/_files/Struct.php b/vendor/sebastian/comparator/tests/_files/Struct.php deleted file mode 100644 index 79ec559..0000000 --- a/vendor/sebastian/comparator/tests/_files/Struct.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -/** - * A struct. - * - */ -class Struct -{ - public $var; - - public function __construct($var) - { - $this->var = $var; - } -} diff --git a/vendor/sebastian/comparator/tests/_files/TestClass.php b/vendor/sebastian/comparator/tests/_files/TestClass.php deleted file mode 100644 index e4c9b78..0000000 --- a/vendor/sebastian/comparator/tests/_files/TestClass.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -class TestClass { -} diff --git a/vendor/sebastian/comparator/tests/_files/TestClassComparator.php b/vendor/sebastian/comparator/tests/_files/TestClassComparator.php deleted file mode 100644 index 52aac3f..0000000 --- a/vendor/sebastian/comparator/tests/_files/TestClassComparator.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Comparator; - -class TestClassComparator extends ObjectComparator { -} diff --git a/vendor/sebastian/comparator/tests/autoload.php b/vendor/sebastian/comparator/tests/autoload.php deleted file mode 100644 index f4d9bbc..0000000 --- a/vendor/sebastian/comparator/tests/autoload.php +++ /dev/null @@ -1,38 +0,0 @@ - '/ArrayComparatorTest.php', - 'sebastianbergmann\\comparator\\author' => '/_files/Author.php', - 'sebastianbergmann\\comparator\\book' => '/_files/Book.php', - 'sebastianbergmann\\comparator\\classwithtostring' => '/_files/ClassWithToString.php', - 'sebastianbergmann\\comparator\\datetimecomparatortest' => '/DateTimeComparatorTest.php', - 'sebastianbergmann\\comparator\\domnodecomparatortest' => '/DOMNodeComparatorTest.php', - 'sebastianbergmann\\comparator\\doublecomparatortest' => '/DoubleComparatorTest.php', - 'sebastianbergmann\\comparator\\exceptioncomparatortest' => '/ExceptionComparatorTest.php', - 'sebastianbergmann\\comparator\\factorytest' => '/FactoryTest.php', - 'sebastianbergmann\\comparator\\mockobjectcomparatortest' => '/MockObjectComparatorTest.php', - 'sebastianbergmann\\comparator\\numericcomparatortest' => '/NumericComparatorTest.php', - 'sebastianbergmann\\comparator\\objectcomparatortest' => '/ObjectComparatorTest.php', - 'sebastianbergmann\\comparator\\resourcecomparatortest' => '/ResourceComparatorTest.php', - 'sebastianbergmann\\comparator\\sampleclass' => '/_files/SampleClass.php', - 'sebastianbergmann\\comparator\\scalarcomparatortest' => '/ScalarComparatorTest.php', - 'sebastianbergmann\\comparator\\splobjectstoragecomparatortest' => '/SplObjectStorageComparatorTest.php', - 'sebastianbergmann\\comparator\\struct' => '/_files/Struct.php', - 'sebastianbergmann\\comparator\\testclass' => '/_files/TestClass.php', - 'sebastianbergmann\\comparator\\testclasscomparator' => '/_files/TestClassComparator.php', - 'sebastianbergmann\\comparator\\typecomparatortest' => '/TypeComparatorTest.php' - ); - } - $cn = strtolower($class); - if (isset($classes[$cn])) { - require __DIR__ . $classes[$cn]; - } - } -); -// @codeCoverageIgnoreEnd diff --git a/vendor/sebastian/comparator/tests/bootstrap.php b/vendor/sebastian/comparator/tests/bootstrap.php deleted file mode 100644 index 8f1c57c..0000000 --- a/vendor/sebastian/comparator/tests/bootstrap.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff\LCS; - -use PHPUnit_Framework_TestCase; - -/** - * Some of these tests are volontary stressfull, in order to give some approximative benchmark hints. - */ -class TimeEfficientImplementationTest extends PHPUnit_Framework_TestCase -{ - private $implementation; - private $memory_limit; - private $stress_sizes = array(1, 2, 3, 100, 500, 1000, 2000); - - protected function setUp() - { - $this->memory_limit = ini_get('memory_limit'); - ini_set('memory_limit', '256M'); - - $this->implementation = new TimeEfficientImplementation; - } - - protected function tearDown() - { - ini_set('memory_limit', $this->memory_limit); - } - - public function testBothEmpty() - { - $from = array(); - $to = array(); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals(array(), $common); - } - - public function testIsStrictComparison() - { - $from = array( - false, 0, 0.0, '', null, array(), - true, 1, 1.0, 'foo', array('foo', 'bar'), array('foo' => 'bar') - ); - $to = $from; - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($from, $common); - - $to = array( - false, false, false, false, false, false, - true, true, true, true, true, true - ); - $expected = array( - false, - true, - ); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($expected, $common); - } - - public function testEqualSequences() - { - foreach ($this->stress_sizes as $size) { - $range = range(1, $size); - $from = $range; - $to = $range; - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($range, $common); - } - } - - public function testDistinctSequences() - { - $from = array('A'); - $to = array('B'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals(array(), $common); - - $from = array('A', 'B', 'C'); - $to = array('D', 'E', 'F'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals(array(), $common); - - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = range($size + 1, $size * 2); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals(array(), $common); - } - } - - public function testCommonSubsequence() - { - $from = array('A', 'C', 'E', 'F', 'G' ); - $to = array('A', 'B', 'D', 'E', 'H'); - $expected = array('A', 'E' ); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals($expected, $common); - - $from = array('A', 'C', 'E', 'F', 'G' ); - $to = array( 'B', 'C', 'D', 'E', 'F', 'H'); - $expected = array('C', 'E', 'F' ); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals($expected, $common); - - foreach ($this->stress_sizes as $size) { - $from = $size < 2 ? array(1) : range(1, $size + 1, 2); - $to = $size < 3 ? array(1) : range(1, $size + 1, 3); - $expected = $size < 6 ? array(1) : range(1, $size + 1, 6); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($expected, $common); - } - } - - public function testSingleElementSubsequenceAtStart() - { - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_slice($from, 0, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($to, $common); - } - } - - public function testSingleElementSubsequenceAtMiddle() - { - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_slice($from, (int) $size / 2, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($to, $common); - } - } - - public function testSingleElementSubsequenceAtEnd() - { - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_slice($from, $size - 1, 1); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals($to, $common); - } - } - - public function testReversedSequences() - { - $from = array('A', 'B'); - $to = array('B', 'A'); - $expected = array('A'); - $common = $this->implementation->calculate($from, $to); - $this->assertEquals($expected, $common); - - foreach ($this->stress_sizes as $size) { - $from = range(1, $size); - $to = array_reverse($from); - $common = $this->implementation->calculate($from, $to); - - $this->assertEquals(array(1), $common); - } - } -} diff --git a/vendor/sebastian/diff/tests/ParserTest.php b/vendor/sebastian/diff/tests/ParserTest.php deleted file mode 100644 index 3a7b972..0000000 --- a/vendor/sebastian/diff/tests/ParserTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Diff; - -use PHPUnit_Framework_TestCase; - -class ParserTest extends PHPUnit_Framework_TestCase -{ - /** - * @var Parser - */ - private $parser; - - protected function setUp() - { - $this->parser = new Parser; - } - - public function testParse() - { - $content = file_get_contents(__DIR__ . '/fixtures/patch.txt'); - - $diffs = $this->parser->parse($content); - - $this->assertCount(1, $diffs); - - $chunks = $diffs[0]->getChunks(); - $this->assertCount(1, $chunks); - - $this->assertEquals(20, $chunks[0]->getStart()); - - $this->assertCount(5, $chunks[0]->getLines()); - } - - public function testParseWithMultipleChunks() - { - $content = file_get_contents(__DIR__ . '/fixtures/patch2.txt'); - - $diffs = $this->parser->parse($content); - - $this->assertCount(1, $diffs); - - $chunks = $diffs[0]->getChunks(); - $this->assertCount(3, $chunks); - - $this->assertEquals(20, $chunks[0]->getStart()); - $this->assertEquals(320, $chunks[1]->getStart()); - $this->assertEquals(600, $chunks[2]->getStart()); - - $this->assertCount(5, $chunks[0]->getLines()); - $this->assertCount(5, $chunks[1]->getLines()); - $this->assertCount(5, $chunks[2]->getLines()); - } -} diff --git a/vendor/sebastian/diff/tests/fixtures/patch.txt b/vendor/sebastian/diff/tests/fixtures/patch.txt deleted file mode 100644 index 144b61d..0000000 --- a/vendor/sebastian/diff/tests/fixtures/patch.txt +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/Foo.php b/Foo.php -index abcdefg..abcdefh 100644 ---- a/Foo.php -+++ b/Foo.php -@@ -20,4 +20,5 @@ class Foo - const ONE = 1; - const TWO = 2; -+ const THREE = 3; - const FOUR = 4; diff --git a/vendor/sebastian/diff/tests/fixtures/patch2.txt b/vendor/sebastian/diff/tests/fixtures/patch2.txt deleted file mode 100644 index 41fbc95..0000000 --- a/vendor/sebastian/diff/tests/fixtures/patch2.txt +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/Foo.php b/Foo.php -index abcdefg..abcdefh 100644 ---- a/Foo.php -+++ b/Foo.php -@@ -20,4 +20,5 @@ class Foo - const ONE = 1; - const TWO = 2; -+ const THREE = 3; - const FOUR = 4; - -@@ -320,4 +320,5 @@ class Foo - const A = 'A'; - const B = 'B'; -+ const C = 'C'; - const D = 'D'; - -@@ -600,4 +600,5 @@ class Foo - public function doSomething() { - -+ return 'foo'; - } diff --git a/vendor/sebastian/environment/tests/ConsoleTest.php b/vendor/sebastian/environment/tests/ConsoleTest.php deleted file mode 100644 index 6b40172..0000000 --- a/vendor/sebastian/environment/tests/ConsoleTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Environment; - -use PHPUnit_Framework_TestCase; - -class ConsoleTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \SebastianBergmann\Environment\Console - */ - private $console; - - protected function setUp() - { - $this->console = new Console; - } - - /** - * @covers \SebastianBergmann\Environment\Console::isInteractive - */ - public function testCanDetectIfStdoutIsInteractiveByDefault() - { - $this->assertInternalType('boolean', $this->console->isInteractive()); - } - - /** - * @covers \SebastianBergmann\Environment\Console::isInteractive - */ - public function testCanDetectIfFileDescriptorIsInteractive() - { - $this->assertInternalType('boolean', $this->console->isInteractive(STDOUT)); - } - - /** - * @covers \SebastianBergmann\Environment\Console::hasColorSupport - * @uses \SebastianBergmann\Environment\Console::isInteractive - */ - public function testCanDetectColorSupport() - { - $this->assertInternalType('boolean', $this->console->hasColorSupport()); - } - - /** - * @covers \SebastianBergmann\Environment\Console::getNumberOfColumns - * @uses \SebastianBergmann\Environment\Console::isInteractive - */ - public function testCanDetectNumberOfColumns() - { - $this->assertInternalType('integer', $this->console->getNumberOfColumns()); - } -} diff --git a/vendor/sebastian/environment/tests/RuntimeTest.php b/vendor/sebastian/environment/tests/RuntimeTest.php deleted file mode 100644 index 8ea8373..0000000 --- a/vendor/sebastian/environment/tests/RuntimeTest.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Environment; - -use PHPUnit_Framework_TestCase; - -class RuntimeTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \SebastianBergmann\Environment\Runtime - */ - private $env; - - protected function setUp() - { - $this->env = new Runtime; - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::canCollectCodeCoverage - * @uses \SebastianBergmann\Environment\Runtime::hasXdebug - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - * @uses \SebastianBergmann\Environment\Runtime::isPHP - */ - public function testAbilityToCollectCodeCoverageCanBeAssessed() - { - $this->assertInternalType('boolean', $this->env->canCollectCodeCoverage()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::getBinary - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - */ - public function testBinaryCanBeRetrieved() - { - $this->assertInternalType('string', $this->env->getBinary()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::isHHVM - */ - public function testCanBeDetected() - { - $this->assertInternalType('boolean', $this->env->isHHVM()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::isPHP - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - */ - public function testCanBeDetected2() - { - $this->assertInternalType('boolean', $this->env->isPHP()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::hasXdebug - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - * @uses \SebastianBergmann\Environment\Runtime::isPHP - */ - public function testXdebugCanBeDetected() - { - $this->assertInternalType('boolean', $this->env->hasXdebug()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::getNameWithVersion - * @uses \SebastianBergmann\Environment\Runtime::getName - * @uses \SebastianBergmann\Environment\Runtime::getVersion - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - * @uses \SebastianBergmann\Environment\Runtime::isPHP - */ - public function testNameAndVersionCanBeRetrieved() - { - $this->assertInternalType('string', $this->env->getNameWithVersion()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::getName - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - */ - public function testNameCanBeRetrieved() - { - $this->assertInternalType('string', $this->env->getName()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::getVersion - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - */ - public function testVersionCanBeRetrieved() - { - $this->assertInternalType('string', $this->env->getVersion()); - } - - /** - * @covers \SebastianBergmann\Environment\Runtime::getVendorUrl - * @uses \SebastianBergmann\Environment\Runtime::isHHVM - */ - public function testVendorUrlCanBeRetrieved() - { - $this->assertInternalType('string', $this->env->getVendorUrl()); - } -} diff --git a/vendor/sebastian/exporter/tests/ExporterTest.php b/vendor/sebastian/exporter/tests/ExporterTest.php deleted file mode 100644 index 6b590bf..0000000 --- a/vendor/sebastian/exporter/tests/ExporterTest.php +++ /dev/null @@ -1,333 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\Exporter; - -/** - * @covers SebastianBergmann\Exporter\Exporter - */ -class ExporterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var Exporter - */ - private $exporter; - - protected function setUp() - { - $this->exporter = new Exporter; - } - - public function exportProvider() - { - $obj2 = new \stdClass; - $obj2->foo = 'bar'; - - $obj3 = (object)array(1,2,"Test\r\n",4,5,6,7,8); - - $obj = new \stdClass; - //@codingStandardsIgnoreStart - $obj->null = null; - //@codingStandardsIgnoreEnd - $obj->boolean = true; - $obj->integer = 1; - $obj->double = 1.2; - $obj->string = '1'; - $obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"; - $obj->object = $obj2; - $obj->objectagain = $obj2; - $obj->array = array('foo' => 'bar'); - $obj->self = $obj; - - $storage = new \SplObjectStorage; - $storage->attach($obj2); - $storage->foo = $obj2; - - return array( - array(null, 'null'), - array(true, 'true'), - array(false, 'false'), - array(1, '1'), - array(1.0, '1.0'), - array(1.2, '1.2'), - array(fopen('php://memory', 'r'), 'resource(%d) of type (stream)'), - array('1', "'1'"), - array(array(array(1,2,3), array(3,4,5)), - << Array &1 ( - 0 => 1 - 1 => 2 - 2 => 3 - ) - 1 => Array &2 ( - 0 => 3 - 1 => 4 - 2 => 5 - ) -) -EOF - ), - // \n\r and \r is converted to \n - array("this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext", - << null - 'boolean' => true - 'integer' => 1 - 'double' => 1.2 - 'string' => '1' - 'text' => 'this -is -a -very -very -very -very -very -very -long -text' - 'object' => stdClass Object &%x ( - 'foo' => 'bar' - ) - 'objectagain' => stdClass Object &%x - 'array' => Array &%d ( - 'foo' => 'bar' - ) - 'self' => stdClass Object &%x -) -EOF - ), - array(array(), 'Array &%d ()'), - array($storage, - << stdClass Object &%x ( - 'foo' => 'bar' - ) - '%x' => Array &0 ( - 'obj' => stdClass Object &%x - 'inf' => null - ) -) -EOF - ), - array($obj3, - << 1 - 1 => 2 - 2 => 'Test\n' - 3 => 4 - 4 => 5 - 5 => 6 - 6 => 7 - 7 => 8 -) -EOF - ), - array( - chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5), - 'Binary String: 0x000102030405' - ), - array( - implode('', array_map('chr', range(0x0e, 0x1f))), - 'Binary String: 0x0e0f101112131415161718191a1b1c1d1e1f' - ), - array( - chr(0x00) . chr(0x09), - 'Binary String: 0x0009' - ), - array( - '', - "''" - ), - ); - } - - /** - * @dataProvider exportProvider - */ - public function testExport($value, $expected) - { - $this->assertStringMatchesFormat( - $expected, - $this->trimNewline($this->exporter->export($value)) - ); - } - - public function testExport2() - { - if (PHP_VERSION === '5.3.3') { - $this->markTestSkipped('Skipped due to "Nesting level too deep - recursive dependency?" fatal error'); - } - - $obj = new \stdClass; - $obj->foo = 'bar'; - - $array = array( - 0 => 0, - 'null' => null, - 'boolean' => true, - 'integer' => 1, - 'double' => 1.2, - 'string' => '1', - 'text' => "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext", - 'object' => $obj, - 'objectagain' => $obj, - 'array' => array('foo' => 'bar'), - ); - - $array['self'] = &$array; - - $expected = << 0 - 'null' => null - 'boolean' => true - 'integer' => 1 - 'double' => 1.2 - 'string' => '1' - 'text' => 'this -is -a -very -very -very -very -very -very -long -text' - 'object' => stdClass Object &%x ( - 'foo' => 'bar' - ) - 'objectagain' => stdClass Object &%x - 'array' => Array &%d ( - 'foo' => 'bar' - ) - 'self' => Array &%d ( - 0 => 0 - 'null' => null - 'boolean' => true - 'integer' => 1 - 'double' => 1.2 - 'string' => '1' - 'text' => 'this -is -a -very -very -very -very -very -very -long -text' - 'object' => stdClass Object &%x - 'objectagain' => stdClass Object &%x - 'array' => Array &%d ( - 'foo' => 'bar' - ) - 'self' => Array &%d - ) -) -EOF; - - $this->assertStringMatchesFormat( - $expected, - $this->trimNewline($this->exporter->export($array)) - ); - } - - public function shortenedExportProvider() - { - $obj = new \stdClass; - $obj->foo = 'bar'; - - $array = array( - 'foo' => 'bar', - ); - - return array( - array(null, 'null'), - array(true, 'true'), - array(1, '1'), - array(1.0, '1.0'), - array(1.2, '1.2'), - array('1', "'1'"), - // \n\r and \r is converted to \n - array("this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext", "'this\\nis\\na\\nvery\\nvery\\nvery\\nvery...g\\ntext'"), - array(new \stdClass, 'stdClass Object ()'), - array($obj, 'stdClass Object (...)'), - array(array(), 'Array ()'), - array($array, 'Array (...)'), - ); - } - - /** - * @dataProvider shortenedExportProvider - */ - public function testShortenedExport($value, $expected) - { - $this->assertSame( - $expected, - $this->trimNewline($this->exporter->shortenedExport($value)) - ); - } - - public function provideNonBinaryMultibyteStrings() - { - return array( - array(implode('', array_map('chr', range(0x09, 0x0d))), 5), - array(implode('', array_map('chr', range(0x20, 0x7f))), 96), - array(implode('', array_map('chr', range(0x80, 0xff))), 128), - ); - } - - - /** - * @dataProvider provideNonBinaryMultibyteStrings - */ - public function testNonBinaryStringExport($value, $expectedLength) - { - $this->assertRegExp( - "~'.{{$expectedLength}}'\$~s", - $this->exporter->export($value) - ); - } - - public function testNonObjectCanBeReturnedAsArray() - { - $this->assertEquals(array(true), $this->exporter->toArray(true)); - } - - private function trimNewline($string) - { - return preg_replace('/[ ]*\n/', "\n", $string); - } -} diff --git a/vendor/sebastian/global-state/tests/BlacklistTest.php b/vendor/sebastian/global-state/tests/BlacklistTest.php deleted file mode 100644 index d5a2a75..0000000 --- a/vendor/sebastian/global-state/tests/BlacklistTest.php +++ /dev/null @@ -1,149 +0,0 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ - -namespace SebastianBergmann\GlobalState; - -use PHPUnit_Framework_TestCase; - -/** - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ -class BlacklistTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \SebastianBergmann\GlobalState\Blacklist - */ - private $blacklist; - - protected function setUp() - { - $this->blacklist = new Blacklist; - } - - public function testGlobalVariableThatIsNotBlacklistedIsNotTreatedAsBlacklisted() - { - $this->assertFalse($this->blacklist->isGlobalVariableBlacklisted('variable')); - } - - public function testGlobalVariableCanBeBlacklisted() - { - $this->blacklist->addGlobalVariable('variable'); - - $this->assertTrue($this->blacklist->isGlobalVariableBlacklisted('variable')); - } - - public function testStaticAttributeThatIsNotBlacklistedIsNotTreatedAsBlacklisted() - { - $this->assertFalse( - $this->blacklist->isStaticAttributeBlacklisted( - 'SebastianBergmann\GlobalState\TestFixture\BlacklistedClass', - 'attribute' - ) - ); - } - - public function testClassCanBeBlacklisted() - { - $this->blacklist->addClass('SebastianBergmann\GlobalState\TestFixture\BlacklistedClass'); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - 'SebastianBergmann\GlobalState\TestFixture\BlacklistedClass', - 'attribute' - ) - ); - } - - public function testSubclassesCanBeBlacklisted() - { - $this->blacklist->addSubclassesOf('SebastianBergmann\GlobalState\TestFixture\BlacklistedClass'); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - 'SebastianBergmann\GlobalState\TestFixture\BlacklistedChildClass', - 'attribute' - ) - ); - } - - public function testImplementorsCanBeBlacklisted() - { - $this->blacklist->addImplementorsOf('SebastianBergmann\GlobalState\TestFixture\BlacklistedInterface'); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - 'SebastianBergmann\GlobalState\TestFixture\BlacklistedImplementor', - 'attribute' - ) - ); - } - - public function testClassNamePrefixesCanBeBlacklisted() - { - $this->blacklist->addClassNamePrefix('SebastianBergmann\GlobalState'); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - 'SebastianBergmann\GlobalState\TestFixture\BlacklistedClass', - 'attribute' - ) - ); - } - - public function testStaticAttributeCanBeBlacklisted() - { - $this->blacklist->addStaticAttribute( - 'SebastianBergmann\GlobalState\TestFixture\BlacklistedClass', - 'attribute' - ); - - $this->assertTrue( - $this->blacklist->isStaticAttributeBlacklisted( - 'SebastianBergmann\GlobalState\TestFixture\BlacklistedClass', - 'attribute' - ) - ); - } -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedChildClass.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedChildClass.php deleted file mode 100644 index 99f7fdb..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedChildClass.php +++ /dev/null @@ -1,53 +0,0 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ - -namespace SebastianBergmann\GlobalState\TestFixture; - -/** - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ -class BlacklistedChildClass extends BlacklistedClass -{ -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedClass.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedClass.php deleted file mode 100644 index f1582c7..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedClass.php +++ /dev/null @@ -1,54 +0,0 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ - -namespace SebastianBergmann\GlobalState\TestFixture; - -/** - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ -class BlacklistedClass -{ - private static $attribute; -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedImplementor.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedImplementor.php deleted file mode 100644 index c80d987..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedImplementor.php +++ /dev/null @@ -1,54 +0,0 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ - -namespace SebastianBergmann\GlobalState\TestFixture; - -/** - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ -class BlacklistedImplementor implements BlacklistedInterface -{ - private static $attribute; -} diff --git a/vendor/sebastian/global-state/tests/_fixture/BlacklistedInterface.php b/vendor/sebastian/global-state/tests/_fixture/BlacklistedInterface.php deleted file mode 100644 index f3941fd..0000000 --- a/vendor/sebastian/global-state/tests/_fixture/BlacklistedInterface.php +++ /dev/null @@ -1,53 +0,0 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ - -namespace SebastianBergmann\GlobalState\TestFixture; - -/** - * @author Sebastian Bergmann - * @copyright 2001-2014 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://www.github.com/sebastianbergmann/global-state - */ -interface BlacklistedInterface -{ -} diff --git a/vendor/sebastian/recursion-context/tests/ContextTest.php b/vendor/sebastian/recursion-context/tests/ContextTest.php deleted file mode 100644 index 8e8cc56..0000000 --- a/vendor/sebastian/recursion-context/tests/ContextTest.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SebastianBergmann\RecursionContext; - -use PHPUnit_Framework_TestCase; - -/** - * @covers SebastianBergmann\RecursionContext\Context - */ -class ContextTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \SebastianBergmann\RecursionContext\Context - */ - private $context; - - protected function setUp() - { - $this->context = new Context(); - } - - public function failsProvider() - { - return array( - array(true), - array(false), - array(null), - array('string'), - array(1), - array(1.5), - array(fopen('php://memory', 'r')) - ); - } - - public function valuesProvider() - { - $obj2 = new \stdClass(); - $obj2->foo = 'bar'; - - $obj3 = (object) array(1,2,"Test\r\n",4,5,6,7,8); - - $obj = new \stdClass(); - //@codingStandardsIgnoreStart - $obj->null = null; - //@codingStandardsIgnoreEnd - $obj->boolean = true; - $obj->integer = 1; - $obj->double = 1.2; - $obj->string = '1'; - $obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"; - $obj->object = $obj2; - $obj->objectagain = $obj2; - $obj->array = array('foo' => 'bar'); - $obj->array2 = array(1,2,3,4,5,6); - $obj->array3 = array($obj, $obj2, $obj3); - $obj->self = $obj; - - $storage = new \SplObjectStorage(); - $storage->attach($obj2); - $storage->foo = $obj2; - - return array( - array($obj, spl_object_hash($obj)), - array($obj2, spl_object_hash($obj2)), - array($obj3, spl_object_hash($obj3)), - array($storage, spl_object_hash($storage)), - array($obj->array, 0), - array($obj->array2, 0), - array($obj->array3, 0) - ); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::add - * @uses SebastianBergmann\RecursionContext\InvalidArgumentException - * @dataProvider failsProvider - */ - public function testAddFails($value) - { - $this->setExpectedException( - 'SebastianBergmann\\RecursionContext\\Exception', - 'Only arrays and objects are supported' - ); - $this->context->add($value); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::contains - * @uses SebastianBergmann\RecursionContext\InvalidArgumentException - * @dataProvider failsProvider - */ - public function testContainsFails($value) - { - $this->setExpectedException( - 'SebastianBergmann\\RecursionContext\\Exception', - 'Only arrays and objects are supported' - ); - $this->context->contains($value); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::add - * @dataProvider valuesProvider - */ - public function testAdd($value, $key) - { - $this->assertEquals($key, $this->context->add($value)); - - // Test we get the same key on subsequent adds - $this->assertEquals($key, $this->context->add($value)); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::contains - * @uses SebastianBergmann\RecursionContext\Context::add - * @depends testAdd - * @dataProvider valuesProvider - */ - public function testContainsFound($value, $key) - { - $this->context->add($value); - $this->assertEquals($key, $this->context->contains($value)); - - // Test we get the same key on subsequent calls - $this->assertEquals($key, $this->context->contains($value)); - } - - /** - * @covers SebastianBergmann\RecursionContext\Context::contains - * @dataProvider valuesProvider - */ - public function testContainsNotFound($value) - { - $this->assertFalse($this->context->contains($value)); - } -} diff --git a/vendor/stack/builder/tests/functional/SilexApplicationTest.php b/vendor/stack/builder/tests/functional/SilexApplicationTest.php deleted file mode 100644 index 5636336..0000000 --- a/vendor/stack/builder/tests/functional/SilexApplicationTest.php +++ /dev/null @@ -1,60 +0,0 @@ -get('/foo', function () { - return 'bar'; - }); - - $finished = false; - - $app->finish(function () use (&$finished) { - $finished = true; - }); - - $stack = new Builder(); - $stack - ->push('functional\Append', '.A') - ->push('functional\Append', '.B'); - - $app = $stack->resolve($app); - - $request = Request::create('/foo'); - $response = $app->handle($request); - $app->terminate($request, $response); - - $this->assertSame('bar.B.A', $response->getContent()); - $this->assertTrue($finished); - } -} - -class Append implements HttpKernelInterface -{ - private $app; - private $appendix; - - public function __construct(HttpKernelInterface $app, $appendix) - { - $this->app = $app; - $this->appendix = $appendix; - } - - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - $response = clone $this->app->handle($request, $type, $catch); - $response->setContent($response->getContent().$this->appendix); - - return $response; - } -} diff --git a/vendor/stack/builder/tests/unit/Stack/BuilderTest.php b/vendor/stack/builder/tests/unit/Stack/BuilderTest.php deleted file mode 100644 index 4092d01..0000000 --- a/vendor/stack/builder/tests/unit/Stack/BuilderTest.php +++ /dev/null @@ -1,215 +0,0 @@ -getHttpKernelMock(new Response('ok')); - - $stack = new Builder(); - $resolved = $stack->resolve($app); - - $request = Request::create('/'); - $response = $resolved->handle($request); - - $this->assertInstanceOf('Stack\StackedHttpKernel', $resolved); - $this->assertSame('ok', $response->getContent()); - } - - /** @test */ - public function resolvedKernelShouldDelegateTerminateCalls() - { - $app = $this->getTerminableMock(); - - $stack = new Builder(); - $resolved = $stack->resolve($app); - - $request = Request::create('/'); - $response = new Response('ok'); - - $resolved->handle($request); - $resolved->terminate($request, $response); - } - - /** @test */ - public function pushShouldReturnSelf() - { - $stack = new Builder(); - $this->assertSame($stack, $stack->push('Stack\AppendA')); - } - - /** @test */ - public function pushShouldThrowOnInvalidInput() - { - $this->setExpectedException('InvalidArgumentException', 'Missing argument(s) when calling push'); - $stack = new Builder(); - $stack->push(); - } - - /** @test */ - public function unshiftShouldReturnSelf() - { - $stack = new Builder(); - $this->assertSame($stack, $stack->unshift('Stack\AppendA')); - } - - /** @test */ - public function unshiftShouldThrowOnInvalidInput() - { - $this->setExpectedException('InvalidArgumentException', 'Missing argument(s) when calling unshift'); - $stack = new Builder(); - $stack->unshift(); - } - - /** @test */ - public function appendMiddlewareShouldAppendToBody() - { - $app = $this->getHttpKernelMock(new Response('ok')); - - $stack = new Builder(); - $stack->push('Stack\AppendA'); - $resolved = $stack->resolve($app); - - $request = Request::create('/'); - $response = $resolved->handle($request); - - $this->assertSame('ok.A', $response->getContent()); - } - - /** @test */ - public function unshiftMiddlewareShouldPutMiddlewareBeforePushed() - { - $app = $this->getHttpKernelMock(new Response('ok')); - - $stack = new Builder(); - $stack->push('Stack\Append', '2.'); - $stack->unshift('Stack\Append', '1.'); - $resolved = $stack->resolve($app); - - $request = Request::create('/'); - $response = $resolved->handle($request); - - $this->assertSame('ok2.1.', $response->getContent()); - } - - /** @test */ - public function stackedMiddlewaresShouldWrapInReverseOrder() - { - $app = $this->getHttpKernelMock(new Response('ok')); - - $stack = new Builder(); - $stack->push('Stack\AppendA'); - $stack->push('Stack\AppendB'); - $resolved = $stack->resolve($app); - - $request = Request::create('/'); - $response = $resolved->handle($request); - - $this->assertSame('ok.B.A', $response->getContent()); - } - - /** @test */ - public function resolveShouldPassPushArgumentsToMiddlewareConstructor() - { - $app = $this->getHttpKernelMock(new Response('ok')); - - $stack = new Builder(); - $stack->push('Stack\Append', '.foo'); - $stack->push('Stack\Append', '.bar'); - $resolved = $stack->resolve($app); - - $request = Request::create('/'); - $response = $resolved->handle($request); - - $this->assertSame('ok.bar.foo', $response->getContent()); - } - - /** @test */ - public function resolveShouldCallSpecFactories() - { - $app = $this->getHttpKernelMock(new Response('ok')); - - $stack = new Builder(); - $stack->push(function ($app) { return new Append($app, '.foo'); }); - $stack->push(function ($app) { return new Append($app, '.bar'); }); - $resolved = $stack->resolve($app); - - $request = Request::create('/'); - $response = $resolved->handle($request); - - $this->assertSame('ok.bar.foo', $response->getContent()); - } - - private function getHttpKernelMock(Response $response) - { - $app = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); - $app->expects($this->any()) - ->method('handle') - ->with($this->isInstanceOf('Symfony\Component\HttpFoundation\Request')) - ->will($this->returnValue($response)); - - return $app; - } - - private function getTerminableMock() - { - $app = $this->getMock('Stack\TerminableHttpKernel'); - $app->expects($this->once()) - ->method('terminate') - ->with( - $this->isInstanceOf('Symfony\Component\HttpFoundation\Request'), - $this->isInstanceOf('Symfony\Component\HttpFoundation\Response') - ); - - return $app; - } -} - -abstract class TerminableHttpKernel implements HttpKernelInterface, TerminableInterface -{ -} - -class Append implements HttpKernelInterface -{ - private $app; - private $appendix; - - public function __construct(HttpKernelInterface $app, $appendix) - { - $this->app = $app; - $this->appendix = $appendix; - } - - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - $response = clone $this->app->handle($request, $type, $catch); - $response->setContent($response->getContent().$this->appendix); - - return $response; - } -} - -class AppendA extends Append -{ - public function __construct(HttpKernelInterface $app) - { - parent::__construct($app, '.A'); - } -} - -class AppendB extends Append -{ - public function __construct(HttpKernelInterface $app) - { - parent::__construct($app, '.B'); - } -} diff --git a/vendor/stack/builder/tests/unit/Stack/StackedHttpKernelTest.php b/vendor/stack/builder/tests/unit/Stack/StackedHttpKernelTest.php deleted file mode 100644 index 545e1f8..0000000 --- a/vendor/stack/builder/tests/unit/Stack/StackedHttpKernelTest.php +++ /dev/null @@ -1,155 +0,0 @@ -getHttpKernelMock(new Response('ok')); - $kernel = new StackedHttpKernel($app, array($app)); - - $request = Request::create('/'); - $response = $kernel->handle($request); - - $this->assertSame('ok', $response->getContent()); - } - - /** @test */ - public function handleShouldStillDelegateToAppWithMiddlewares() - { - $app = $this->getHttpKernelMock(new Response('ok')); - $bar = $this->getHttpKernelMock(new Response('bar')); - $foo = $this->getHttpKernelMock(new Response('foo')); - $kernel = new StackedHttpKernel($app, array($foo, $bar, $app)); - - $request = Request::create('/'); - $response = $kernel->handle($request); - - $this->assertSame('ok', $response->getContent()); - } - - /** @test */ - public function terminateShouldDelegateToMiddlewares() - { - $first = new TerminableKernelSpy(); - $second = new TerminableKernelSpy($first); - $third = new KernelSpy($second); - $fourth = new TerminableKernelSpy($third); - $fifth = new TerminableKernelSpy($fourth); - - $kernel = new StackedHttpKernel($fifth, $middlewares = array($fifth, $fourth, $third, $second, $first)); - - $request = Request::create('/'); - $response = $kernel->handle($request); - $kernel->terminate($request, $response); - - $this->assertTerminablesCalledOnce($middlewares); - } - - private function assertTerminablesCalledOnce(array $middlewares) - { - foreach ($middlewares as $kernel) { - if ($kernel instanceof TerminableInterface) { - $this->assertEquals(1, $kernel->terminateCallCount(), "Terminate was called {$kernel->terminateCallCount()} times"); - } - } - } - - private function getHttpKernelMock(Response $response) - { - $app = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); - $app->expects($this->any()) - ->method('handle') - ->with($this->isInstanceOf('Symfony\Component\HttpFoundation\Request')) - ->will($this->returnValue($response)); - - return $app; - } - - private function getTerminableMock(Response $response = null) - { - $app = $this->getMock('Stack\TerminableHttpKernel'); - if ($response) { - $app->expects($this->any()) - ->method('handle') - ->with($this->isInstanceOf('Symfony\Component\HttpFoundation\Request')) - ->will($this->returnValue($response)); - } - $app->expects($this->once()) - ->method('terminate') - ->with( - $this->isInstanceOf('Symfony\Component\HttpFoundation\Request'), - $this->isInstanceOf('Symfony\Component\HttpFoundation\Response') - ); - - return $app; - } - - private function getDelegatingTerminableMock(TerminableInterface $next) - { - $app = $this->getMock('Stack\TerminableHttpKernel'); - $app->expects($this->once()) - ->method('terminate') - ->with( - $this->isInstanceOf('Symfony\Component\HttpFoundation\Request'), - $this->isInstanceOf('Symfony\Component\HttpFoundation\Response') - ) - ->will($this->returnCallback(function ($request, $response) use ($next) { - $next->terminate($request, $response); - })); - - return $app; - } -} - -class KernelSpy implements HttpKernelInterface -{ - private $handleCallCount = 0; - - public function __construct(HttpKernelInterface $kernel = null) - { - $this->kernel = $kernel; - } - - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - $this->handleCallCount++; - - if ($this->kernel) { - return $this->kernel->handle($request, $type, $catch); - } - - return new Response('OK'); - } - - public function handleCallCount() - { - return $this->handleCallCount; - } -} - -class TerminableKernelSpy extends KernelSpy implements TerminableInterface -{ - private $terminateCallCount = 0; - - public function terminate(Request $request, Response $response) - { - $this->terminateCallCount++; - - if ($this->kernel && $this->kernel instanceof TerminableInterface) { - return $this->kernel->terminate($request, $response); - } - } - - public function terminateCallCount() - { - return $this->terminateCallCount; - } -} diff --git a/vendor/symfony-cmf/routing/Test/CmfUnitTestCase.php b/vendor/symfony-cmf/routing/Test/CmfUnitTestCase.php deleted file mode 100644 index f0e9ea1..0000000 --- a/vendor/symfony-cmf/routing/Test/CmfUnitTestCase.php +++ /dev/null @@ -1,23 +0,0 @@ -getMockBuilder($class) - ->disableOriginalConstructor() - ->setMethods($methods) - ->getMock(); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Candidates/CandidatesTest.php b/vendor/symfony-cmf/routing/Tests/Candidates/CandidatesTest.php deleted file mode 100644 index 322c052..0000000 --- a/vendor/symfony-cmf/routing/Tests/Candidates/CandidatesTest.php +++ /dev/null @@ -1,105 +0,0 @@ -assertTrue($candidates->isCandidate('/routes')); - $this->assertTrue($candidates->isCandidate('/routes/my/path')); - } - - /** - * Nothing should be called on the query builder - */ - public function testRestrictQuery() - { - $candidates = new Candidates(); - $candidates->restrictQuery(null); - } - - public function testGetCandidates() - { - $request = Request::create('/my/path.html'); - - $candidates = new Candidates(); - $paths = $candidates->getCandidates($request); - - $this->assertEquals( - array( - '/my/path.html', - '/my/path', - '/my', - '/', - ), - $paths - ); - } - - public function testGetCandidatesLocales() - { - $candidates = new Candidates(array('de', 'fr')); - - $request = Request::create('/fr/path.html'); - $paths = $candidates->getCandidates($request); - - $this->assertEquals( - array( - '/fr/path.html', - '/fr/path', - '/fr', - '/', - '/path.html', - '/path' - ), - $paths - ); - - $request = Request::create('/it/path.html'); - $paths = $candidates->getCandidates($request); - - $this->assertEquals( - array( - '/it/path.html', - '/it/path', - '/it', - '/', - ), - $paths - ); - } - - public function testGetCandidatesLimit() - { - $candidates = new Candidates(array(), 1); - - $request = Request::create('/my/path/is/deep.html'); - - $paths = $candidates->getCandidates($request); - - $this->assertEquals( - array( - '/my/path/is/deep.html', - '/my/path/is/deep', - ), - $paths - ); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRouteEnhancersPassTest.php b/vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRouteEnhancersPassTest.php deleted file mode 100644 index 0213885..0000000 --- a/vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRouteEnhancersPassTest.php +++ /dev/null @@ -1,71 +0,0 @@ - array( - 0 => array( - 'id' => 'foo_enhancer' - ) - ), - ); - - $definition = new Definition('router'); - $builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $builder->expects($this->at(0)) - ->method('hasDefinition') - ->with('cmf_routing.dynamic_router') - ->will($this->returnValue(true)) - ; - $builder->expects($this->once()) - ->method('findTaggedServiceIds') - ->will($this->returnValue($serviceIds)) - ; - $builder->expects($this->once()) - ->method('getDefinition') - ->with('cmf_routing.dynamic_router') - ->will($this->returnValue($definition)) - ; - - $pass = new RegisterRouteEnhancersPass(); - $pass->process($builder); - - $calls = $definition->getMethodCalls(); - $this->assertEquals(1, count($calls)); - $this->assertEquals('addRouteEnhancer', $calls[0][0]); - } - - /** - * If there is no dynamic router defined in the container builder, nothing - * should be processed. - */ - public function testNoDynamicRouter() - { - $builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $builder->expects($this->once()) - ->method('hasDefinition') - ->with('cmf_routing.dynamic_router') - ->will($this->returnValue(false)) - ; - - $pass = new RegisterRouteEnhancersPass(); - $pass->process($builder); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRoutersPassTest.php b/vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRoutersPassTest.php deleted file mode 100644 index f66c2d8..0000000 --- a/vendor/symfony-cmf/routing/Tests/DependencyInjection/Compiler/RegisterRoutersPassTest.php +++ /dev/null @@ -1,98 +0,0 @@ -markTestSkipped('PHPUnit version too old for this test'); - } - $services = array(); - $services[$name] = array(0 => array('priority' => $priority)); - - $priority = $priority ?: 0; - - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $definition->expects($this->atLeastOnce()) - ->method('addMethodCall') - ->with($this->equalTo('add'), $this->callback(function ($arg) use ($name, $priority) { - if (!$arg[0] instanceof Reference || $name !== $arg[0]->__toString()) { - return false; - } - - if ($priority !== $arg[1]) { - return false; - } - - return true; - })); - - $builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')); - $builder->expects($this->any()) - ->method('hasDefinition') - ->with('cmf_routing.router') - ->will($this->returnValue(true)); - - $builder->expects($this->atLeastOnce()) - ->method('findTaggedServiceIds') - ->will($this->returnValue($services)); - - $builder->expects($this->atLeastOnce()) - ->method('getDefinition') - ->will($this->returnValue($definition)); - - $registerRoutersPass = new RegisterRoutersPass(); - $registerRoutersPass->process($builder); - } - - public function getValidRoutersData() - { - return array( - array('my_router'), - array('my_primary_router', 99), - array('my_router', 0), - ); - } - - /** - * If there is no chain router defined in the container builder, nothing - * should be processed. - */ - public function testNoChainRouter() - { - $builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')); - $builder->expects($this->once()) - ->method('hasDefinition') - ->with('cmf_routing.router') - ->will($this->returnValue(false)) - ; - - $builder->expects($this->never()) - ->method('findTaggedServiceIds') - ; - $builder->expects($this->never()) - ->method('getDefinition') - ; - - $registerRoutersPass = new RegisterRoutersPass(); - $registerRoutersPass->process($builder); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Enhancer/FieldByClassEnhancerTest.php b/vendor/symfony-cmf/routing/Tests/Enhancer/FieldByClassEnhancerTest.php deleted file mode 100644 index 9dc80b0..0000000 --- a/vendor/symfony-cmf/routing/Tests/Enhancer/FieldByClassEnhancerTest.php +++ /dev/null @@ -1,71 +0,0 @@ -document = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Enhancer\RouteObject'); - - $mapping = array('Symfony\Cmf\Component\Routing\Tests\Enhancer\RouteObject' - => 'cmf_content.controller:indexAction'); - - $this->mapper = new FieldByClassEnhancer('_content', '_controller', $mapping); - - $this->request = Request::create('/test'); - } - - public function testClassFoundInMapping() - { - // this is the mock, thus a child class to make sure we properly check with instanceof - $defaults = array('_content' => $this->document); - $expected = array( - '_content' => $this->document, - '_controller' => 'cmf_content.controller:indexAction', - ); - $this->assertEquals($expected, $this->mapper->enhance($defaults, $this->request)); - } - - public function testFieldAlreadyThere() - { - $defaults = array( - '_content' => $this->document, - '_controller' => 'custom.controller:indexAction', - ); - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } - - public function testClassNotFoundInMapping() - { - $defaults = array('_content' => $this); - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } - - public function testNoClass() - { - $defaults = array('foo' => 'bar'); - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Enhancer/FieldMapEnhancerTest.php b/vendor/symfony-cmf/routing/Tests/Enhancer/FieldMapEnhancerTest.php deleted file mode 100644 index c7a902d..0000000 --- a/vendor/symfony-cmf/routing/Tests/Enhancer/FieldMapEnhancerTest.php +++ /dev/null @@ -1,69 +0,0 @@ -request = Request::create('/test'); - $mapping = array('static_pages' => 'cmf_content.controller:indexAction'); - - $this->enhancer = new FieldMapEnhancer('type', '_controller', $mapping); - } - - public function testFieldFoundInMapping() - { - $defaults = array('type' => 'static_pages'); - $expected = array( - 'type' => 'static_pages', - '_controller' => 'cmf_content.controller:indexAction', - ); - $this->assertEquals($expected, $this->enhancer->enhance($defaults, $this->request)); - } - - public function testFieldAlreadyThere() - { - $defaults = array( - 'type' => 'static_pages', - '_controller' => 'custom.controller:indexAction', - ); - $this->assertEquals($defaults, $this->enhancer->enhance($defaults, $this->request)); - } - - public function testNoType() - { - $defaults = array(); - $this->assertEquals(array(), $this->enhancer->enhance($defaults, $this->request)); - } - - public function testNotFoundInMapping() - { - $defaults = array('type' => 'unknown_route'); - $this->assertEquals($defaults, $this->enhancer->enhance($defaults, $this->request)); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Enhancer/FieldPresenceEnhancerTest.php b/vendor/symfony-cmf/routing/Tests/Enhancer/FieldPresenceEnhancerTest.php deleted file mode 100644 index 8a2b754..0000000 --- a/vendor/symfony-cmf/routing/Tests/Enhancer/FieldPresenceEnhancerTest.php +++ /dev/null @@ -1,71 +0,0 @@ -mapper = new FieldPresenceEnhancer('_template', '_controller', 'cmf_content.controller:indexAction'); - - $this->request = Request::create('/test'); - } - - public function testHasTemplate() - { - $defaults = array('_template' => 'Bundle:Topic:template.html.twig'); - $expected = array( - '_template' => 'Bundle:Topic:template.html.twig', - '_controller' => 'cmf_content.controller:indexAction', - ); - $this->assertEquals($expected, $this->mapper->enhance($defaults, $this->request)); - } - - public function testFieldAlreadyThere() - { - $defaults = array( - '_template' => 'Bundle:Topic:template.html.twig', - '_controller' => 'custom.controller:indexAction', - ); - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } - - public function testHasNoSourceValue() - { - $defaults = array('foo' => 'bar'); - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } - - public function testHasNoSource() - { - $this->mapper = new FieldPresenceEnhancer(null, '_controller', 'cmf_content.controller:indexAction'); - - $defaults = array('foo' => 'bar'); - $expected = array( - 'foo' => 'bar', - '_controller' => 'cmf_content.controller:indexAction', - ); - $this->assertEquals($expected, $this->mapper->enhance($defaults, $this->request)); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Enhancer/RouteContentEnhancerTest.php b/vendor/symfony-cmf/routing/Tests/Enhancer/RouteContentEnhancerTest.php deleted file mode 100644 index 06b0911..0000000 --- a/vendor/symfony-cmf/routing/Tests/Enhancer/RouteContentEnhancerTest.php +++ /dev/null @@ -1,87 +0,0 @@ -document = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Enhancer\RouteObject', - array('getContent', 'getRouteDefaults', 'getUrl')); - - $this->mapper = new RouteContentEnhancer(RouteObjectInterface::ROUTE_OBJECT, '_content'); - - $this->request = Request::create('/test'); - } - - public function testContent() - { - $targetDocument = new TargetDocument(); - $this->document->expects($this->once()) - ->method('getContent') - ->will($this->returnValue($targetDocument)); - - $defaults = array(RouteObjectInterface::ROUTE_OBJECT => $this->document); - $expected = array(RouteObjectInterface::ROUTE_OBJECT => $this->document, '_content' => $targetDocument); - - $this->assertEquals($expected, $this->mapper->enhance($defaults, $this->request)); - } - - public function testFieldAlreadyThere() - { - $this->document->expects($this->never()) - ->method('getContent') - ; - - $defaults = array(RouteObjectInterface::ROUTE_OBJECT => $this->document, '_content' => 'foo'); - - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } - - public function testNoContent() - { - $this->document->expects($this->once()) - ->method('getContent') - ->will($this->returnValue(null)); - - $defaults = array(RouteObjectInterface::ROUTE_OBJECT => $this->document); - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } - - public function testNoCmfRoute() - { - $defaults = array(RouteObjectInterface::ROUTE_OBJECT => $this->buildMock('Symfony\Component\Routing\Route')); - $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request)); - } -} - -class TargetDocument -{ -} - -class UnknownDocument -{ -} diff --git a/vendor/symfony-cmf/routing/Tests/Enhancer/RouteObject.php b/vendor/symfony-cmf/routing/Tests/Enhancer/RouteObject.php deleted file mode 100644 index 752b8e0..0000000 --- a/vendor/symfony-cmf/routing/Tests/Enhancer/RouteObject.php +++ /dev/null @@ -1,27 +0,0 @@ -provider = $this->buildMock('Symfony\Cmf\Component\Routing\RouteProviderInterface'); - $this->routeFilter1 = $this->buildMock('Symfony\Cmf\Component\Routing\NestedMatcher\RouteFilterInterface'); - $this->routeFilter2 = $this->buildMock('Symfony\Cmf\Component\Routing\NestedMatcher\RouteFilterInterface'); - $this->finalMatcher = $this->buildMock('Symfony\Cmf\Component\Routing\NestedMatcher\FinalMatcherInterface'); - } - - public function testNestedMatcher() - { - $request = Request::create('/path/one'); - $routeCollection = new RouteCollection(); - $route = $this->getMockBuilder('Symfony\Component\Routing\Route')->disableOriginalConstructor()->getMock(); - $routeCollection->add('route', $route); - - $this->provider->expects($this->once()) - ->method('getRouteCollectionForRequest') - ->with($request) - ->will($this->returnValue($routeCollection)) - ; - $this->routeFilter1->expects($this->once()) - ->method('filter') - ->with($routeCollection, $request) - ->will($this->returnValue($routeCollection)) - ; - $this->routeFilter2->expects($this->once()) - ->method('filter') - ->with($routeCollection, $request) - ->will($this->returnValue($routeCollection)) - ; - $this->finalMatcher->expects($this->once()) - ->method('finalMatch') - ->with($routeCollection, $request) - ->will($this->returnValue(array('foo' => 'bar'))) - ; - - $matcher = new NestedMatcher($this->provider, $this->finalMatcher); - $matcher->addRouteFilter($this->routeFilter1); - $matcher->addRouteFilter($this->routeFilter2); - - $attributes = $matcher->matchRequest($request); - - $this->assertEquals(array('foo' => 'bar'), $attributes); - } - - /** - * Test priorities and exception handling - */ - public function testNestedMatcherPriority() - { - $request = Request::create('/path/one'); - $routeCollection = new RouteCollection(); - $route = $this->getMockBuilder('Symfony\Component\Routing\Route')->disableOriginalConstructor()->getMock(); - $routeCollection->add('route', $route); - - $wrongProvider = $this->buildMock('Symfony\Cmf\Component\Routing\RouteProviderInterface'); - $wrongProvider->expects($this->never()) - ->method('getRouteCollectionForRequest') - ; - $this->provider->expects($this->once()) - ->method('getRouteCollectionForRequest') - ->with($request) - ->will($this->returnValue($routeCollection)) - ; - $this->routeFilter1->expects($this->once()) - ->method('filter') - ->with($routeCollection, $request) - ->will($this->throwException(new ResourceNotFoundException())) - ; - $this->routeFilter2->expects($this->never()) - ->method('filter') - ; - $this->finalMatcher->expects($this->never()) - ->method('finalMatch') - ; - - $matcher = new NestedMatcher($wrongProvider, $this->finalMatcher); - $matcher->setRouteProvider($this->provider); - $matcher->addRouteFilter($this->routeFilter2, 10); - $matcher->addRouteFilter($this->routeFilter1, 20); - - try { - $matcher->matchRequest($request); - fail('nested matcher is eating exception'); - } catch (ResourceNotFoundException $e) { - // expected - } - } - - public function testProviderNoMatch() - { - $request = Request::create('/path/one'); - $routeCollection = new RouteCollection(); - $this->provider->expects($this->once()) - ->method('getRouteCollectionForRequest') - ->with($request) - ->will($this->returnValue($routeCollection)) - ; - $this->finalMatcher->expects($this->never()) - ->method('finalMatch') - ; - - $matcher = new NestedMatcher($this->provider, $this->finalMatcher); - - $this->setExpectedException('Symfony\Component\Routing\Exception\ResourceNotFoundException'); - $matcher->matchRequest($request); - } - -} diff --git a/vendor/symfony-cmf/routing/Tests/NestedMatcher/UrlMatcherTest.php b/vendor/symfony-cmf/routing/Tests/NestedMatcher/UrlMatcherTest.php deleted file mode 100644 index d5b5635..0000000 --- a/vendor/symfony-cmf/routing/Tests/NestedMatcher/UrlMatcherTest.php +++ /dev/null @@ -1,152 +0,0 @@ -routeDocument = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults', 'getRouteKey', 'compile')); - $this->routeCompiled = $this->buildMock('Symfony\Component\Routing\CompiledRoute'); - - $this->context = $this->buildMock('Symfony\Component\Routing\RequestContext'); - $this->request = Request::create($this->url); - - $this->matcher = new UrlMatcher(new RouteCollection(), $this->context); - } - - public function testMatchRouteKey() - { - $this->doTestMatchRouteKey($this->url); - } - - public function testMatchNoKey() - { - $this->doTestMatchRouteKey(null); - } - - public function doTestMatchRouteKey($routeKey) - { - $this->routeCompiled->expects($this->atLeastOnce()) - ->method('getStaticPrefix') - ->will($this->returnValue($this->url)) - ; - $this->routeCompiled->expects($this->atLeastOnce()) - ->method('getRegex') - ->will($this->returnValue('#'.str_replace('/', '\/', $this->url).'#')) - ; - $this->routeDocument->expects($this->atLeastOnce()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - $this->routeDocument->expects($this->atLeastOnce()) - ->method('getRouteKey') - ->will($this->returnValue($routeKey)) - ; - $this->routeDocument->expects($this->atLeastOnce()) - ->method('getDefaults') - ->will($this->returnValue(array('foo' => 'bar'))) - ; - - $mockCompiled = $this->buildMock('Symfony\Component\Routing\CompiledRoute'); - $mockCompiled->expects($this->any()) - ->method('getStaticPrefix') - ->will($this->returnValue('/no/match')) - ; - $mockRoute = $this->getMockBuilder('Symfony\Component\Routing\Route')->disableOriginalConstructor()->getMock(); - $mockRoute->expects($this->any()) - ->method('compile') - ->will($this->returnValue($mockCompiled)) - ; - $routeCollection = new RouteCollection(); - $routeCollection->add('some', $mockRoute); - $routeCollection->add('_company_more', $this->routeDocument); - $routeCollection->add('other', $mockRoute); - - $results = $this->matcher->finalMatch($routeCollection, $this->request); - - $expected = array( - RouteObjectInterface::ROUTE_NAME => ($routeKey) ? $routeKey : '_company_more', - RouteObjectInterface::ROUTE_OBJECT => $this->routeDocument, - 'foo' => 'bar', - ); - - $this->assertEquals($expected, $results); - } - - public function testMatchNoRouteObject() - { - $this->routeCompiled->expects($this->atLeastOnce()) - ->method('getStaticPrefix') - ->will($this->returnValue($this->url)) - ; - $this->routeCompiled->expects($this->atLeastOnce()) - ->method('getRegex') - ->will($this->returnValue('#'.str_replace('/', '\/', $this->url).'#')) - ; - $this->routeDocument = $this->getMockBuilder('Symfony\Component\Routing\Route')->disableOriginalConstructor()->getMock(); - $this->routeDocument->expects($this->atLeastOnce()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - $this->routeDocument->expects($this->never()) - ->method('getRouteKey') - ; - $this->routeDocument->expects($this->atLeastOnce()) - ->method('getDefaults') - ->will($this->returnValue(array('foo' => 'bar'))) - ; - - $mockCompiled = $this->buildMock('Symfony\Component\Routing\CompiledRoute'); - $mockCompiled->expects($this->any()) - ->method('getStaticPrefix') - ->will($this->returnValue('/no/match')) - ; - $mockRoute = $this->getMockBuilder('Symfony\Component\Routing\Route')->disableOriginalConstructor()->getMock(); - $mockRoute->expects($this->any()) - ->method('compile') - ->will($this->returnValue($mockCompiled)) - ; - $routeCollection = new RouteCollection(); - $routeCollection->add('some', $mockRoute); - $routeCollection->add('_company_more', $this->routeDocument); - $routeCollection->add('other', $mockRoute); - - $results = $this->matcher->finalMatch($routeCollection, $this->request); - - $expected = array( - RouteObjectInterface::ROUTE_NAME => '_company_more', - RouteObjectInterface::ROUTE_OBJECT => $this->routeDocument, - 'foo' => 'bar', - ); - - $this->assertEquals($expected, $results); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Routing/ChainRouterTest.php b/vendor/symfony-cmf/routing/Tests/Routing/ChainRouterTest.php deleted file mode 100644 index e8b8e3c..0000000 --- a/vendor/symfony-cmf/routing/Tests/Routing/ChainRouterTest.php +++ /dev/null @@ -1,730 +0,0 @@ -router = new ChainRouter($this->getMock('Psr\Log\LoggerInterface')); - $this->context = $this->getMock('Symfony\Component\Routing\RequestContext'); - } - - public function testPriority() - { - $this->assertEquals(array(), $this->router->all()); - - list($low, $high) = $this->createRouterMocks(); - - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->assertEquals(array( - $high, - $low, - ), $this->router->all()); - } - - /** - * Routers are supposed to be sorted only once. - * This test will check that by trying to get all routers several times. - * - * @covers \Symfony\Cmf\Component\Routing\ChainRouter::sortRouters - * @covers \Symfony\Cmf\Component\Routing\ChainRouter::all - */ - public function testSortRouters() - { - list($low, $medium, $high) = $this->createRouterMocks(); - // We're using a mock here and not $this->router because we need to ensure that the sorting operation is done only once. - /** @var $router ChainRouter|\PHPUnit_Framework_MockObject_MockObject */ - $router = $this->buildMock('Symfony\Cmf\Component\Routing\ChainRouter', array('sortRouters')); - $router - ->expects($this->once()) - ->method('sortRouters') - ->will( - $this->returnValue( - array($high, $medium, $low) - ) - ) - ; - - $router->add($low, 10); - $router->add($medium, 50); - $router->add($high, 100); - $expectedSortedRouters = array($high, $medium, $low); - // Let's get all routers 5 times, we should only sort once. - for ($i = 0; $i < 5; ++$i) { - $this->assertSame($expectedSortedRouters, $router->all()); - } - } - - /** - * This test ensures that if a router is being added on the fly, the sorting is reset. - * - * @covers \Symfony\Cmf\Component\Routing\ChainRouter::sortRouters - * @covers \Symfony\Cmf\Component\Routing\ChainRouter::all - * @covers \Symfony\Cmf\Component\Routing\ChainRouter::add - */ - public function testReSortRouters() - { - list($low, $medium, $high) = $this->createRouterMocks(); - $highest = clone $high; - // We're using a mock here and not $this->router because we need to ensure that the sorting operation is done only once. - /** @var $router ChainRouter|\PHPUnit_Framework_MockObject_MockObject */ - $router = $this->buildMock('Symfony\Cmf\Component\Routing\ChainRouter', array('sortRouters')); - $router - ->expects($this->at(0)) - ->method('sortRouters') - ->will( - $this->returnValue( - array($high, $medium, $low) - ) - ) - ; - // The second time sortRouters() is called, we're supposed to get the newly added router ($highest) - $router - ->expects($this->at(1)) - ->method('sortRouters') - ->will( - $this->returnValue( - array($highest, $high, $medium, $low) - ) - ) - ; - - $router->add($low, 10); - $router->add($medium, 50); - $router->add($high, 100); - $this->assertSame(array($high, $medium, $low), $router->all()); - - // Now adding another router on the fly, sorting must have been reset - $router->add($highest, 101); - $this->assertSame(array($highest, $high, $medium, $low), $router->all()); - } - - /** - * context must be propagated to chained routers and be stored locally - */ - public function testContext() - { - list($low, $high) = $this->createRouterMocks(); - - $low - ->expects($this->once()) - ->method('setContext') - ->with($this->context) - ; - - $high - ->expects($this->once()) - ->method('setContext') - ->with($this->context) - ; - - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->setContext($this->context); - $this->assertSame($this->context, $this->router->getContext()); - } - - /** - * context must be propagated also when routers are added after context is set - */ - public function testContextOrder() - { - list($low, $high) = $this->createRouterMocks(); - - $low - ->expects($this->once()) - ->method('setContext') - ->with($this->context) - ; - - $high - ->expects($this->once()) - ->method('setContext') - ->with($this->context) - ; - - $this->router->setContext($this->context); - - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->all(); - - $this->assertSame($this->context, $this->router->getContext()); - } - - /** - * The first usable match is used, no further routers are queried once a match is found - */ - public function testMatch() - { - $url = '/test'; - list($lower, $low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new \Symfony\Component\Routing\Exception\ResourceNotFoundException)) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->returnValue(array('test'))) - ; - $lower - ->expects($this->never()) - ->method('match'); - $this->router->add($lower, 5); - $this->router->add($low, 10); - $this->router->add($high, 100); - - $result = $this->router->match('/test'); - $this->assertEquals(array('test'), $result); - } - - /** - * The first usable match is used, no further routers are queried once a match is found - */ - public function testMatchRequest() - { - $url = '/test'; - list($lower, $low, $high) = $this->createRouterMocks(); - - $highest = $this->getMock('Symfony\Cmf\Component\Routing\Tests\Routing\RequestMatcher'); - - $request = Request::create('/test'); - - $highest - ->expects($this->once()) - ->method('matchRequest') - ->will($this->throwException(new \Symfony\Component\Routing\Exception\ResourceNotFoundException)) - ; - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new \Symfony\Component\Routing\Exception\ResourceNotFoundException)) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->returnValue(array('test'))) - ; - $lower - ->expects($this->never()) - ->method('match') - ; - - $this->router->add($lower, 5); - $this->router->add($low, 10); - $this->router->add($high, 100); - $this->router->add($highest, 200); - - $result = $this->router->matchRequest($request); - $this->assertEquals(array('test'), $result); - } - - /** - * Call match on ChainRouter that has RequestMatcher in the chain. - */ - public function testMatchWithRequestMatchers() - { - $url = '/test'; - - list($low) = $this->createRouterMocks(); - - $high = $this->getMock('Symfony\Cmf\Component\Routing\Tests\Routing\RequestMatcher'); - - $high - ->expects($this->once()) - ->method('matchRequest') - ->with($this->callback(function (Request $r) use ($url) { - return $r->getPathInfo() === $url; - })) - ->will($this->throwException(new \Symfony\Component\Routing\Exception\ResourceNotFoundException)) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->returnValue(array('test'))) - ; - - $this->router->add($low, 10); - $this->router->add($high, 20); - - $result = $this->router->match($url); - $this->assertEquals(array('test'), $result); - } - - /** - * If there is a method not allowed but another router matches, that one is used - */ - public function testMatchAndNotAllowed() - { - $url = '/test'; - list($low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new \Symfony\Component\Routing\Exception\MethodNotAllowedException(array()))) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->returnValue(array('test'))) - ; - $this->router->add($low, 10); - $this->router->add($high, 100); - - $result = $this->router->match('/test'); - $this->assertEquals(array('test'), $result); - } - - /** - * If there is a method not allowed but another router matches, that one is used - */ - public function testMatchRequestAndNotAllowed() - { - $url = '/test'; - list($low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new \Symfony\Component\Routing\Exception\MethodNotAllowedException(array()))) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->returnValue(array('test'))) - ; - $this->router->add($low, 10); - $this->router->add($high, 100); - - $result = $this->router->matchRequest(Request::create('/test')); - $this->assertEquals(array('test'), $result); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException - */ - public function testMatchNotFound() - { - $url = '/test'; - list($low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new ResourceNotFoundException())) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new ResourceNotFoundException())) - ; - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->match('/test'); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException - */ - public function testMatchRequestNotFound() - { - $url = '/test'; - list($low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new ResourceNotFoundException())) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new ResourceNotFoundException())) - ; - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->matchRequest(Request::create('/test')); - } - - /** - * Call match on ChainRouter that has RequestMatcher in the chain. - * - * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException - * @expectedExceptionMessage None of the routers in the chain matched url '/test' - */ - public function testMatchWithRequestMatchersNotFound() - { - $url = '/test'; - $request = Request::create('/test'); - - $high = $this->getMock('Symfony\Cmf\Component\Routing\Tests\Routing\RequestMatcher'); - - $high - ->expects($this->once()) - ->method('matchRequest') - ->with($request) - ->will($this->throwException(new \Symfony\Component\Routing\Exception\ResourceNotFoundException)) - ; - - $this->router->add($high, 20); - - $this->router->match($url); - } - - /** - * If any of the routers throws a not allowed exception and no other matches, we need to see this - * - * @expectedException \Symfony\Component\Routing\Exception\MethodNotAllowedException - */ - public function testMatchMethodNotAllowed() - { - $url = '/test'; - list($low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new MethodNotAllowedException(array()))) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new ResourceNotFoundException())) - ; - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->match('/test'); - } - - /** - * If any of the routers throws a not allowed exception and no other matches, we need to see this - * - * @expectedException \Symfony\Component\Routing\Exception\MethodNotAllowedException - */ - public function testMatchRequestMethodNotAllowed() - { - $url = '/test'; - list($low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new MethodNotAllowedException(array()))) - ; - $low - ->expects($this->once()) - ->method('match') - ->with($url) - ->will($this->throwException(new ResourceNotFoundException())) - ; - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->matchRequest(Request::create('/test')); - } - - public function testGenerate() - { - $url = '/test'; - $name = 'test'; - $parameters = array('test' => 'value'); - list($lower, $low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('generate') - ->with($name, $parameters, false) - ->will($this->throwException(new RouteNotFoundException())) - ; - $low - ->expects($this->once()) - ->method('generate') - ->with($name, $parameters, false) - ->will($this->returnValue($url)) - ; - $lower - ->expects($this->never()) - ->method('generate') - ; - - $this->router->add($low, 10); - $this->router->add($high, 100); - - $result = $this->router->generate($name, $parameters); - $this->assertEquals($url, $result); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateNotFound() - { - $name = 'test'; - $parameters = array('test' => 'value'); - list($low, $high) = $this->createRouterMocks(); - - $high - ->expects($this->once()) - ->method('generate') - ->with($name, $parameters, false) - ->will($this->throwException(new RouteNotFoundException())) - ; - $low->expects($this->once()) - ->method('generate') - ->with($name, $parameters, false) - ->will($this->throwException(new RouteNotFoundException())) - ; - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->generate($name, $parameters); - } - - /** - * Route is an object but no versatile generator around to do the debug message. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateObjectNotFound() - { - $name = new \stdClass(); - $parameters = array('test' => 'value'); - - $defaultRouter = $this->getMock('Symfony\Component\Routing\RouterInterface'); - - $defaultRouter - ->expects($this->never()) - ->method('generate') - ; - - $this->router->add($defaultRouter, 200); - - $this->router->generate($name, $parameters); - } - - /** - * A versatile router will generate the debug message. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateObjectNotFoundVersatile() - { - $name = new \stdClass(); - $parameters = array('test' => 'value'); - - $chainedRouter = $this->getMock('Symfony\Cmf\Component\Routing\Tests\Routing\VersatileRouter'); - $chainedRouter - ->expects($this->once()) - ->method('supports') - ->will($this->returnValue(true)) - ; - $chainedRouter->expects($this->once()) - ->method('generate') - ->with($name, $parameters, false) - ->will($this->throwException(new RouteNotFoundException())) - ; - $chainedRouter->expects($this->once()) - ->method('getRouteDebugMessage') - ->with($name, $parameters) - ->will($this->returnValue('message')) - ; - - $this->router->add($chainedRouter, 10); - - $this->router->generate($name, $parameters); - } - - public function testGenerateObjectName() - { - $name = new \stdClass(); - $parameters = array('test' => 'value'); - - $defaultRouter = $this->getMock('Symfony\Component\Routing\RouterInterface'); - $chainedRouter = $this->getMock('Symfony\Cmf\Component\Routing\Tests\Routing\VersatileRouter'); - - $defaultRouter - ->expects($this->never()) - ->method('generate') - ; - $chainedRouter - ->expects($this->once()) - ->method('supports') - ->will($this->returnValue(true)) - ; - $chainedRouter - ->expects($this->once()) - ->method('generate') - ->with($name, $parameters, false) - ->will($this->returnValue($name)) - ; - - $this->router->add($defaultRouter, 200); - $this->router->add($chainedRouter, 100); - - $result = $this->router->generate($name, $parameters); - $this->assertEquals($name, $result); - } - - public function testWarmup() - { - $dir = 'test_dir'; - list($low) = $this->createRouterMocks(); - - $low - ->expects($this->never()) - ->method('warmUp') - ; - $high = $this->getMock('Symfony\Cmf\Component\Routing\Tests\Routing\WarmableRouterMock'); - $high - ->expects($this->once()) - ->method('warmUp') - ->with($dir) - ; - - $this->router->add($low, 10); - $this->router->add($high, 100); - - $this->router->warmUp($dir); - } - - public function testRouteCollection() - { - list($low, $high) = $this->createRouterMocks(); - $lowcol = new RouteCollection(); - $lowcol->add('low', $this->buildMock('Symfony\Component\Routing\Route')); - $highcol = new RouteCollection(); - $highcol->add('high', $this->buildMock('Symfony\Component\Routing\Route')); - - $low - ->expects($this->once()) - ->method('getRouteCollection') - ->will($this->returnValue($lowcol)) - ; - $high - ->expects($this->once()) - ->method('getRouteCollection') - ->will($this->returnValue($highcol)) - ; - - $this->router->add($low, 10); - $this->router->add($high, 100); - - $collection = $this->router->getRouteCollection(); - $this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $collection); - - $names = array(); - foreach ($collection->all() as $name => $route) { - $this->assertInstanceOf('Symfony\Component\Routing\Route', $route); - $names[] = $name; - } - $this->assertEquals(array('high', 'low'), $names); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testSupport() - { - - $router = $this->getMock('Symfony\Cmf\Component\Routing\Tests\Routing\VersatileRouter'); - $router - ->expects($this->once()) - ->method('supports') - ->will($this->returnValue(false)) - ; - - $router - ->expects($this->never()) - ->method('generate') - ->will($this->returnValue(false)) - ; - - $this->router->add($router); - - $this->router->generate('foobar'); - } - - /** - * @return RouterInterface[]|\PHPUnit_Framework_MockObject_MockObject[] - */ - protected function createRouterMocks() - { - return array( - $this->getMock('Symfony\Component\Routing\RouterInterface'), - $this->getMock('Symfony\Component\Routing\RouterInterface'), - $this->getMock('Symfony\Component\Routing\RouterInterface'), - ); - } -} - -abstract class WarmableRouterMock implements RouterInterface, WarmableInterface -{ -} - -abstract class RequestMatcher implements RouterInterface, RequestMatcherInterface -{ -} - -abstract class VersatileRouter implements VersatileGeneratorInterface, RequestMatcherInterface -{ -} diff --git a/vendor/symfony-cmf/routing/Tests/Routing/ContentAwareGeneratorTest.php b/vendor/symfony-cmf/routing/Tests/Routing/ContentAwareGeneratorTest.php deleted file mode 100644 index 3d08974..0000000 --- a/vendor/symfony-cmf/routing/Tests/Routing/ContentAwareGeneratorTest.php +++ /dev/null @@ -1,457 +0,0 @@ -contentDocument = $this->buildMock('Symfony\Cmf\Component\Routing\RouteReferrersReadInterface'); - $this->routeDocument = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults', 'compile')); - $this->routeCompiled = $this->buildMock('Symfony\Component\Routing\CompiledRoute'); - $this->provider = $this->buildMock('Symfony\Cmf\Component\Routing\RouteProviderInterface'); - $this->context = $this->buildMock('Symfony\Component\Routing\RequestContext'); - - $this->generator = new TestableContentAwareGenerator($this->provider); - } - - public function testGenerateFromContent() - { - $this->provider->expects($this->never()) - ->method('getRouteByName') - ; - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($this->routeDocument))) - ; - $this->routeDocument->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($this->contentDocument)); - } - - public function testGenerateFromContentId() - { - $this->provider->expects($this->never()) - ->method('getRouteByName') - ; - - $contentRepository = $this->buildMock('Symfony\Cmf\Component\Routing\ContentRepositoryInterface', array('findById', 'getContentId')); - $contentRepository->expects($this->once()) - ->method('findById') - ->with('/content/id') - ->will($this->returnValue($this->contentDocument)) - ; - $this->generator->setContentRepository($contentRepository); - - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($this->routeDocument))) - ; - - $this->routeDocument->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate('', array('content_id' => '/content/id'))); - } - - public function testGenerateEmptyRouteString() - { - $this->provider->expects($this->never()) - ->method('getRouteByName') - ; - - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($this->routeDocument))) - ; - - $this->routeDocument->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($this->contentDocument)); - } - - public function testGenerateRouteMultilang() - { - $route_en = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults', 'compile', 'getContent')); - $route_en->setLocale('en'); - $route_de = $this->routeDocument; - $route_de->setLocale('de'); - - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($route_en, $route_de))) - ; - $route_en->expects($this->once()) - ->method('getContent') - ->will($this->returnValue($this->contentDocument)) - ; - $route_en->expects($this->never()) - ->method('compile') - ; - $route_de->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($route_en, array('_locale' => 'de'))); - } - - public function testGenerateRouteMultilangDefaultLocale() - { - $route = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock'); - $route->expects($this->any()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - $route->expects($this->any()) - ->method('getRequirement') - ->with('_locale') - ->will($this->returnValue('de|en')) - ; - $route->expects($this->any()) - ->method('getDefault') - ->with('_locale') - ->will($this->returnValue('en')) - ; - $this->routeCompiled->expects($this->any()) - ->method('getVariables') - ->will($this->returnValue(array())) - ; - - $this->assertEquals('result_url', $this->generator->generate($route, array('_locale' => 'en'))); - } - - public function testGenerateRouteMultilangLocaleNomatch() - { - $route_en = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults', 'compile', 'getContent')); - $route_en->setLocale('en'); - $route_de = $this->routeDocument; - $route_de->setLocale('de'); - - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($route_en, $route_de))) - ; - $route_en->expects($this->once()) - ->method('getContent') - ->will($this->returnValue($this->contentDocument)) - ; - $route_en->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - $route_de->expects($this->never()) - ->method('compile') - ; - - $this->assertEquals('result_url', $this->generator->generate($route_en, array('_locale' => 'fr'))); - } - - public function testGenerateNoncmfRouteMultilang() - { - $route_en = $this->buildMock('Symfony\Component\Routing\Route', array('getDefaults', 'compile', 'getContent')); - - $route_en->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($route_en, array('_locale' => 'de'))); - } - - public function testGenerateRoutenameMultilang() - { - $name = 'foo/bar'; - $route_en = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults', 'compile', 'getContent')); - $route_en->setLocale('en'); - $route_de = $this->routeDocument; - $route_de->setLocale('de'); - - $this->provider->expects($this->once()) - ->method('getRouteByName') - ->with($name) - ->will($this->returnValue($route_en)) - ; - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($route_en, $route_de))) - ; - $route_en->expects($this->once()) - ->method('getContent') - ->will($this->returnValue($this->contentDocument)) - ; - $route_en->expects($this->never()) - ->method('compile') - ; - $route_de->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($name, array('_locale' => 'de'))); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateRoutenameMultilangNotFound() - { - $name = 'foo/bar'; - - $this->provider->expects($this->once()) - ->method('getRouteByName') - ->with($name) - ->will($this->returnValue(null)) - ; - - $this->generator->generate($name, array('_locale' => 'de')); - } - - public function testGenerateDocumentMultilang() - { - $route_en = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults', 'compile')); - $route_en->setLocale('en'); - $route_de = $this->routeDocument; - $route_de->setLocale('de'); - - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($route_en, $route_de))) - ; - $route_en->expects($this->never()) - ->method('compile') - ; - $route_de->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($this->contentDocument, array('_locale' => 'de'))); - } - - public function testGenerateDocumentMultilangLocaleNomatch() - { - $route_en = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults', 'compile')); - $route_en->setLocale('en'); - $route_de = $this->routeDocument; - $route_de->setLocale('de'); - - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($route_en, $route_de))) - ; - $route_en->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - $route_de->expects($this->never()) - ->method('compile') - ; - - $this->assertEquals('result_url', $this->generator->generate($this->contentDocument, array('_locale' => 'fr'))); - } - - /** - * Generate without any information. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateNoContent() - { - $this->generator->generate('', array()); - } - - /** - * Generate with an object that is neither a route nor route aware. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateInvalidContent() - { - $this->generator->generate($this); - } - - /** - * Generate with a content_id but there is no content repository. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateNoContentRepository() - { - $this->provider->expects($this->never()) - ->method('getRouteByName') - ; - - $this->generator->generate('', array('content_id' => '/content/id')); - } - - /** - * Generate with content_id but the content is not found. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateNoContentFoundInRepository() - { - $this->provider->expects($this->never()) - ->method('getRouteByName') - ; - - $contentRepository = $this->buildMock('Symfony\Cmf\Component\Routing\ContentRepositoryInterface', array('findById', 'getContentId')); - $contentRepository->expects($this->once()) - ->method('findById') - ->with('/content/id') - ->will($this->returnValue(null)) - ; - $this->generator->setContentRepository($contentRepository); - - $this->generator->generate('', array('content_id' => '/content/id')); - } - - /** - * Generate with content_id but the object at id is not route aware. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateWrongContentClassInRepository() - { - $this->provider->expects($this->never()) - ->method('getRouteByName') - ; - - $contentRepository = $this->buildMock('Symfony\Cmf\Component\Routing\ContentRepositoryInterface', array('findById', 'getContentId')); - $contentRepository->expects($this->once()) - ->method('findById') - ->with('/content/id') - ->will($this->returnValue($this)) - ; - $this->generator->setContentRepository($contentRepository); - - $this->generator->generate('', array('content_id' => '/content/id')); - } - - /** - * Generate from a content that has no routes associated. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateNoRoutes() - { - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array())); - - $this->generator->generate($this->contentDocument); - } - /** - * Generate from a content that returns something that is not a route as route. - * - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateInvalidRoute() - { - $this->contentDocument->expects($this->once()) - ->method('getRoutes') - ->will($this->returnValue(array($this))); - - $this->generator->generate($this->contentDocument); - } - - public function testGetLocaleAttribute() - { - $this->generator->setDefaultLocale('en'); - - $attributes = array('_locale' => 'fr'); - $this->assertEquals('fr', $this->generator->getLocale($attributes)); - } - - public function testGetLocaleDefault() - { - $this->generator->setDefaultLocale('en'); - - $attributes = array(); - $this->assertEquals('en', $this->generator->getLocale($attributes)); - } - - public function testGetLocaleContext() - { - $this->generator->setDefaultLocale('en'); - - $this->generator->getContext()->setParameter('_locale', 'de'); - - $attributes = array(); - $this->assertEquals('de', $this->generator->getLocale($attributes)); - } - - public function testSupports() - { - $this->assertTrue($this->generator->supports('')); - $this->assertTrue($this->generator->supports(null)); - $this->assertTrue($this->generator->supports($this->contentDocument)); - $this->assertFalse($this->generator->supports($this)); - } - - public function testGetRouteDebugMessage() - { - $this->assertContains('/some/content', $this->generator->getRouteDebugMessage(null, array('content_id' => '/some/content'))); - $this->assertContains('Route aware content Symfony\Cmf\Component\Routing\Tests\Routing\RouteAware', $this->generator->getRouteDebugMessage(new RouteAware())); - $this->assertContains('/some/content', $this->generator->getRouteDebugMessage('/some/content')); - } -} - -/** - * Overwrite doGenerate to reduce amount of mocking needed - */ -class TestableContentAwareGenerator extends ContentAwareGenerator -{ - protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array()) - { - return 'result_url'; - } - - // expose as public - public function getLocale($parameters) - { - return parent::getLocale($parameters); - } -} - -class RouteAware implements RouteReferrersReadInterface -{ - public function getRoutes() - { - return array(); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Routing/DynamicRouterTest.php b/vendor/symfony-cmf/routing/Tests/Routing/DynamicRouterTest.php deleted file mode 100644 index f3e24e9..0000000 --- a/vendor/symfony-cmf/routing/Tests/Routing/DynamicRouterTest.php +++ /dev/null @@ -1,330 +0,0 @@ -routeDocument = $this->buildMock('Symfony\Cmf\Component\Routing\Tests\Routing\RouteMock', array('getDefaults')); - - $this->matcher = $this->buildMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); - $this->generator = $this->buildMock('Symfony\Cmf\Component\Routing\VersatileGeneratorInterface', array('supports', 'generate', 'setContext', 'getContext', 'getRouteDebugMessage')); - $this->enhancer = $this->buildMock('Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface', array('enhance')); - - $this->context = $this->buildMock('Symfony\Component\Routing\RequestContext'); - $this->request = Request::create($this->url); - - $this->router = new DynamicRouter($this->context, $this->matcher, $this->generator); - $this->router->addRouteEnhancer($this->enhancer); - } - - /** - * rather trivial, but we want 100% coverage - */ - public function testContext() - { - $this->router->setContext($this->context); - $this->assertSame($this->context, $this->router->getContext()); - } - - public function testRouteCollectionEmpty() - { - $collection = $this->router->getRouteCollection(); - $this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $collection); - } - - public function testRouteCollectionLazy() - { - $provider = $this->getMock('Symfony\Cmf\Component\Routing\RouteProviderInterface'); - $router = new DynamicRouter($this->context, $this->matcher, $this->generator, '', null, $provider); - - $collection = $router->getRouteCollection(); - $this->assertInstanceOf('Symfony\Cmf\Component\Routing\LazyRouteCollection', $collection); - } - - /// generator tests /// - - public function testGetGenerator() - { - $this->generator->expects($this->once()) - ->method('setContext') - ->with($this->equalTo($this->context)); - - $generator = $this->router->getGenerator(); - $this->assertInstanceOf('Symfony\Component\Routing\Generator\UrlGeneratorInterface', $generator); - $this->assertSame($this->generator, $generator); - } - - public function testGenerate() - { - $name = 'my_route_name'; - $parameters = array('foo' => 'bar'); - $absolute = true; - - $this->generator->expects($this->once()) - ->method('generate') - ->with($name, $parameters, $absolute) - ->will($this->returnValue('http://test')) - ; - - $url = $this->router->generate($name, $parameters, $absolute); - $this->assertEquals('http://test', $url); - } - - public function testSupports() - { - $name = 'foo/bar'; - $this->generator->expects($this->once()) - ->method('supports') - ->with($this->equalTo($name)) - ->will($this->returnValue(true)) - ; - - $this->assertTrue($this->router->supports($name)); - } - - public function testSupportsNonversatile() - { - $generator = $this->buildMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface', array('generate', 'setContext', 'getContext')); - $router = new DynamicRouter($this->context, $this->matcher, $generator); - $this->assertInternalType('string', $router->getRouteDebugMessage('test')); - - $this->assertTrue($router->supports('some string')); - $this->assertFalse($router->supports($this)); - } - - /// match tests /// - - public function testGetMatcher() - { - $this->matcher->expects($this->once()) - ->method('setContext') - ->with($this->equalTo($this->context)); - - $matcher = $this->router->getMatcher(); - $this->assertInstanceOf('Symfony\Component\Routing\Matcher\UrlMatcherInterface', $matcher); - $this->assertSame($this->matcher, $matcher); - } - - public function testMatchUrl() - { - $routeDefaults = array('foo' => 'bar'); - $this->matcher->expects($this->once()) - ->method('match') - ->with($this->url) - ->will($this->returnValue($routeDefaults)) - ; - - $expected = array('this' => 'that'); - $this->enhancer->expects($this->once()) - ->method('enhance') - ->with($this->equalTo($routeDefaults), $this->equalTo($this->request)) - ->will($this->returnValue($expected)) - ; - - $results = $this->router->match($this->url); - - $this->assertEquals($expected, $results); - } - - public function testMatchRequestWithUrlMatcher() - { - $routeDefaults = array('foo' => 'bar'); - - $this->matcher->expects($this->once()) - ->method('match') - ->with($this->url) - ->will($this->returnValue($routeDefaults)) - ; - - $expected = array('this' => 'that'); - $this->enhancer->expects($this->once()) - ->method('enhance') - // somehow request object gets confused, check on instance only - ->with($this->equalTo($routeDefaults), $this->isInstanceOf('Symfony\Component\HttpFoundation\Request')) - ->will($this->returnValue($expected)) - ; - - $results = $this->router->matchRequest($this->request); - - $this->assertEquals($expected, $results); - } - - public function testMatchRequest() - { - $routeDefaults = array('foo' => 'bar'); - - $matcher = $this->buildMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface', array('matchRequest', 'setContext', 'getContext')); - $router = new DynamicRouter($this->context, $matcher, $this->generator); - - $matcher->expects($this->once()) - ->method('matchRequest') - ->with($this->request) - ->will($this->returnValue($routeDefaults)) - ; - - $expected = array('this' => 'that'); - $this->enhancer->expects($this->once()) - ->method('enhance') - ->with($this->equalTo($routeDefaults), $this->equalTo($this->request)) - ->will($this->returnValue($expected)) - ; - - $router->addRouteEnhancer($this->enhancer); - - $this->assertEquals($expected, $router->matchRequest($this->request)); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException - */ - public function testMatchFilter() - { - $router = new DynamicRouter($this->context, $this->matcher, $this->generator, '#/different/prefix.*#'); - $router->addRouteEnhancer($this->enhancer); - - $this->matcher->expects($this->never()) - ->method('match') - ; - - $this->enhancer->expects($this->never()) - ->method('enhance') - ; - - $router->match($this->url); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException - */ - public function testMatchRequestFilter() - { - $matcher = $this->buildMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface', array('matchRequest', 'setContext', 'getContext')); - - $router = new DynamicRouter($this->context, $matcher, $this->generator, '#/different/prefix.*#'); - $router->addRouteEnhancer($this->enhancer); - - $matcher->expects($this->never()) - ->method('matchRequest') - ; - - $this->enhancer->expects($this->never()) - ->method('enhance') - ; - - $router->matchRequest($this->request); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testMatchUrlWithRequestMatcher() - { - $matcher = $this->buildMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface', array('matchRequest', 'setContext', 'getContext')); - $router = new DynamicRouter($this->context, $matcher, $this->generator); - - $router->match($this->url); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testInvalidMatcher() - { - new DynamicRouter($this->context, $this, $this->generator); - } - - public function testRouteDebugMessage() - { - $this->generator->expects($this->once()) - ->method('getRouteDebugMessage') - ->with($this->equalTo('test'), $this->equalTo(array())) - ->will($this->returnValue('debug message')) - ; - - $this->assertEquals('debug message', $this->router->getRouteDebugMessage('test')); - } - - public function testRouteDebugMessageNonversatile() - { - $generator = $this->buildMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface', array('generate', 'setContext', 'getContext')); - $router = new DynamicRouter($this->context, $this->matcher, $generator); - $this->assertInternalType('string', $router->getRouteDebugMessage('test')); - } - - public function testEventHandler() - { - $eventDispatcher = $this->buildMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); - $router = new DynamicRouter($this->context, $this->matcher, $this->generator, '', $eventDispatcher); - - $eventDispatcher->expects($this->once()) - ->method('dispatch') - ->with(Events::PRE_DYNAMIC_MATCH, $this->equalTo(new RouterMatchEvent())) - ; - - $routeDefaults = array('foo' => 'bar'); - $this->matcher->expects($this->once()) - ->method('match') - ->with($this->url) - ->will($this->returnValue($routeDefaults)) - ; - - $this->assertEquals($routeDefaults, $router->match($this->url)); - } - - public function testEventHandlerRequest() - { - $eventDispatcher = $this->buildMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); - $router = new DynamicRouter($this->context, $this->matcher, $this->generator, '', $eventDispatcher); - - $that = $this; - $eventDispatcher->expects($this->once()) - ->method('dispatch') - ->with(Events::PRE_DYNAMIC_MATCH_REQUEST, $this->callback(function ($event) use ($that) { - $that->assertInstanceOf('Symfony\Cmf\Component\Routing\Event\RouterMatchEvent', $event); - $that->assertEquals($that->request, $event->getRequest()); - - return true; - })) - ; - - $routeDefaults = array('foo' => 'bar'); - $this->matcher->expects($this->once()) - ->method('match') - ->with($this->url) - ->will($this->returnValue($routeDefaults)) - ; - - $this->assertEquals($routeDefaults, $router->matchRequest($this->request)); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Routing/LazyRouteCollectionTest.php b/vendor/symfony-cmf/routing/Tests/Routing/LazyRouteCollectionTest.php deleted file mode 100644 index 95d3ad2..0000000 --- a/vendor/symfony-cmf/routing/Tests/Routing/LazyRouteCollectionTest.php +++ /dev/null @@ -1,42 +0,0 @@ -getMock('Symfony\Cmf\Component\Routing\RouteProviderInterface'); - $testRoutes = array( - 'route_1' => new Route('/route-1'), - 'route_2"' => new Route('/route-2'), - ); - $routeProvider->expects($this->exactly(2)) - ->method('getRoutesByNames') - ->with(null) - ->will($this->returnValue($testRoutes)); - $lazyRouteCollection = new LazyRouteCollection($routeProvider); - $this->assertEquals($testRoutes, iterator_to_array($lazyRouteCollection->getIterator())); - $this->assertEquals($testRoutes, $lazyRouteCollection->all()); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Routing/PagedRouteCollectionTest.php b/vendor/symfony-cmf/routing/Tests/Routing/PagedRouteCollectionTest.php deleted file mode 100644 index 741beaa..0000000 --- a/vendor/symfony-cmf/routing/Tests/Routing/PagedRouteCollectionTest.php +++ /dev/null @@ -1,132 +0,0 @@ -routeProvider = $this->getMock('Symfony\Cmf\Component\Routing\PagedRouteProviderInterface'); - } - - /** - * Tests iterating a small amount of routes. - * - * @dataProvider providerIterator - */ - public function testIterator($amountRoutes, $routesLoadedInParallel, $expectedCalls = array()) - { - $routes = array(); - for ($i = 0; $i < $amountRoutes; $i++) { - $routes['test_' . $i] = new Route("/example-$i"); - } - $names = array_keys($routes); - - foreach ($expectedCalls as $i => $range) - { - $this->routeProvider->expects($this->at($i)) - ->method('getRoutesPaged') - ->with($range[0], $range[1]) - ->will($this->returnValue(array_slice($routes, $range[0], $range[1]))); - } - - $route_collection = new PagedRouteCollection($this->routeProvider, $routesLoadedInParallel); - - $counter = 0; - foreach ($route_collection as $route_name => $route) { - // Ensure the route did not changed. - $this->assertEquals($routes[$route_name], $route); - // Ensure that the order did not changed. - $this->assertEquals($route_name, $names[$counter]); - $counter++; - } - } - - /** - * Provides test data for testIterator(). - */ - public function providerIterator() - { - $data = array(); - // Non total routes. - $data[] = array(0, 20, array(array(0, 20))); - // Less total routes than loaded in parallel. - $data[] = array(10, 20, array(array(0, 20))); - // Exact the same amount of routes then loaded in parallel. - $data[] = array(20, 20, array(array(0, 20), array(20, 20))); - // Less than twice the amount. - $data[] = array(39, 20, array(array(0, 20), array(20, 20))); - // More total routes than loaded in parallel. - $data[] = array(40, 20, array(array(0, 20), array(20, 20), array(40, 20))); - $data[] = array(41, 20, array(array(0, 20), array(20, 20), array(40, 20))); - // why not. - $data[] = array(42, 23, array(array(0, 23), array(23, 23))); - return $data; - } - - /** - * Tests the count() method. - */ - public function testCount() - { - $this->routeProvider->expects($this->once()) - ->method('getRoutesCount') - ->will($this->returnValue(12)); - $routeCollection = new PagedRouteCollection($this->routeProvider); - $this->assertEquals(12, $routeCollection->count()); - } - - /** - * Tests the rewind method once the iterator is at the end. - */ - public function testIteratingAndRewind() - { - $routes = array(); - for ($i = 0; $i < 30; $i++) { - $routes['test_' . $i] = new Route("/example-$i"); - } - $this->routeProvider->expects($this->any()) - ->method('getRoutesPaged') - ->will($this->returnValueMap(array( - array(0, 10, array_slice($routes, 0, 10)), - array(10, 10, array_slice($routes, 9, 10)), - array(20, 10, array()), - ))); - - $routeCollection = new PagedRouteCollection($this->routeProvider, 10); - - // Force the iterating process. - $routeCollection->rewind(); - for ($i = 0; $i < 29; $i++) { - $routeCollection->next(); - } - $routeCollection->rewind(); - - $this->assertEquals('test_0', $routeCollection->key()); - $this->assertEquals($routes['test_0'], $routeCollection->current()); - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Routing/ProviderBasedGeneratorTest.php b/vendor/symfony-cmf/routing/Tests/Routing/ProviderBasedGeneratorTest.php deleted file mode 100644 index 955f9fc..0000000 --- a/vendor/symfony-cmf/routing/Tests/Routing/ProviderBasedGeneratorTest.php +++ /dev/null @@ -1,149 +0,0 @@ -routeDocument = $this->buildMock('Symfony\Component\Routing\Route', array('getDefaults', 'compile')); - $this->routeCompiled = $this->buildMock('Symfony\Component\Routing\CompiledRoute'); - $this->provider = $this->buildMock('Symfony\Cmf\Component\Routing\RouteProviderInterface'); - $this->context = $this->buildMock('Symfony\Component\Routing\RequestContext'); - - $this->generator= new TestableProviderBasedGenerator($this->provider); - } - - public function testGenerateFromName() - { - $name = 'foo/bar'; - - $this->provider->expects($this->once()) - ->method('getRouteByName') - ->with($name) - ->will($this->returnValue($this->routeDocument)) - ; - $this->routeDocument->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($name)); - } - - /** - * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException - */ - public function testGenerateNotFound() - { - $name = 'foo/bar'; - - $this->provider->expects($this->once()) - ->method('getRouteByName') - ->with($name) - ->will($this->returnValue(null)) - ; - - $this->generator->generate($name); - } - - public function testGenerateFromRoute() - { - $this->provider->expects($this->never()) - ->method('getRouteByName') - ; - $this->routeDocument->expects($this->once()) - ->method('compile') - ->will($this->returnValue($this->routeCompiled)) - ; - - $this->assertEquals('result_url', $this->generator->generate($this->routeDocument)); - } - - public function testSupports() - { - $this->assertTrue($this->generator->supports('foo/bar')); - $this->assertTrue($this->generator->supports($this->routeDocument)); - $this->assertFalse($this->generator->supports($this)); - } - - public function testGetRouteDebugMessage() - { - $this->assertContains('/some/key', $this->generator->getRouteDebugMessage(new RouteObject())); - $this->assertContains('/de/test', $this->generator->getRouteDebugMessage(new Route('/de/test'))); - $this->assertContains('/some/route', $this->generator->getRouteDebugMessage('/some/route')); - $this->assertContains('a:1:{s:10:"route_name";s:7:"example";}', $this->generator->getRouteDebugMessage(array('route_name' => 'example'))); - } - - /** - * Tests the generate method with passing in a route object into generate(). - * - * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException - */ - public function testGenerateByRoute() - { - $this->generator = new ProviderBasedGenerator($this->provider); - - // Setup a route with a numeric parameter, but pass in a string, so it - // fails and getRouteDebugMessage should be triggered. - $route = new Route('/test'); - $route->setPath('/test/{number}'); - $route->setRequirement('number', '\+d'); - - $this->generator->setStrictRequirements(true); - - $context = new RequestContext(); - $this->generator->setContext($context); - - $this->assertSame(null, $this->generator->generate($route, array('number' => 'string'))); - - } -} - -/** - * Overwrite doGenerate to reduce amount of mocking needed - */ -class TestableProviderBasedGenerator extends ProviderBasedGenerator -{ - protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array()) - { - return 'result_url'; - } -} - -class RouteObject implements RouteObjectInterface -{ - public function getRouteKey() - { - return '/some/key'; - } - - public function getContent() - { - return null; - } -} diff --git a/vendor/symfony-cmf/routing/Tests/Routing/RouteMock.php b/vendor/symfony-cmf/routing/Tests/Routing/RouteMock.php deleted file mode 100644 index 7b1440a..0000000 --- a/vendor/symfony-cmf/routing/Tests/Routing/RouteMock.php +++ /dev/null @@ -1,55 +0,0 @@ -locale = $locale; - } - - public function getContent() - { - return null; - } - - public function getDefaults() - { - $defaults = array(); - if (! is_null($this->locale)) { - $defaults['_locale'] = $this->locale; - } - - return $defaults; - } - - public function getRequirement($key) - { - if (! $key == '_locale') { - throw new \Exception; - } - - return $this->locale; - } - - public function getRouteKey() - { - return null; - } -} diff --git a/vendor/symfony-cmf/routing/Tests/bootstrap.php b/vendor/symfony-cmf/routing/Tests/bootstrap.php deleted file mode 100644 index 157e59f..0000000 --- a/vendor/symfony-cmf/routing/Tests/bootstrap.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit\Tests; - -use Symfony\Component\BrowserKit\Client; -use Symfony\Component\BrowserKit\History; -use Symfony\Component\BrowserKit\CookieJar; -use Symfony\Component\BrowserKit\Response; - -class SpecialResponse extends Response -{ -} - -class TestClient extends Client -{ - protected $nextResponse = null; - protected $nextScript = null; - - public function setNextResponse(Response $response) - { - $this->nextResponse = $response; - } - - public function setNextScript($script) - { - $this->nextScript = $script; - } - - protected function doRequest($request) - { - if (null === $this->nextResponse) { - return new Response(); - } - - $response = $this->nextResponse; - $this->nextResponse = null; - - return $response; - } - - protected function filterResponse($response) - { - if ($response instanceof SpecialResponse) { - return new Response($response->getContent(), $response->getStatus(), $response->getHeaders()); - } - - return $response; - } - - protected function getScript($request) - { - $r = new \ReflectionClass('Symfony\Component\BrowserKit\Response'); - $path = $r->getFileName(); - - return <<nextScript); -EOF; - } -} - -class ClientTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\BrowserKit\Client::getHistory - */ - public function testGetHistory() - { - $client = new TestClient(array(), $history = new History()); - $this->assertSame($history, $client->getHistory(), '->getHistory() returns the History'); - } - - /** - * @covers Symfony\Component\BrowserKit\Client::getCookieJar - */ - public function testGetCookieJar() - { - $client = new TestClient(array(), null, $cookieJar = new CookieJar()); - $this->assertSame($cookieJar, $client->getCookieJar(), '->getCookieJar() returns the CookieJar'); - } - - /** - * @covers Symfony\Component\BrowserKit\Client::getRequest - */ - public function testGetRequest() - { - $client = new TestClient(); - $client->request('GET', 'http://example.com/'); - - $this->assertEquals('http://example.com/', $client->getRequest()->getUri(), '->getCrawler() returns the Request of the last request'); - } - - public function testGetRequestWithIpAsHost() - { - $client = new TestClient(); - $client->request('GET', 'https://example.com/foo', array(), array(), array('HTTP_HOST' => '127.0.0.1')); - - $this->assertEquals('https://127.0.0.1/foo', $client->getRequest()->getUri()); - } - - public function testGetResponse() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo')); - $client->request('GET', 'http://example.com/'); - - $this->assertEquals('foo', $client->getResponse()->getContent(), '->getCrawler() returns the Response of the last request'); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Response', $client->getResponse(), '->getCrawler() returns the Response of the last request'); - } - - public function testGetInternalResponse() - { - $client = new TestClient(); - $client->setNextResponse(new SpecialResponse('foo')); - $client->request('GET', 'http://example.com/'); - - $this->assertInstanceOf('Symfony\Component\BrowserKit\Response', $client->getInternalResponse()); - $this->assertNotInstanceOf('Symfony\Component\BrowserKit\Tests\SpecialResponse', $client->getInternalResponse()); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Tests\SpecialResponse', $client->getResponse()); - } - - public function testGetContent() - { - $json = '{"jsonrpc":"2.0","method":"echo","id":7,"params":["Hello World"]}'; - - $client = new TestClient(); - $client->request('POST', 'http://example.com/jsonrpc', array(), array(), array(), $json); - $this->assertEquals($json, $client->getRequest()->getContent()); - } - - /** - * @covers Symfony\Component\BrowserKit\Client::getCrawler - */ - public function testGetCrawler() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo')); - $crawler = $client->request('GET', 'http://example.com/'); - - $this->assertSame($crawler, $client->getCrawler(), '->getCrawler() returns the Crawler of the last request'); - } - - public function testRequestHttpHeaders() - { - $client = new TestClient(); - $client->request('GET', '/'); - $headers = $client->getRequest()->getServer(); - $this->assertEquals('localhost', $headers['HTTP_HOST'], '->request() sets the HTTP_HOST header'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com'); - $headers = $client->getRequest()->getServer(); - $this->assertEquals('www.example.com', $headers['HTTP_HOST'], '->request() sets the HTTP_HOST header'); - - $client->request('GET', 'https://www.example.com'); - $headers = $client->getRequest()->getServer(); - $this->assertTrue($headers['HTTPS'], '->request() sets the HTTPS header'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com:8080'); - $headers = $client->getRequest()->getServer(); - $this->assertEquals('www.example.com:8080', $headers['HTTP_HOST'], '->request() sets the HTTP_HOST header with port'); - } - - public function testRequestURIConversion() - { - $client = new TestClient(); - $client->request('GET', '/foo'); - $this->assertEquals('http://localhost/foo', $client->getRequest()->getUri(), '->request() converts the URI to an absolute one'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com'); - $this->assertEquals('http://www.example.com', $client->getRequest()->getUri(), '->request() does not change absolute URIs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/'); - $client->request('GET', '/foo'); - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo'); - $client->request('GET', '#'); - $this->assertEquals('http://www.example.com/foo#', $client->getRequest()->getUri(), '->request() uses the previous request for #'); - $client->request('GET', '#'); - $this->assertEquals('http://www.example.com/foo#', $client->getRequest()->getUri(), '->request() uses the previous request for #'); - $client->request('GET', '#foo'); - $this->assertEquals('http://www.example.com/foo#foo', $client->getRequest()->getUri(), '->request() uses the previous request for #'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/'); - $client->request('GET', 'bar'); - $this->assertEquals('http://www.example.com/foo/bar', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'bar'); - $this->assertEquals('http://www.example.com/foo/bar', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/'); - $client->request('GET', 'http'); - $this->assertEquals('http://www.example.com/foo/http', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo'); - $client->request('GET', 'http/bar'); - $this->assertEquals('http://www.example.com/http/bar', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/'); - $client->request('GET', 'http'); - $this->assertEquals('http://www.example.com/http', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs'); - } - - public function testRequestURIConversionByServerHost() - { - $client = new TestClient(); - - $server = array('HTTP_HOST' => 'www.exampl+e.com:8000'); - $parameters = array(); - $files = array(); - - $client->request('GET', 'http://exampl+e.com', $parameters, $files, $server); - $this->assertEquals('http://www.exampl+e.com:8000', $client->getRequest()->getUri(), '->request() uses HTTP_HOST to add port'); - - $client->request('GET', 'http://exampl+e.com:8888', $parameters, $files, $server); - $this->assertEquals('http://www.exampl+e.com:8000', $client->getRequest()->getUri(), '->request() uses HTTP_HOST to modify existing port'); - - $client->request('GET', 'http://exampl+e.com:8000', $parameters, $files, $server); - $this->assertEquals('http://www.exampl+e.com:8000', $client->getRequest()->getUri(), '->request() uses HTTP_HOST respects correct set port'); - } - - public function testRequestReferer() - { - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'bar'); - $server = $client->getRequest()->getServer(); - $this->assertEquals('http://www.example.com/foo/foobar', $server['HTTP_REFERER'], '->request() sets the referer'); - } - - public function testRequestHistory() - { - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'bar'); - - $this->assertEquals('http://www.example.com/foo/bar', $client->getHistory()->current()->getUri(), '->request() updates the History'); - $this->assertEquals('http://www.example.com/foo/foobar', $client->getHistory()->back()->getUri(), '->request() updates the History'); - } - - public function testRequestCookies() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo', 200, array('Set-Cookie' => 'foo=bar'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); - - $client->request('GET', 'bar'); - $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->allValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar'); - } - - public function testRequestSecureCookies() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo', 200, array('Set-Cookie' => 'foo=bar; path=/; secure'))); - $client->request('GET', 'https://www.example.com/foo/foobar'); - - $this->assertTrue($client->getCookieJar()->get('foo', '/', 'www.example.com')->isSecure()); - } - - public function testClick() - { - $client = new TestClient(); - $client->setNextResponse(new Response('foo')); - $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); - - $client->click($crawler->filter('a')->link()); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() clicks on links'); - } - - public function testClickForm() - { - $client = new TestClient(); - $client->setNextResponse(new Response('
')); - $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); - - $client->click($crawler->filter('input')->form()); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() Form submit forms'); - } - - public function testSubmit() - { - $client = new TestClient(); - $client->setNextResponse(new Response('
')); - $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); - - $client->submit($crawler->filter('input')->form()); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->submit() submit forms'); - } - - public function testSubmitPreserveAuth() - { - $client = new TestClient(array('PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar')); - $client->setNextResponse(new Response('
')); - $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); - - $server = $client->getRequest()->getServer(); - $this->assertArrayHasKey('PHP_AUTH_USER', $server); - $this->assertEquals('foo', $server['PHP_AUTH_USER']); - $this->assertArrayHasKey('PHP_AUTH_PW', $server); - $this->assertEquals('bar', $server['PHP_AUTH_PW']); - - $client->submit($crawler->filter('input')->form()); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->submit() submit forms'); - - $server = $client->getRequest()->getServer(); - $this->assertArrayHasKey('PHP_AUTH_USER', $server); - $this->assertEquals('foo', $server['PHP_AUTH_USER']); - $this->assertArrayHasKey('PHP_AUTH_PW', $server); - $this->assertEquals('bar', $server['PHP_AUTH_PW']); - } - - public function testFollowRedirect() - { - $client = new TestClient(); - $client->followRedirects(false); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - try { - $client->followRedirect(); - $this->fail('->followRedirect() throws a \LogicException if the request was not redirected'); - } catch (\Exception $e) { - $this->assertInstanceOf('LogicException', $e, '->followRedirect() throws a \LogicException if the request was not redirected'); - } - - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->followRedirect(); - - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() automatically follows redirects if followRedirects is true'); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 201, array('Location' => 'http://www.example.com/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - $this->assertEquals('http://www.example.com/foo/foobar', $client->getRequest()->getUri(), '->followRedirect() does not follow redirect if HTTP Code is not 30x'); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 201, array('Location' => 'http://www.example.com/redirected'))); - $client->followRedirects(false); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - try { - $client->followRedirect(); - $this->fail('->followRedirect() throws a \LogicException if the request did not respond with 30x HTTP Code'); - } catch (\Exception $e) { - $this->assertInstanceOf('LogicException', $e, '->followRedirect() throws a \LogicException if the request did not respond with 30x HTTP Code'); - } - } - - public function testFollowRelativeRedirect() - { - $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => '/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => '/redirected:1234'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->assertEquals('http://www.example.com/redirected:1234', $client->getRequest()->getUri(), '->followRedirect() follows relative urls'); - } - - public function testFollowRedirectWithMaxRedirects() - { - $client = new TestClient(); - $client->setMaxRedirects(1); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); - - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected2'))); - try { - $client->followRedirect(); - $this->fail('->followRedirect() throws a \LogicException if the request was redirected and limit of redirections was reached'); - } catch (\Exception $e) { - $this->assertInstanceOf('LogicException', $e, '->followRedirect() throws a \LogicException if the request was redirected and limit of redirections was reached'); - } - - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any'); - - $client->setNextResponse(new Response('', 302, array('Location' => '/redirected'))); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - $this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows relative URLs'); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => '//www.example.org/'))); - $client->request('GET', 'https://www.example.com/'); - - $this->assertEquals('https://www.example.org/', $client->getRequest()->getUri(), '->followRedirect() follows protocol-relative URLs'); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array('Location' => 'http://www.example.com/redirected'))); - $client->request('POST', 'http://www.example.com/foo/foobar', array('name' => 'bar')); - - $this->assertEquals('get', $client->getRequest()->getMethod(), '->followRedirect() uses a get for 302'); - $this->assertEquals(array(), $client->getRequest()->getParameters(), '->followRedirect() does not submit parameters when changing the method'); - } - - public function testFollowRedirectWithCookies() - { - $client = new TestClient(); - $client->followRedirects(false); - $client->setNextResponse(new Response('', 302, array( - 'Location' => 'http://www.example.com/redirected', - 'Set-Cookie' => 'foo=bar', - ))); - $client->request('GET', 'http://www.example.com/'); - $this->assertEquals(array(), $client->getRequest()->getCookies()); - $client->followRedirect(); - $this->assertEquals(array('foo' => 'bar'), $client->getRequest()->getCookies()); - } - - public function testFollowRedirectWithHeaders() - { - $headers = array( - 'HTTP_HOST' => 'www.example.com', - 'HTTP_USER_AGENT' => 'Symfony2 BrowserKit', - 'CONTENT_TYPE' => 'application/vnd.custom+xml', - 'HTTPS' => false, - ); - - $client = new TestClient(); - $client->followRedirects(false); - $client->setNextResponse(new Response('', 302, array( - 'Location' => 'http://www.example.com/redirected', - ))); - $client->request('GET', 'http://www.example.com/', array(), array(), array( - 'CONTENT_TYPE' => 'application/vnd.custom+xml', - )); - - $this->assertEquals($headers, $client->getRequest()->getServer()); - - $client->followRedirect(); - - $headers['HTTP_REFERER'] = 'http://www.example.com/'; - - $this->assertEquals($headers, $client->getRequest()->getServer()); - } - - public function testFollowRedirectWithPort() - { - $headers = array( - 'HTTP_HOST' => 'www.example.com:8080', - 'HTTP_USER_AGENT' => 'Symfony2 BrowserKit', - 'HTTPS' => false, - 'HTTP_REFERER' => 'http://www.example.com:8080/', - ); - - $client = new TestClient(); - $client->setNextResponse(new Response('', 302, array( - 'Location' => 'http://www.example.com:8080/redirected', - ))); - $client->request('GET', 'http://www.example.com:8080/'); - - $this->assertEquals($headers, $client->getRequest()->getServer()); - } - - public function testBack() - { - $client = new TestClient(); - - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); - $content = 'foobarbaz'; - - $client->request('GET', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); - $client->request('GET', 'http://www.example.com/foo'); - $client->back(); - - $this->assertEquals('http://www.example.com/foo/foobar', $client->getRequest()->getUri(), '->back() goes back in the history'); - $this->assertArrayHasKey('foo', $client->getRequest()->getParameters(), '->back() keeps parameters'); - $this->assertArrayHasKey('myfile.foo', $client->getRequest()->getFiles(), '->back() keeps files'); - $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->back() keeps $_SERVER'); - $this->assertEquals($content, $client->getRequest()->getContent(), '->back() keeps content'); - } - - public function testForward() - { - $client = new TestClient(); - - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); - $content = 'foobarbaz'; - - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->request('GET', 'http://www.example.com/foo', $parameters, $files, $server, $content); - $client->back(); - $client->forward(); - - $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->forward() goes forward in the history'); - $this->assertArrayHasKey('foo', $client->getRequest()->getParameters(), '->forward() keeps parameters'); - $this->assertArrayHasKey('myfile.foo', $client->getRequest()->getFiles(), '->forward() keeps files'); - $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->forward() keeps $_SERVER'); - $this->assertEquals($content, $client->getRequest()->getContent(), '->forward() keeps content'); - } - - public function testReload() - { - $client = new TestClient(); - - $parameters = array('foo' => 'bar'); - $files = array('myfile.foo' => 'baz'); - $server = array('X_TEST_FOO' => 'bazbar'); - $content = 'foobarbaz'; - - $client->request('GET', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); - $client->reload(); - - $this->assertEquals('http://www.example.com/foo/foobar', $client->getRequest()->getUri(), '->reload() reloads the current page'); - $this->assertArrayHasKey('foo', $client->getRequest()->getParameters(), '->reload() keeps parameters'); - $this->assertArrayHasKey('myfile.foo', $client->getRequest()->getFiles(), '->reload() keeps files'); - $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->reload() keeps $_SERVER'); - $this->assertEquals($content, $client->getRequest()->getContent(), '->reload() keeps content'); - } - - public function testRestart() - { - $client = new TestClient(); - $client->request('GET', 'http://www.example.com/foo/foobar'); - $client->restart(); - - $this->assertTrue($client->getHistory()->isEmpty(), '->restart() clears the history'); - $this->assertEquals(array(), $client->getCookieJar()->all(), '->restart() clears the cookies'); - } - - public function testInsulatedRequests() - { - $client = new TestClient(); - $client->insulate(); - $client->setNextScript("new Symfony\Component\BrowserKit\Response('foobar')"); - $client->request('GET', 'http://www.example.com/foo/foobar'); - - $this->assertEquals('foobar', $client->getResponse()->getContent(), '->insulate() process the request in a forked process'); - - $client->setNextScript("new Symfony\Component\BrowserKit\Response('foobar)"); - - try { - $client->request('GET', 'http://www.example.com/foo/foobar'); - $this->fail('->request() throws a \RuntimeException if the script has an error'); - } catch (\Exception $e) { - $this->assertInstanceOf('RuntimeException', $e, '->request() throws a \RuntimeException if the script has an error'); - } - } - - public function testGetServerParameter() - { - $client = new TestClient(); - $this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST')); - $this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); - $this->assertEquals('testvalue', $client->getServerParameter('testkey', 'testvalue')); - } - - public function testSetServerParameter() - { - $client = new TestClient(); - - $this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST')); - $this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); - - $client->setServerParameter('HTTP_HOST', 'testhost'); - $this->assertEquals('testhost', $client->getServerParameter('HTTP_HOST')); - - $client->setServerParameter('HTTP_USER_AGENT', 'testua'); - $this->assertEquals('testua', $client->getServerParameter('HTTP_USER_AGENT')); - } - - public function testSetServerParameterInRequest() - { - $client = new TestClient(); - - $this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST')); - $this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); - - $client->request('GET', 'https://www.example.com/https/www.example.com', array(), array(), array( - 'HTTP_HOST' => 'testhost', - 'HTTP_USER_AGENT' => 'testua', - 'HTTPS' => false, - 'NEW_SERVER_KEY' => 'new-server-key-value', - )); - - $this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST')); - $this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT')); - - $this->assertEquals('http://testhost/https/www.example.com', $client->getRequest()->getUri()); - - $server = $client->getRequest()->getServer(); - - $this->assertArrayHasKey('HTTP_USER_AGENT', $server); - $this->assertEquals('testua', $server['HTTP_USER_AGENT']); - - $this->assertArrayHasKey('HTTP_HOST', $server); - $this->assertEquals('testhost', $server['HTTP_HOST']); - - $this->assertArrayHasKey('NEW_SERVER_KEY', $server); - $this->assertEquals('new-server-key-value', $server['NEW_SERVER_KEY']); - - $this->assertArrayHasKey('HTTPS', $server); - $this->assertFalse($server['HTTPS']); - } -} diff --git a/vendor/symfony/browser-kit/Tests/CookieJarTest.php b/vendor/symfony/browser-kit/Tests/CookieJarTest.php deleted file mode 100644 index 4da4404..0000000 --- a/vendor/symfony/browser-kit/Tests/CookieJarTest.php +++ /dev/null @@ -1,231 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit\Tests; - -use Symfony\Component\BrowserKit\CookieJar; -use Symfony\Component\BrowserKit\Cookie; -use Symfony\Component\BrowserKit\Response; - -class CookieJarTest extends \PHPUnit_Framework_TestCase -{ - public function testSetGet() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie = new Cookie('foo', 'bar')); - - $this->assertEquals($cookie, $cookieJar->get('foo'), '->set() sets a cookie'); - - $this->assertNull($cookieJar->get('foobar'), '->get() returns null if the cookie does not exist'); - - $cookieJar->set($cookie = new Cookie('foo', 'bar', time() - 86400)); - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - } - - public function testExpire() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie = new Cookie('foo', 'bar')); - $cookieJar->expire('foo'); - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - } - - public function testAll() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar')); - $cookieJar->set($cookie2 = new Cookie('bar', 'foo')); - - $this->assertEquals(array($cookie1, $cookie2), $cookieJar->all(), '->all() returns all cookies in the jar'); - } - - public function testClear() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar')); - $cookieJar->set($cookie2 = new Cookie('bar', 'foo')); - - $cookieJar->clear(); - - $this->assertEquals(array(), $cookieJar->all(), '->clear() expires all cookies'); - } - - public function testUpdateFromResponse() - { - $response = new Response('', 200, array('Set-Cookie' => 'foo=foo')); - - $cookieJar = new CookieJar(); - $cookieJar->updateFromResponse($response); - - $this->assertEquals('foo', $cookieJar->get('foo')->getValue(), '->updateFromResponse() updates cookies from a Response objects'); - } - - public function testUpdateFromSetCookie() - { - $setCookies = array('foo=foo'); - - $cookieJar = new CookieJar(); - $cookieJar->set(new Cookie('bar', 'bar')); - $cookieJar->updateFromSetCookie($setCookies); - - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $cookieJar->get('foo')); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $cookieJar->get('bar')); - $this->assertEquals('foo', $cookieJar->get('foo')->getValue(), '->updateFromSetCookie() updates cookies from a Set-Cookie header'); - $this->assertEquals('bar', $cookieJar->get('bar')->getValue(), '->updateFromSetCookie() keeps existing cookies'); - } - - public function testUpdateFromEmptySetCookie() - { - $cookieJar = new CookieJar(); - $cookieJar->updateFromSetCookie(array('')); - $this->assertEquals(array(), $cookieJar->all()); - } - - public function testUpdateFromSetCookieWithMultipleCookies() - { - $timestamp = time() + 3600; - $date = gmdate('D, d M Y H:i:s \G\M\T', $timestamp); - $setCookies = array(sprintf('foo=foo; expires=%s; domain=.symfony.com; path=/, bar=bar; domain=.blog.symfony.com, PHPSESSID=id; expires=%s', $date, $date)); - - $cookieJar = new CookieJar(); - $cookieJar->updateFromSetCookie($setCookies); - - $fooCookie = $cookieJar->get('foo', '/', '.symfony.com'); - $barCookie = $cookieJar->get('bar', '/', '.blog.symfony.com'); - $phpCookie = $cookieJar->get('PHPSESSID'); - - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $fooCookie); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $barCookie); - $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $phpCookie); - $this->assertEquals('foo', $fooCookie->getValue()); - $this->assertEquals('bar', $barCookie->getValue()); - $this->assertEquals('id', $phpCookie->getValue()); - $this->assertEquals($timestamp, $fooCookie->getExpiresTime()); - $this->assertNull($barCookie->getExpiresTime()); - $this->assertEquals($timestamp, $phpCookie->getExpiresTime()); - } - - /** - * @dataProvider provideAllValuesValues - */ - public function testAllValues($uri, $values) - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo_nothing', 'foo')); - $cookieJar->set($cookie2 = new Cookie('foo_expired', 'foo', time() - 86400)); - $cookieJar->set($cookie3 = new Cookie('foo_path', 'foo', null, '/foo')); - $cookieJar->set($cookie4 = new Cookie('foo_domain', 'foo', null, '/', '.example.com')); - $cookieJar->set($cookie4 = new Cookie('foo_strict_domain', 'foo', null, '/', '.www4.example.com')); - $cookieJar->set($cookie5 = new Cookie('foo_secure', 'foo', null, '/', '', true)); - - $this->assertEquals($values, array_keys($cookieJar->allValues($uri)), '->allValues() returns the cookie for a given URI'); - } - - public function provideAllValuesValues() - { - return array( - array('http://www.example.com', array('foo_nothing', 'foo_domain')), - array('http://www.example.com/', array('foo_nothing', 'foo_domain')), - array('http://foo.example.com/', array('foo_nothing', 'foo_domain')), - array('http://foo.example1.com/', array('foo_nothing')), - array('https://foo.example.com/', array('foo_nothing', 'foo_secure', 'foo_domain')), - array('http://www.example.com/foo/bar', array('foo_nothing', 'foo_path', 'foo_domain')), - array('http://www4.example.com/', array('foo_nothing', 'foo_domain', 'foo_strict_domain')), - ); - } - - public function testEncodedValues() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true)); - - $this->assertEquals(array('foo' => 'bar=baz'), $cookieJar->allValues('/')); - $this->assertEquals(array('foo' => 'bar%3Dbaz'), $cookieJar->allRawValues('/')); - } - - public function testCookieExpireWithSameNameButDifferentPaths() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo')); - $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar')); - $cookieJar->expire('foo', '/foo'); - - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array(), $cookieJar->allValues('http://example.com/foo')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://example.com/bar')); - } - - public function testCookieExpireWithNullPaths() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/')); - $cookieJar->expire('foo', null); - - $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired'); - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - } - - public function testCookieWithSameNameButDifferentPaths() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo')); - $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar')); - - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array('foo' => 'bar1'), $cookieJar->allValues('http://example.com/foo')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://example.com/bar')); - } - - public function testCookieWithSameNameButDifferentDomains() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/', 'foo.example.com')); - $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/', 'bar.example.com')); - - $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/'))); - $this->assertEquals(array('foo' => 'bar1'), $cookieJar->allValues('http://foo.example.com/')); - $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://bar.example.com/')); - } - - public function testCookieGetWithSubdomain() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar', null, '/', '.example.com')); - $cookieJar->set($cookie2 = new Cookie('foo1', 'bar', null, '/', 'test.example.com')); - - $this->assertEquals($cookie1, $cookieJar->get('foo', '/', 'foo.example.com')); - $this->assertEquals($cookie1, $cookieJar->get('foo', '/', 'example.com')); - $this->assertEquals($cookie2, $cookieJar->get('foo1', '/', 'test.example.com')); - } - - public function testCookieGetWithSubdirectory() - { - $cookieJar = new CookieJar(); - $cookieJar->set($cookie1 = new Cookie('foo', 'bar', null, '/test', '.example.com')); - $cookieJar->set($cookie2 = new Cookie('foo1', 'bar1', null, '/', '.example.com')); - - $this->assertNull($cookieJar->get('foo', '/', '.example.com')); - $this->assertNull($cookieJar->get('foo', '/bar', '.example.com')); - $this->assertEquals($cookie1, $cookieJar->get('foo', '/test', 'example.com')); - $this->assertEquals($cookie2, $cookieJar->get('foo1', '/', 'example.com')); - $this->assertEquals($cookie2, $cookieJar->get('foo1', '/bar', 'example.com')); - } - - public function testCookieWithWildcardDomain() - { - $cookieJar = new CookieJar(); - $cookieJar->set(new Cookie('foo', 'bar', null, '/', '.example.com')); - - $this->assertEquals(array('foo' => 'bar'), $cookieJar->allValues('http://www.example.com')); - $this->assertEmpty($cookieJar->allValues('http://wwwexample.com')); - } -} diff --git a/vendor/symfony/browser-kit/Tests/CookieTest.php b/vendor/symfony/browser-kit/Tests/CookieTest.php deleted file mode 100644 index e1dd0df..0000000 --- a/vendor/symfony/browser-kit/Tests/CookieTest.php +++ /dev/null @@ -1,179 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit\Tests; - -use Symfony\Component\BrowserKit\Cookie; - -class CookieTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getTestsForToFromString - */ - public function testToFromString($cookie, $url = null) - { - $this->assertEquals($cookie, (string) Cookie::fromString($cookie, $url)); - } - - public function getTestsForToFromString() - { - return array( - array('foo=bar; path=/'), - array('foo=bar; path=/foo'), - array('foo=bar; domain=google.com; path=/'), - array('foo=bar; domain=example.com; path=/; secure', 'https://example.com/'), - array('foo=bar; path=/; httponly'), - array('foo=bar; domain=google.com; path=/foo; secure; httponly', 'https://google.com/'), - array('foo=bar=baz; path=/'), - array('foo=bar%3Dbaz; path=/'), - ); - } - - public function testFromStringIgnoreSecureFlag() - { - $this->assertFalse(Cookie::fromString('foo=bar; secure')->isSecure()); - $this->assertFalse(Cookie::fromString('foo=bar; secure', 'http://example.com/')->isSecure()); - } - - /** - * @dataProvider getExpireCookieStrings - */ - public function testFromStringAcceptsSeveralExpiresDateFormats($cookie) - { - $this->assertEquals(1596185377, Cookie::fromString($cookie)->getExpiresTime()); - } - - public function getExpireCookieStrings() - { - return array( - array('foo=bar; expires=Fri, 31-Jul-2020 08:49:37 GMT'), - array('foo=bar; expires=Fri, 31 Jul 2020 08:49:37 GMT'), - array('foo=bar; expires=Fri, 31-07-2020 08:49:37 GMT'), - array('foo=bar; expires=Fri, 31-07-20 08:49:37 GMT'), - array('foo=bar; expires=Friday, 31-Jul-20 08:49:37 GMT'), - array('foo=bar; expires=Fri Jul 31 08:49:37 2020'), - array('foo=bar; expires=\'Fri Jul 31 08:49:37 2020\''), - array('foo=bar; expires=Friday July 31st 2020, 08:49:37 GMT'), - ); - } - - public function testFromStringWithCapitalization() - { - $this->assertEquals('Foo=Bar; path=/', (string) Cookie::fromString('Foo=Bar')); - $this->assertEquals('foo=bar; expires=Fri, 31 Dec 2010 23:59:59 GMT; path=/', (string) Cookie::fromString('foo=bar; Expires=Fri, 31 Dec 2010 23:59:59 GMT')); - $this->assertEquals('foo=bar; domain=www.example.org; path=/; httponly', (string) Cookie::fromString('foo=bar; DOMAIN=www.example.org; HttpOnly')); - } - - public function testFromStringWithUrl() - { - $this->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar', 'http://www.example.com/')); - $this->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar', 'http://www.example.com')); - $this->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar', 'http://www.example.com?foo')); - $this->assertEquals('foo=bar; domain=www.example.com; path=/foo', (string) Cookie::fromString('foo=bar', 'http://www.example.com/foo/bar')); - $this->assertEquals('foo=bar; domain=www.example.com; path=/', (string) Cookie::fromString('foo=bar; path=/', 'http://www.example.com/foo/bar')); - $this->assertEquals('foo=bar; domain=www.myotherexample.com; path=/', (string) Cookie::fromString('foo=bar; domain=www.myotherexample.com', 'http://www.example.com/')); - } - - public function testFromStringThrowsAnExceptionIfCookieIsNotValid() - { - $this->setExpectedException('InvalidArgumentException'); - Cookie::fromString('foo'); - } - - public function testFromStringThrowsAnExceptionIfCookieDateIsNotValid() - { - $this->setExpectedException('InvalidArgumentException'); - Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT'); - } - - public function testFromStringThrowsAnExceptionIfUrlIsNotValid() - { - $this->setExpectedException('InvalidArgumentException'); - Cookie::fromString('foo=bar', 'foobar'); - } - - public function testGetName() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertEquals('foo', $cookie->getName(), '->getName() returns the cookie name'); - } - - public function testGetValue() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertEquals('bar', $cookie->getValue(), '->getValue() returns the cookie value'); - - $cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true); // raw value - $this->assertEquals('bar=baz', $cookie->getValue(), '->getValue() returns the urldecoded cookie value'); - } - - public function testGetRawValue() - { - $cookie = new Cookie('foo', 'bar=baz'); // decoded value - $this->assertEquals('bar%3Dbaz', $cookie->getRawValue(), '->getRawValue() returns the urlencoded cookie value'); - $cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true); // raw value - $this->assertEquals('bar%3Dbaz', $cookie->getRawValue(), '->getRawValue() returns the non-urldecoded cookie value'); - } - - public function testGetPath() - { - $cookie = new Cookie('foo', 'bar', 0); - $this->assertEquals('/', $cookie->getPath(), '->getPath() returns / is no path is defined'); - - $cookie = new Cookie('foo', 'bar', 0, '/foo'); - $this->assertEquals('/foo', $cookie->getPath(), '->getPath() returns the cookie path'); - } - - public function testGetDomain() - { - $cookie = new Cookie('foo', 'bar', 0, '/', 'foo.com'); - $this->assertEquals('foo.com', $cookie->getDomain(), '->getDomain() returns the cookie domain'); - } - - public function testIsSecure() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertFalse($cookie->isSecure(), '->isSecure() returns false if not defined'); - - $cookie = new Cookie('foo', 'bar', 0, '/', 'foo.com', true); - $this->assertTrue($cookie->isSecure(), '->isSecure() returns the cookie secure flag'); - } - - public function testIsHttponly() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns false if not defined'); - - $cookie = new Cookie('foo', 'bar', 0, '/', 'foo.com', false, true); - $this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns the cookie httponly flag'); - } - - public function testGetExpiresTime() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertNull($cookie->getExpiresTime(), '->getExpiresTime() returns the expires time'); - - $cookie = new Cookie('foo', 'bar', $time = time() - 86400); - $this->assertEquals($time, $cookie->getExpiresTime(), '->getExpiresTime() returns the expires time'); - } - - public function testIsExpired() - { - $cookie = new Cookie('foo', 'bar'); - $this->assertFalse($cookie->isExpired(), '->isExpired() returns false when the cookie never expires (null as expires time)'); - - $cookie = new Cookie('foo', 'bar', time() - 86400); - $this->assertTrue($cookie->isExpired(), '->isExpired() returns true when the cookie is expired'); - - $cookie = new Cookie('foo', 'bar', 0); - $this->assertFalse($cookie->isExpired()); - } -} diff --git a/vendor/symfony/browser-kit/Tests/HistoryTest.php b/vendor/symfony/browser-kit/Tests/HistoryTest.php deleted file mode 100644 index d6d830e..0000000 --- a/vendor/symfony/browser-kit/Tests/HistoryTest.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit\Tests; - -use Symfony\Component\BrowserKit\History; -use Symfony\Component\BrowserKit\Request; - -class HistoryTest extends \PHPUnit_Framework_TestCase -{ - public function testAdd() - { - $history = new History(); - $history->add(new Request('http://www.example1.com/', 'get')); - $this->assertSame('http://www.example1.com/', $history->current()->getUri(), '->add() adds a request to the history'); - - $history->add(new Request('http://www.example2.com/', 'get')); - $this->assertSame('http://www.example2.com/', $history->current()->getUri(), '->add() adds a request to the history'); - - $history->add(new Request('http://www.example3.com/', 'get')); - $history->back(); - $history->add(new Request('http://www.example4.com/', 'get')); - $this->assertSame('http://www.example4.com/', $history->current()->getUri(), '->add() adds a request to the history'); - - $history->back(); - $this->assertSame('http://www.example2.com/', $history->current()->getUri(), '->add() adds a request to the history'); - } - - public function testClearIsEmpty() - { - $history = new History(); - $history->add(new Request('http://www.example.com/', 'get')); - - $this->assertFalse($history->isEmpty(), '->isEmpty() returns false if the history is not empty'); - - $history->clear(); - - $this->assertTrue($history->isEmpty(), '->isEmpty() true if the history is empty'); - } - - public function testCurrent() - { - $history = new History(); - - try { - $history->current(); - $this->fail('->current() throws a \LogicException if the history is empty'); - } catch (\Exception $e) { - $this->assertInstanceOf('LogicException', $e, '->current() throws a \LogicException if the history is empty'); - } - - $history->add(new Request('http://www.example.com/', 'get')); - - $this->assertSame('http://www.example.com/', $history->current()->getUri(), '->current() returns the current request in the history'); - } - - public function testBack() - { - $history = new History(); - $history->add(new Request('http://www.example.com/', 'get')); - - try { - $history->back(); - $this->fail('->back() throws a \LogicException if the history is already on the first page'); - } catch (\Exception $e) { - $this->assertInstanceOf('LogicException', $e, '->current() throws a \LogicException if the history is already on the first page'); - } - - $history->add(new Request('http://www.example1.com/', 'get')); - $history->back(); - - $this->assertSame('http://www.example.com/', $history->current()->getUri(), '->back() returns the previous request in the history'); - } - - public function testForward() - { - $history = new History(); - $history->add(new Request('http://www.example.com/', 'get')); - $history->add(new Request('http://www.example1.com/', 'get')); - - try { - $history->forward(); - $this->fail('->forward() throws a \LogicException if the history is already on the last page'); - } catch (\Exception $e) { - $this->assertInstanceOf('LogicException', $e, '->forward() throws a \LogicException if the history is already on the last page'); - } - - $history->back(); - $history->forward(); - - $this->assertSame('http://www.example1.com/', $history->current()->getUri(), '->forward() returns the next request in the history'); - } -} diff --git a/vendor/symfony/browser-kit/Tests/RequestTest.php b/vendor/symfony/browser-kit/Tests/RequestTest.php deleted file mode 100644 index b75b5fb..0000000 --- a/vendor/symfony/browser-kit/Tests/RequestTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit\Tests; - -use Symfony\Component\BrowserKit\Request; - -class RequestTest extends \PHPUnit_Framework_TestCase -{ - public function testGetUri() - { - $request = new Request('http://www.example.com/', 'get'); - $this->assertEquals('http://www.example.com/', $request->getUri(), '->getUri() returns the URI of the request'); - } - - public function testGetMethod() - { - $request = new Request('http://www.example.com/', 'get'); - $this->assertEquals('get', $request->getMethod(), '->getMethod() returns the method of the request'); - } - - public function testGetParameters() - { - $request = new Request('http://www.example.com/', 'get', array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getParameters(), '->getParameters() returns the parameters of the request'); - } - - public function testGetFiles() - { - $request = new Request('http://www.example.com/', 'get', array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getFiles(), '->getFiles() returns the uploaded files of the request'); - } - - public function testGetCookies() - { - $request = new Request('http://www.example.com/', 'get', array(), array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getCookies(), '->getCookies() returns the cookies of the request'); - } - - public function testGetServer() - { - $request = new Request('http://www.example.com/', 'get', array(), array(), array(), array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $request->getServer(), '->getServer() returns the server parameters of the request'); - } -} diff --git a/vendor/symfony/browser-kit/Tests/ResponseTest.php b/vendor/symfony/browser-kit/Tests/ResponseTest.php deleted file mode 100644 index bfe3cd5..0000000 --- a/vendor/symfony/browser-kit/Tests/ResponseTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\BrowserKit\Tests; - -use Symfony\Component\BrowserKit\Response; - -class ResponseTest extends \PHPUnit_Framework_TestCase -{ - public function testGetUri() - { - $response = new Response('foo'); - $this->assertEquals('foo', $response->getContent(), '->getContent() returns the content of the response'); - } - - public function testGetStatus() - { - $response = new Response('foo', 304); - $this->assertEquals('304', $response->getStatus(), '->getStatus() returns the status of the response'); - } - - public function testGetHeaders() - { - $response = new Response('foo', 200, array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $response->getHeaders(), '->getHeaders() returns the headers of the response'); - } - - public function testGetHeader() - { - $response = new Response('foo', 200, array( - 'Content-Type' => 'text/html', - 'Set-Cookie' => array('foo=bar', 'bar=foo'), - )); - - $this->assertEquals('text/html', $response->getHeader('Content-Type'), '->getHeader() returns a header of the response'); - $this->assertEquals('text/html', $response->getHeader('content-type'), '->getHeader() returns a header of the response'); - $this->assertEquals('text/html', $response->getHeader('content_type'), '->getHeader() returns a header of the response'); - $this->assertEquals('foo=bar', $response->getHeader('Set-Cookie'), '->getHeader() returns the first header value'); - $this->assertEquals(array('foo=bar', 'bar=foo'), $response->getHeader('Set-Cookie', false), '->getHeader() returns all header values if first is false'); - - $this->assertNull($response->getHeader('foo'), '->getHeader() returns null if the header is not defined'); - $this->assertEquals(array(), $response->getHeader('foo', false), '->getHeader() returns an empty array if the header is not defined and first is set to false'); - } - - public function testMagicToString() - { - $response = new Response('foo', 304, array('foo' => 'bar')); - - $this->assertEquals("foo: bar\n\nfoo", $response->__toString(), '->__toString() returns the headers and the content as a string'); - } - - public function testMagicToStringWithMultipleSetCookieHeader() - { - $headers = array( - 'content-type' => 'text/html; charset=utf-8', - 'set-cookie' => array('foo=bar', 'bar=foo'), - ); - - $expected = 'content-type: text/html; charset=utf-8'."\n"; - $expected .= 'set-cookie: foo=bar'."\n"; - $expected .= 'set-cookie: bar=foo'."\n\n"; - $expected .= 'foo'; - - $response = new Response('foo', 304, $headers); - - $this->assertEquals($expected, $response->__toString(), '->__toString() returns the headers and the content as a string'); - } -} diff --git a/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php b/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php deleted file mode 100644 index e821e45..0000000 --- a/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php +++ /dev/null @@ -1,292 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ClassCollectionLoader; - -require_once __DIR__.'/Fixtures/ClassesWithParents/GInterface.php'; -require_once __DIR__.'/Fixtures/ClassesWithParents/CInterface.php'; -require_once __DIR__.'/Fixtures/ClassesWithParents/B.php'; -require_once __DIR__.'/Fixtures/ClassesWithParents/A.php'; - -class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase -{ - public function testTraitDependencies() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Requires PHP > 5.4'); - - return; - } - - require_once __DIR__.'/Fixtures/deps/traits.php'; - - $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); - $m = $r->getMethod('getOrderedClasses'); - $m->setAccessible(true); - - $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', array('CTFoo')); - - $this->assertEquals( - array('TD', 'TC', 'TB', 'TA', 'TZ', 'CTFoo'), - array_map(function ($class) { return $class->getName(); }, $ordered) - ); - - $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', array('CTBar')); - - $this->assertEquals( - array('TD', 'TZ', 'TC', 'TB', 'TA', 'CTBar'), - array_map(function ($class) { return $class->getName(); }, $ordered) - ); - } - - /** - * @dataProvider getDifferentOrders - */ - public function testClassReordering(array $classes) - { - $expected = array( - 'ClassesWithParents\\GInterface', - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - ); - - $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); - $m = $r->getMethod('getOrderedClasses'); - $m->setAccessible(true); - - $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes); - - $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered)); - } - - public function getDifferentOrders() - { - return array( - array(array( - 'ClassesWithParents\\A', - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\GInterface', - 'ClassesWithParents\\B', - )), - array(array( - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - 'ClassesWithParents\\CInterface', - )), - array(array( - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - )), - array(array( - 'ClassesWithParents\\A', - )), - ); - } - - /** - * @dataProvider getDifferentOrdersForTraits - */ - public function testClassWithTraitsReordering(array $classes) - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Requires PHP > 5.4'); - - return; - } - - require_once __DIR__.'/Fixtures/ClassesWithParents/ATrait.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/BTrait.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/D.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/E.php'; - - $expected = array( - 'ClassesWithParents\\GInterface', - 'ClassesWithParents\\CInterface', - 'ClassesWithParents\\ATrait', - 'ClassesWithParents\\BTrait', - 'ClassesWithParents\\CTrait', - 'ClassesWithParents\\B', - 'ClassesWithParents\\A', - 'ClassesWithParents\\D', - 'ClassesWithParents\\E', - ); - - $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); - $m = $r->getMethod('getOrderedClasses'); - $m->setAccessible(true); - - $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes); - - $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered)); - } - - public function getDifferentOrdersForTraits() - { - return array( - array(array( - 'ClassesWithParents\\E', - 'ClassesWithParents\\ATrait', - )), - array(array( - 'ClassesWithParents\\E', - )), - ); - } - - public function testFixClassWithTraitsOrdering() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Requires PHP > 5.4'); - - return; - } - - require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/F.php'; - require_once __DIR__.'/Fixtures/ClassesWithParents/G.php'; - - $classes = array( - 'ClassesWithParents\\F', - 'ClassesWithParents\\G', - ); - - $expected = array( - 'ClassesWithParents\\CTrait', - 'ClassesWithParents\\F', - 'ClassesWithParents\\G', - ); - - $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); - $m = $r->getMethod('getOrderedClasses'); - $m->setAccessible(true); - - $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes); - - $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered)); - } - - /** - * @dataProvider getFixNamespaceDeclarationsData - */ - public function testFixNamespaceDeclarations($source, $expected) - { - $this->assertEquals('assertEquals('assertEquals(<< - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ClassLoader; - -class ClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - public function testGetPrefixes() - { - $loader = new ClassLoader(); - $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $prefixes = $loader->getPrefixes(); - $this->assertArrayHasKey('Foo', $prefixes); - $this->assertArrayNotHasKey('Foo1', $prefixes); - $this->assertArrayHasKey('Bar', $prefixes); - $this->assertArrayHasKey('Bas', $prefixes); - } - - public function testGetFallbackDirs() - { - $loader = new ClassLoader(); - $loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $fallback_dirs = $loader->getFallbackDirs(); - $this->assertCount(2, $fallback_dirs); - } - - /** - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className, $testClassName, $message) - { - $loader = new ClassLoader(); - $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassTests() - { - return array( - array('\\Namespaced2\\Foo', 'Namespaced2\\Foo', '->loadClass() loads Namespaced2\Foo class'), - array('\\Pearlike2_Foo', 'Pearlike2_Foo', '->loadClass() loads Pearlike2_Foo class'), - ); - } - - /** - * @dataProvider getLoadNonexistentClassTests - */ - public function testLoadNonexistentClass($className, $testClassName, $message) - { - $loader = new ClassLoader(); - $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->loadClass($testClassName); - $this->assertFalse(class_exists($className), $message); - } - - public function getLoadNonexistentClassTests() - { - return array( - array('\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non existing Pearlike3_Bar class with a leading slash'), - ); - } - - public function testAddPrefix() - { - $loader = new ClassLoader(); - $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $prefixes = $loader->getPrefixes(); - $this->assertArrayHasKey('Foo', $prefixes); - $this->assertCount(2, $prefixes['Foo']); - } - - public function testUseIncludePath() - { - $loader = new ClassLoader(); - $this->assertFalse($loader->getUseIncludePath()); - - $this->assertNull($loader->findFile('Foo')); - - $includePath = get_include_path(); - - $loader->setUseIncludePath(true); - $this->assertTrue($loader->getUseIncludePath()); - - set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath); - - $this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo')); - - set_include_path($includePath); - } - - /** - * @dataProvider getLoadClassFromFallbackTests - */ - public function testLoadClassFromFallback($className, $testClassName, $message) - { - $loader = new ClassLoader(); - $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback')); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassFromFallbackTests() - { - return array( - array('\\Namespaced2\\Baz', 'Namespaced2\\Baz', '->loadClass() loads Namespaced2\Baz class'), - array('\\Pearlike2_Baz', 'Pearlike2_Baz', '->loadClass() loads Pearlike2_Baz class'), - array('\\Namespaced2\\FooBar', 'Namespaced2\\FooBar', '->loadClass() loads Namespaced2\Baz class from fallback dir'), - array('\\Pearlike2_FooBar', 'Pearlike2_FooBar', '->loadClass() loads Pearlike2_Baz class from fallback dir'), - ); - } - - /** - * @dataProvider getLoadClassNamespaceCollisionTests - */ - public function testLoadClassNamespaceCollision($namespaces, $className, $message) - { - $loader = new ClassLoader(); - $loader->addPrefixes($namespaces); - - $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassNamespaceCollisionTests() - { - return array( - array( - array( - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\C\Foo', - '->loadClass() loads NamespaceCollision\C\Foo from alpha.', - ), - array( - array( - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\C\Bar', - '->loadClass() loads NamespaceCollision\C\Bar from alpha.', - ), - array( - array( - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\C\B\Foo', - '->loadClass() loads NamespaceCollision\C\B\Foo from beta.', - ), - array( - array( - 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\C\B\Bar', - '->loadClass() loads NamespaceCollision\C\B\Bar from beta.', - ), - array( - array( - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_C_Foo', - '->loadClass() loads PrefixCollision_C_Foo from alpha.', - ), - array( - array( - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_C_Bar', - '->loadClass() loads PrefixCollision_C_Bar from alpha.', - ), - array( - array( - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_C_B_Foo', - '->loadClass() loads PrefixCollision_C_B_Foo from beta.', - ), - array( - array( - 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_C_B_Bar', - '->loadClass() loads PrefixCollision_C_B_Bar from beta.', - ), - ); - } -} diff --git a/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php b/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php deleted file mode 100644 index 7bdf5aa..0000000 --- a/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ClassMapGenerator; - -class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var string|null - */ - private $workspace = null; - - public function prepare_workspace() - { - $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000); - mkdir($this->workspace, 0777, true); - $this->workspace = realpath($this->workspace); - } - - /** - * @param string $file - */ - private function clean($file) - { - if (is_dir($file) && !is_link($file)) { - $dir = new \FilesystemIterator($file); - foreach ($dir as $childFile) { - $this->clean($childFile); - } - - rmdir($file); - } else { - unlink($file); - } - } - - /** - * @dataProvider getTestCreateMapTests - */ - public function testDump($directory) - { - $this->prepare_workspace(); - - $file = $this->workspace.'/file'; - - $generator = new ClassMapGenerator(); - $generator->dump($directory, $file); - $this->assertFileExists($file); - - $this->clean($this->workspace); - } - - /** - * @dataProvider getTestCreateMapTests - */ - public function testCreateMap($directory, $expected) - { - $this->assertEqualsNormalized($expected, ClassMapGenerator::createMap($directory)); - } - - public function getTestCreateMapTests() - { - $data = array( - array(__DIR__.'/Fixtures/Namespaced', array( - 'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php', - 'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php', - 'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php', - 'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php', - ), - ), - array(__DIR__.'/Fixtures/beta/NamespaceCollision', array( - 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php', - 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php', - 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php', - 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php', - )), - array(__DIR__.'/Fixtures/Pearlike', array( - 'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php', - 'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php', - 'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php', - 'Pearlike_WithComments' => realpath(__DIR__).'/Fixtures/Pearlike/WithComments.php', - )), - array(__DIR__.'/Fixtures/classmap', array( - 'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php', - 'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php', - 'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php', - 'ClassMap\\SomeInterface' => realpath(__DIR__).'/Fixtures/classmap/SomeInterface.php', - 'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php', - 'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php', - )), - ); - - if (PHP_VERSION_ID >= 50400) { - $data[] = array(__DIR__.'/Fixtures/php5.4', array( - 'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php', - 'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php', - 'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php', - )); - } - - if (PHP_VERSION_ID >= 50500) { - $data[] = array(__DIR__.'/Fixtures/php5.5', array( - 'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php', - )); - } - - return $data; - } - - public function testCreateMapFinderSupport() - { - $finder = new \Symfony\Component\Finder\Finder(); - $finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision'); - - $this->assertEqualsNormalized(array( - 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php', - 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php', - 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php', - 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php', - ), ClassMapGenerator::createMap($finder)); - } - - protected function assertEqualsNormalized($expected, $actual, $message = null) - { - foreach ($expected as $ns => $path) { - $expected[$ns] = str_replace('\\', '/', $path); - } - foreach ($actual as $ns => $path) { - $actual[$ns] = str_replace('\\', '/', $path); - } - $this->assertEquals($expected, $actual, $message); - } -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php deleted file mode 100644 index 4259f14..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php deleted file mode 100644 index 3ddb595..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class Baz -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php deleted file mode 100644 index cf0a4b7..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php deleted file mode 100644 index bbbc815..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class FooBar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php deleted file mode 100644 index e774cb9..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php deleted file mode 100644 index 184a1b1..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php deleted file mode 100644 index 3892f70..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A\B; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php deleted file mode 100644 index 450eeb5..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\NamespaceCollision\A\B; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php deleted file mode 100644 index 96f2f76..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Apc\Namespaced; - -class FooBar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php b/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php deleted file mode 100644 index b0f9425..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php b/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php deleted file mode 100644 index 0b0bbd0..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class Baz -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php deleted file mode 100644 index df5e1f4..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php b/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php deleted file mode 100644 index 361e53d..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class WithComments -{ - /** @Boolean */ - public static $loaded = true; -} - -$string = 'string should not be modified {$string}'; - -$heredoc = (<< - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class Pearlike_WithComments -{ - /** @Boolean */ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php deleted file mode 100644 index 7f5f797..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php +++ /dev/null @@ -1,6 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php deleted file mode 100644 index aee6a08..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php deleted file mode 100644 index c1b8dd6..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A\B; - -class Bar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php deleted file mode 100644 index f5f2d72..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace NamespaceCollision\A\B; - -class Foo -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php deleted file mode 100644 index 4bb03dc..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ClassMap; - -class SomeClass extends SomeParent implements SomeInterface -{ -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php b/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php deleted file mode 100644 index 1fe5e09..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ClassMap; - -interface SomeInterface -{ -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php b/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php deleted file mode 100644 index ce2f9fc..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ClassMap; - -abstract class SomeParent -{ -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php b/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php deleted file mode 100644 index c7cec64..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Foo\Bar; - -class A -{ -} -class B -{ -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php b/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php deleted file mode 100644 index 82b30a6..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Namespaced; - -class FooBar -{ - public static $loaded = true; -} diff --git a/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php b/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php deleted file mode 100644 index 1036d43..0000000 --- a/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php +++ /dev/null @@ -1,8 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\ApcUniversalClassLoader; - -/** - * @group legacy - */ -class LegacyApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - if (!extension_loaded('apc')) { - $this->markTestSkipped('The apc extension is not available.'); - } - - if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) { - $this->markTestSkipped('The apc extension is available, but not enabled.'); - } else { - apc_clear_cache('user'); - } - } - - protected function tearDown() - { - if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) { - apc_clear_cache('user'); - } - } - - public function testConstructor() - { - $loader = new ApcUniversalClassLoader('test.prefix.'); - $loader->registerNamespace('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - - $this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apc_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument'); - } - - /** - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className, $testClassName, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.'); - $loader->registerNamespace('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassTests() - { - return array( - array('\\Apc\\Namespaced\\Foo', 'Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'), - array('Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'), - ); - } - - /** - * @dataProvider getLoadClassFromFallbackTests - */ - public function testLoadClassFromFallback($className, $testClassName, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.fallback'); - $loader->registerNamespace('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback')); - $loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback')); - $loader->loadClass($testClassName); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassFromFallbackTests() - { - return array( - array('\\Apc\\Namespaced\\Baz', 'Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'), - array('Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'), - array('\\Apc\\Namespaced\\FooBar', 'Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'), - array('Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'), - ); - } - - /** - * @dataProvider getLoadClassNamespaceCollisionTests - */ - public function testLoadClassNamespaceCollision($namespaces, $className, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.collision.'); - $loader->registerNamespaces($namespaces); - - $loader->loadClass($className); - - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassNamespaceCollisionTests() - { - return array( - array( - array( - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - ), - 'Apc\NamespaceCollision\A\Foo', - '->loadClass() loads NamespaceCollision\A\Foo from alpha.', - ), - array( - array( - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - ), - 'Apc\NamespaceCollision\A\Bar', - '->loadClass() loads NamespaceCollision\A\Bar from alpha.', - ), - array( - array( - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - ), - 'Apc\NamespaceCollision\A\B\Foo', - '->loadClass() loads NamespaceCollision\A\B\Foo from beta.', - ), - array( - array( - 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta', - 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', - ), - 'Apc\NamespaceCollision\A\B\Bar', - '->loadClass() loads NamespaceCollision\A\B\Bar from beta.', - ), - ); - } - - /** - * @dataProvider getLoadClassPrefixCollisionTests - */ - public function testLoadClassPrefixCollision($prefixes, $className, $message) - { - $loader = new ApcUniversalClassLoader('test.prefix.collision.'); - $loader->registerPrefixes($prefixes); - - $loader->loadClass($className); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassPrefixCollisionTests() - { - return array( - array( - array( - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - ), - 'ApcPrefixCollision_A_Foo', - '->loadClass() loads ApcPrefixCollision_A_Foo from alpha.', - ), - array( - array( - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - ), - 'ApcPrefixCollision_A_Bar', - '->loadClass() loads ApcPrefixCollision_A_Bar from alpha.', - ), - array( - array( - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - ), - 'ApcPrefixCollision_A_B_Foo', - '->loadClass() loads ApcPrefixCollision_A_B_Foo from beta.', - ), - array( - array( - 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc', - 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', - ), - 'ApcPrefixCollision_A_B_Bar', - '->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.', - ), - ); - } -} diff --git a/vendor/symfony/class-loader/Tests/LegacyUniversalClassLoaderTest.php b/vendor/symfony/class-loader/Tests/LegacyUniversalClassLoaderTest.php deleted file mode 100644 index 2588e96..0000000 --- a/vendor/symfony/class-loader/Tests/LegacyUniversalClassLoaderTest.php +++ /dev/null @@ -1,223 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\UniversalClassLoader; - -/** - * @group legacy - */ -class LegacyUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className, $testClassName, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $this->assertTrue($loader->loadClass($testClassName)); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassTests() - { - return array( - array('\\Namespaced\\Foo', 'Namespaced\\Foo', '->loadClass() loads Namespaced\Foo class'), - array('\\Pearlike_Foo', 'Pearlike_Foo', '->loadClass() loads Pearlike_Foo class'), - ); - } - - public function testUseIncludePath() - { - $loader = new UniversalClassLoader(); - $this->assertFalse($loader->getUseIncludePath()); - - $this->assertNull($loader->findFile('Foo')); - - $includePath = get_include_path(); - - $loader->useIncludePath(true); - $this->assertTrue($loader->getUseIncludePath()); - - set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath); - - $this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo')); - - set_include_path($includePath); - } - - public function testGetNamespaces() - { - $loader = new UniversalClassLoader(); - $loader->registerNamespace('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerNamespace('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerNamespace('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $namespaces = $loader->getNamespaces(); - $this->assertArrayHasKey('Foo', $namespaces); - $this->assertArrayNotHasKey('Foo1', $namespaces); - $this->assertArrayHasKey('Bar', $namespaces); - $this->assertArrayHasKey('Bas', $namespaces); - } - - public function testGetPrefixes() - { - $loader = new UniversalClassLoader(); - $loader->registerPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $prefixes = $loader->getPrefixes(); - $this->assertArrayHasKey('Foo', $prefixes); - $this->assertArrayNotHasKey('Foo1', $prefixes); - $this->assertArrayHasKey('Bar', $prefixes); - $this->assertArrayHasKey('Bas', $prefixes); - } - - /** - * @dataProvider getLoadClassFromFallbackTests - */ - public function testLoadClassFromFallback($className, $testClassName, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures'); - $loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback')); - $loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback')); - $this->assertTrue($loader->loadClass($testClassName)); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassFromFallbackTests() - { - return array( - array('\\Namespaced\\Baz', 'Namespaced\\Baz', '->loadClass() loads Namespaced\Baz class'), - array('\\Pearlike_Baz', 'Pearlike_Baz', '->loadClass() loads Pearlike_Baz class'), - array('\\Namespaced\\FooBar', 'Namespaced\\FooBar', '->loadClass() loads Namespaced\Baz class from fallback dir'), - array('\\Pearlike_FooBar', 'Pearlike_FooBar', '->loadClass() loads Pearlike_Baz class from fallback dir'), - ); - } - - public function testRegisterPrefixFallback() - { - $loader = new UniversalClassLoader(); - $loader->registerPrefixFallback(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'); - $this->assertEquals(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'), $loader->getPrefixFallbacks()); - } - - public function testRegisterNamespaceFallback() - { - $loader = new UniversalClassLoader(); - $loader->registerNamespaceFallback(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback'); - $this->assertEquals(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback'), $loader->getNamespaceFallbacks()); - } - - /** - * @dataProvider getLoadClassNamespaceCollisionTests - */ - public function testLoadClassNamespaceCollision($namespaces, $className, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerNamespaces($namespaces); - - $this->assertTrue($loader->loadClass($className)); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassNamespaceCollisionTests() - { - return array( - array( - array( - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\A\Foo', - '->loadClass() loads NamespaceCollision\A\Foo from alpha.', - ), - array( - array( - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\A\Bar', - '->loadClass() loads NamespaceCollision\A\Bar from alpha.', - ), - array( - array( - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'NamespaceCollision\A\B\Foo', - '->loadClass() loads NamespaceCollision\A\B\Foo from beta.', - ), - array( - array( - 'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'NamespaceCollision\A\B\Bar', - '->loadClass() loads NamespaceCollision\A\B\Bar from beta.', - ), - ); - } - - /** - * @dataProvider getLoadClassPrefixCollisionTests - */ - public function testLoadClassPrefixCollision($prefixes, $className, $message) - { - $loader = new UniversalClassLoader(); - $loader->registerPrefixes($prefixes); - - $this->assertTrue($loader->loadClass($className)); - $this->assertTrue(class_exists($className), $message); - } - - public function getLoadClassPrefixCollisionTests() - { - return array( - array( - array( - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_A_Foo', - '->loadClass() loads PrefixCollision_A_Foo from alpha.', - ), - array( - array( - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_A_Bar', - '->loadClass() loads PrefixCollision_A_Bar from alpha.', - ), - array( - array( - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - ), - 'PrefixCollision_A_B_Foo', - '->loadClass() loads PrefixCollision_A_B_Foo from beta.', - ), - array( - array( - 'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta', - 'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha', - ), - 'PrefixCollision_A_B_Bar', - '->loadClass() loads PrefixCollision_A_B_Bar from beta.', - ), - ); - } -} diff --git a/vendor/symfony/class-loader/Tests/Psr4ClassLoaderTest.php b/vendor/symfony/class-loader/Tests/Psr4ClassLoaderTest.php deleted file mode 100644 index 21a7afb..0000000 --- a/vendor/symfony/class-loader/Tests/Psr4ClassLoaderTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\ClassLoader\Tests; - -use Symfony\Component\ClassLoader\Psr4ClassLoader; - -class Psr4ClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @param string $className - * @dataProvider getLoadClassTests - */ - public function testLoadClass($className) - { - $loader = new Psr4ClassLoader(); - $loader->addPrefix( - 'Acme\\DemoLib', - __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4' - ); - $loader->loadClass($className); - $this->assertTrue(class_exists($className), sprintf('loadClass() should load %s', $className)); - } - - /** - * @return array - */ - public function getLoadClassTests() - { - return array( - array('Acme\\DemoLib\\Foo'), - array('Acme\\DemoLib\\Class_With_Underscores'), - array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Foo'), - array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Class_With_Underscores'), - ); - } - - /** - * @param string $className - * @dataProvider getLoadNonexistentClassTests - */ - public function testLoadNonexistentClass($className) - { - $loader = new Psr4ClassLoader(); - $loader->addPrefix( - 'Acme\\DemoLib', - __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4' - ); - $loader->loadClass($className); - $this->assertFalse(class_exists($className), sprintf('loadClass() should not load %s', $className)); - } - - /** - * @return array - */ - public function getLoadNonexistentClassTests() - { - return array( - array('Acme\\DemoLib\\I_Do_Not_Exist'), - array('UnknownVendor\\SomeLib\\I_Do_Not_Exist'), - ); - } -} diff --git a/vendor/symfony/console/Resources/bin/hiddeninput.exe b/vendor/symfony/console/Resources/bin/hiddeninput.exe index 9f4a2aa..c8cf65e 100644 --- a/vendor/symfony/console/Resources/bin/hiddeninput.exe +++ b/vendor/symfony/console/Resources/bin/hiddeninput.exe @@ -1,21 +1,21 @@ -MZ@ !L!This program cannot be run in DOS mode. +MZ@ !L!This program cannot be run in DOS mode. $,;B;B;B2מ:B2-B2ƞ9B2ў?Ba98B;CB2Ȟ:B2֞:B2Ӟ:BRich;BPELMoO  8 @`?@"P@ Pp!8!@ .text   `.rdata @@.data0@.rsrc @@@.relocP"@Bj$@xj @eEPV @EЃPV @MX @eEP5H @L @YY5\ @EP5` @D @YYP @MMT @3H; 0@uh@l3@$40@5h3@40@h$0@h(0@h 0@ @00@}jYjh"@3ۉ]dp]俀3@SVW0 @;t;u3Fuh4 @3F|3@;u j\Y;|3@u,5|3@h @h @YYtE5<0@|3@;uh @h @lYY|3@9]uSW8 @93@th3@Yt SjS3@$0@ @5$0@5(0@5 0@ 80@9,0@u7P @E MPQYYËeE80@39,0@uPh @9<0@u @E80@øMZf9@t3M<@@8PEuH t uՃv39xtv39j,0@p @jl @YY3@3@ @ t3@ @ p3@ @x3@V=0@u h@ @Yg=0@u j @Y3{U(H1@ D1@@1@<1@581@=41@f`1@f T1@f01@f,1@f%(1@f-$1@X1@EL1@EP1@E\1@0@P1@L0@@0@ D0@0@0@ @0@j?Yj @h!@$ @=0@ujYh ( @P, @ËUE8csmu*xu$@= t=!t="t=@u3]hH@ @3% @jh("@b53@5 @YEu u @YgjYe53@։E53@YYEEPEPu5l @YPUEu֣3@uփ3@E EjYËUuNYH]ËV!@!@W;stЃ;r_^ËV"@"@W;stЃ;r_^% @̋UMMZf9t3]ËA<8PEu3ҹ f9H‹]̋UEH<ASVq3WDv} H ;r X;r -B(;r3_^[]̋UjhH"@he@dPSVW0@1E3PEdeEh@*tUE-@Ph@Pt;@$ЃEMd Y_^[]ËE3=‹ËeE3Md Y_^[]% @% @he@d5D$l$l$+SVW0@1E3PeuEEEEdËMd Y__^[]QËUuuu uh@h0@]ËVhh3V t VVVVV^3ËU0@eeSWN@;t t У0@`VEP< @u3u @3 @3 @3EP @E3E3;uO@ u 50@։50@^_[%t @%x @%| @% @% @% @% @% @% @Pd5D$ +d$ SVW(0@3PEuEEdËMd Y__^[]QËM3M%T @T$B J3J3l"@s###)r)b)H)4))(((((()#$%%&d&&$('''''(((6('H(Z(t(('''''l'^'R'F'>'>(0'')@W@@MoOl!@0@0@bad allocationH0@!@RSDSьJ!LZc:\users\seld\documents\visual studio 2010\Projects\hiddeninp\Release\hiddeninp.pdbe@@:@@@@"d"@"# $#&D H#(h ###)r)b)H)4))(((((()#$%%&d&&$('''''(((6('H(Z(t(('''''l'^'R'F'>'>(0'')GetConsoleModeSetConsoleMode;GetStdHandleKERNEL32.dll??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@AJ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ{??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@ZMSVCP90.dll_amsg_exit__getmainargs,_cexit|_exitf_XcptFilterexit__initenv_initterm_initterm_e<_configthreadlocale__setusermatherr _adjust_fdiv__p__commode__p__fmodej_encode_pointer__set_app_typeK_crt_debugger_hookC?terminate@@YAXXZMSVCR90.dll_unlock__dllonexitv_lock_onexit`_decode_pointers_except_handler4_common _invoke_watson?_controlfp_sInterlockedExchange!SleepInterlockedCompareExchange-TerminateProcessGetCurrentProcess>UnhandledExceptionFilterSetUnhandledExceptionFilterIsDebuggerPresentTQueryPerformanceCounterfGetTickCountGetCurrentThreadIdGetCurrentProcessIdOGetSystemTimeAsFileTimes__CxxFrameHandler3N@D$!@ 8Ph  @(CV(4VS_VERSION_INFOStringFileInfob040904b0QFileDescriptionReads from stdin without leaking info to the terminal and outputs back to stdout6 FileVersion1, 0, 0, 08 InternalNamehiddeninputPLegalCopyrightJordi Boggiano - 2012HOriginalFilenamehiddeninput.exe: ProductNameHidden Input: ProductVersion1, 0, 0, 0DVarFileInfo$Translation  - - - - - - - - - - - - +B(;r3_^[]̋UjhH"@he@dPSVW0@1E3PEdeEh@*tUE-@Ph@Pt;@$ЃEMd Y_^[]ËE3=‹ËeE3Md Y_^[]% @% @he@d5D$l$l$+SVW0@1E3PeuEEEEdËMd Y__^[]QËUuuu uh@h0@]ËVhh3V t VVVVV^3ËU0@eeSWN@;t t У0@`VEP< @u3u @3 @3 @3EP @E3E3;uO@ u 50@։50@^_[%t @%x @%| @% @% @% @% @% @% @Pd5D$ +d$ SVW(0@3PEuEEdËMd Y__^[]QËM3M%T @T$B J3J3l"@s###)r)b)H)4))(((((()#$%%&d&&$('''''(((6('H(Z(t(('''''l'^'R'F'>'>(0'')@W@@MoOl!@0@0@bad allocationH0@!@RSDSьJ!LZc:\users\seld\documents\visual studio 2010\Projects\hiddeninp\Release\hiddeninp.pdbe@@:@@@@"d"@"# $#&D H#(h ###)r)b)H)4))(((((()#$%%&d&&$('''''(((6('H(Z(t(('''''l'^'R'F'>'>(0'')GetConsoleModeSetConsoleMode;GetStdHandleKERNEL32.dll??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@AJ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ{??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@ZMSVCP90.dll_amsg_exit__getmainargs,_cexit|_exitf_XcptFilterexit__initenv_initterm_initterm_e<_configthreadlocale__setusermatherr _adjust_fdiv__p__commode__p__fmodej_encode_pointer__set_app_typeK_crt_debugger_hookC?terminate@@YAXXZMSVCR90.dll_unlock__dllonexitv_lock_onexit`_decode_pointers_except_handler4_common _invoke_watson?_controlfp_sInterlockedExchange!SleepInterlockedCompareExchange-TerminateProcessGetCurrentProcess>UnhandledExceptionFilterSetUnhandledExceptionFilterIsDebuggerPresentTQueryPerformanceCounterfGetTickCountGetCurrentThreadIdGetCurrentProcessIdOGetSystemTimeAsFileTimes__CxxFrameHandler3N@D$!@ 8Ph  @(CV(4VS_VERSION_INFOStringFileInfob040904b0QFileDescriptionReads from stdin without leaking info to the terminal and outputs back to stdout6 FileVersion1, 0, 0, 08 InternalNamehiddeninputPLegalCopyrightJordi Boggiano - 2012HOriginalFilenamehiddeninput.exe: ProductNameHidden Input: ProductVersion1, 0, 0, 0DVarFileInfo$Translation  + + + + + + + + + + + + PAPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDING@00!0/080F0L0T0^0d0n0{000000000000001#1-1@1J1O1T1v1{1111111111111112"2*23292A2M2_2j2p222222222222 333%303N3T3Z3`3f3l3s3z333333333333333334444%4;4B444444444445!5^5c5555H6M6_6}66677 7*7w7|777778 88=8E8P8V8\8b8h8n8t8z88889 $0001 1t1x12 2@2\2`2h2t20 0 \ No newline at end of file diff --git a/vendor/symfony/console/Tests/ApplicationTest.php b/vendor/symfony/console/Tests/ApplicationTest.php deleted file mode 100644 index d33e584..0000000 --- a/vendor/symfony/console/Tests/ApplicationTest.php +++ /dev/null @@ -1,1060 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Tester\ApplicationTester; -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleExceptionEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\EventDispatcher\EventDispatcher; - -class ApplicationTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/Fixtures/'); - require_once self::$fixturesPath.'/FooCommand.php'; - require_once self::$fixturesPath.'/Foo1Command.php'; - require_once self::$fixturesPath.'/Foo2Command.php'; - require_once self::$fixturesPath.'/Foo3Command.php'; - require_once self::$fixturesPath.'/Foo4Command.php'; - require_once self::$fixturesPath.'/Foo5Command.php'; - require_once self::$fixturesPath.'/FoobarCommand.php'; - require_once self::$fixturesPath.'/BarBucCommand.php'; - require_once self::$fixturesPath.'/FooSubnamespaced1Command.php'; - require_once self::$fixturesPath.'/FooSubnamespaced2Command.php'; - } - - protected function normalizeLineBreaks($text) - { - return str_replace(PHP_EOL, "\n", $text); - } - - /** - * Replaces the dynamic placeholders of the command help text with a static version. - * The placeholder %command.full_name% includes the script path that is not predictable - * and can not be tested against. - */ - protected function ensureStaticCommandHelp(Application $application) - { - foreach ($application->all() as $command) { - $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp())); - } - } - - public function testConstructor() - { - $application = new Application('foo', 'bar'); - $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument'); - $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument'); - $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default'); - } - - public function testSetGetName() - { - $application = new Application(); - $application->setName('foo'); - $this->assertEquals('foo', $application->getName(), '->setName() sets the name of the application'); - } - - public function testSetGetVersion() - { - $application = new Application(); - $application->setVersion('bar'); - $this->assertEquals('bar', $application->getVersion(), '->setVersion() sets the version of the application'); - } - - public function testGetLongVersion() - { - $application = new Application('foo', 'bar'); - $this->assertEquals('foo version bar', $application->getLongVersion(), '->getLongVersion() returns the long version of the application'); - } - - public function testHelp() - { - $application = new Application(); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $this->normalizeLineBreaks($application->getHelp()), '->getHelp() returns a help message'); - } - - public function testAll() - { - $application = new Application(); - $commands = $application->all(); - $this->assertInstanceOf('Symfony\\Component\\Console\\Command\\HelpCommand', $commands['help'], '->all() returns the registered commands'); - - $application->add(new \FooCommand()); - $commands = $application->all('foo'); - $this->assertCount(1, $commands, '->all() takes a namespace as its first argument'); - } - - public function testRegister() - { - $application = new Application(); - $command = $application->register('foo'); - $this->assertEquals('foo', $command->getName(), '->register() registers a new command'); - } - - public function testAdd() - { - $application = new Application(); - $application->add($foo = new \FooCommand()); - $commands = $application->all(); - $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command'); - - $application = new Application(); - $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command())); - $commands = $application->all(); - $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Command class "Foo5Command" is not correctly initialized. You probably forgot to call the parent constructor. - */ - public function testAddCommandWithEmptyConstructor() - { - $application = new Application(); - $application->add(new \Foo5Command()); - } - - public function testHasGet() - { - $application = new Application(); - $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered'); - $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered'); - - $application->add($foo = new \FooCommand()); - $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered'); - $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name'); - $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias'); - - $application = new Application(); - $application->add($foo = new \FooCommand()); - // simulate --help - $r = new \ReflectionObject($application); - $p = $r->getProperty('wantHelps'); - $p->setAccessible(true); - $p->setValue($application, true); - $command = $application->get('foo:bar'); - $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $command, '->get() returns the help command if --help is provided as the input'); - } - - public function testSilentHelp() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $tester = new ApplicationTester($application); - $tester->run(array('-h' => true, '-q' => true), array('decorated' => false)); - - $this->assertEmpty($tester->getDisplay(true)); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The command "foofoo" does not exist. - */ - public function testGetInvalidCommand() - { - $application = new Application(); - $application->get('foofoo'); - } - - public function testGetNamespaces() - { - $application = new Application(); - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces'); - } - - public function testFindNamespace() - { - $application = new Application(); - $application->add(new \FooCommand()); - $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); - $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation'); - $application->add(new \Foo2Command()); - $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists'); - } - - public function testFindNamespaceWithSubnamespaces() - { - $application = new Application(); - $application->add(new \FooSubnamespaced1Command()); - $application->add(new \FooSubnamespaced2Command()); - $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns commands even if the commands are only contained in subnamespaces'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The namespace "f" is ambiguous (foo, foo1). - */ - public function testFindAmbiguousNamespace() - { - $application = new Application(); - $application->add(new \BarBucCommand()); - $application->add(new \FooCommand()); - $application->add(new \Foo2Command()); - $application->findNamespace('f'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage There are no commands defined in the "bar" namespace. - */ - public function testFindInvalidNamespace() - { - $application = new Application(); - $application->findNamespace('bar'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Command "foo1" is not defined - */ - public function testFindUniqueNameButNamespaceName() - { - $application = new Application(); - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - - $application->find($commandName = 'foo1'); - } - - public function testFind() - { - $application = new Application(); - $application->add(new \FooCommand()); - - $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists'); - $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists'); - $this->assertInstanceOf('FooCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists'); - $this->assertInstanceOf('FooCommand', $application->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist'); - $this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias'); - } - - /** - * @dataProvider provideAmbiguousAbbreviations - */ - public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExceptionMessage) - { - $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage); - - $application = new Application(); - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - - $application->find($abbreviation); - } - - public function provideAmbiguousAbbreviations() - { - return array( - array('f', 'Command "f" is not defined.'), - array('a', 'Command "a" is ambiguous (afoobar, afoobar1 and 1 more).'), - array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1 and 1 more).'), - ); - } - - public function testFindCommandEqualNamespace() - { - $application = new Application(); - $application->add(new \Foo3Command()); - $application->add(new \Foo4Command()); - - $this->assertInstanceOf('Foo3Command', $application->find('foo3:bar'), '->find() returns the good command even if a namespace has same name'); - $this->assertInstanceOf('Foo4Command', $application->find('foo3:bar:toh'), '->find() returns a command even if its namespace equals another command name'); - } - - public function testFindCommandWithAmbiguousNamespacesButUniqueName() - { - $application = new Application(); - $application->add(new \FooCommand()); - $application->add(new \FoobarCommand()); - - $this->assertInstanceOf('FoobarCommand', $application->find('f:f')); - } - - public function testFindCommandWithMissingNamespace() - { - $application = new Application(); - $application->add(new \Foo4Command()); - - $this->assertInstanceOf('Foo4Command', $application->find('f::t')); - } - - /** - * @dataProvider provideInvalidCommandNamesSingle - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Did you mean this - */ - public function testFindAlternativeExceptionMessageSingle($name) - { - $application = new Application(); - $application->add(new \Foo3Command()); - $application->find($name); - } - - public function provideInvalidCommandNamesSingle() - { - return array( - array('foo3:baR'), - array('foO3:bar'), - ); - } - - public function testFindAlternativeExceptionMessageMultiple() - { - $application = new Application(); - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - - // Command + plural - try { - $application->find('foo:baR'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/foo1:bar/', $e->getMessage()); - $this->assertRegExp('/foo:bar/', $e->getMessage()); - } - - // Namespace + plural - try { - $application->find('foo2:bar'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/foo1/', $e->getMessage()); - } - - $application->add(new \Foo3Command()); - $application->add(new \Foo4Command()); - - // Subnamespace + plural - try { - $a = $application->find('foo3:'); - $this->fail('->find() should throw an \InvalidArgumentException if a command is ambiguous because of a subnamespace, with alternatives'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e); - $this->assertRegExp('/foo3:bar/', $e->getMessage()); - $this->assertRegExp('/foo3:bar:toh/', $e->getMessage()); - } - } - - public function testFindAlternativeCommands() - { - $application = new Application(); - - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - - try { - $application->find($commandName = 'Unknown command'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist'); - $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without alternatives'); - } - - // Test if "bar1" command throw an "\InvalidArgumentException" and does not contain - // "foo:bar" as alternative because "bar1" is too far from "foo:bar" - try { - $application->find($commandName = 'bar1'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist'); - $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "afoobar1"'); - $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar1"'); - $this->assertNotRegExp('/foo:bar(?>!1)/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without "foo:bar" alternative'); - } - } - - public function testFindAlternativeCommandsWithAnAlias() - { - $fooCommand = new \FooCommand(); - $fooCommand->setAliases(array('foo2')); - - $application = new Application(); - $application->add($fooCommand); - - $result = $application->find('foo'); - - $this->assertSame($fooCommand, $result); - } - - public function testFindAlternativeNamespace() - { - $application = new Application(); - - $application->add(new \FooCommand()); - $application->add(new \Foo1Command()); - $application->add(new \Foo2Command()); - $application->add(new \foo3Command()); - - try { - $application->find('Unknown-namespace:Unknown-command'); - $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist'); - $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives'); - } - - try { - $application->find('foo2:command'); - $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist'); - $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative'); - $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo"'); - $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo1"'); - $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo3"'); - } - } - - public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces() - { - $application = $this->getMock('Symfony\Component\Console\Application', array('getNamespaces')); - $application->expects($this->once()) - ->method('getNamespaces') - ->will($this->returnValue(array('foo:sublong', 'bar:sub'))); - - $this->assertEquals('foo:sublong', $application->findNamespace('f:sub')); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Command "foo::bar" is not defined. - */ - public function testFindWithDoubleColonInNameThrowsException() - { - $application = new Application(); - $application->add(new \FooCommand()); - $application->add(new \Foo4Command()); - $application->find('foo::bar'); - } - - public function testSetCatchExceptions() - { - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(120)); - $tester = new ApplicationTester($application); - - $application->setCatchExceptions(true); - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->setCatchExceptions() sets the catch exception flag'); - - $application->setCatchExceptions(false); - try { - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->fail('->setCatchExceptions() sets the catch exception flag'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag'); - $this->assertEquals('Command "foo" is not defined.', $e->getMessage(), '->setCatchExceptions() sets the catch exception flag'); - } - } - - /** - * @group legacy - */ - public function testLegacyAsText() - { - $application = new Application(); - $application->add(new \FooCommand()); - $this->ensureStaticCommandHelp($application); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $this->normalizeLineBreaks($application->asText()), '->asText() returns a text representation of the application'); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application'); - } - - /** - * @group legacy - */ - public function testLegacyAsXml() - { - $application = new Application(); - $application->add(new \FooCommand()); - $this->ensureStaticCommandHelp($application); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml() returns an XML representation of the application'); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml() returns an XML representation of the application'); - } - - public function testRenderException() - { - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(120)); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->renderException() renders a pretty exception'); - - $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); - $this->assertContains('Exception trace', $tester->getDisplay(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose'); - - $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getDisplay(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command'); - - $application->add(new \Foo3Command()); - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo3:bar'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); - - $tester->run(array('command' => 'foo3:bar'), array('decorated' => true)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); - - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(32)); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal'); - } - - public function testRenderExceptionWithDoubleWidthCharacters() - { - if (!function_exists('mb_strwidth')) { - $this->markTestSkipped('The "mb_strwidth" function is not available'); - } - - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(120)); - $application->register('foo')->setCode(function () { - throw new \Exception('エラーメッセージ'); - }); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); - - $tester->run(array('command' => 'foo'), array('decorated' => true)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); - - $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(32)); - $application->register('foo')->setCode(function () { - throw new \Exception('コマンドの実行中にエラーが発生しました。'); - }); - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal'); - } - - public function testRun() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - $application->add($command = new \Foo1Command()); - $_SERVER['argv'] = array('cli.php', 'foo:bar1'); - - ob_start(); - $application->run(); - ob_end_clean(); - - $this->assertInstanceOf('Symfony\Component\Console\Input\ArgvInput', $command->input, '->run() creates an ArgvInput by default if none is given'); - $this->assertInstanceOf('Symfony\Component\Console\Output\ConsoleOutput', $command->output, '->run() creates a ConsoleOutput by default if none is given'); - - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $this->ensureStaticCommandHelp($application); - $tester = new ApplicationTester($application); - - $tester->run(array(), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $tester->getDisplay(true), '->run() runs the list command if no argument is passed'); - - $tester->run(array('--help' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if --help is passed'); - - $tester->run(array('-h' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if -h is passed'); - - $tester->run(array('command' => 'list', '--help' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if --help is passed'); - - $tester->run(array('command' => 'list', '-h' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if -h is passed'); - - $tester->run(array('--ansi' => true)); - $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed'); - - $tester->run(array('--no-ansi' => true)); - $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed'); - - $tester->run(array('--version' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if --version is passed'); - - $tester->run(array('-V' => true), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if -v is passed'); - - $tester->run(array('command' => 'list', '--quiet' => true)); - $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed'); - - $tester->run(array('command' => 'list', '-q' => true)); - $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed'); - - $tester->run(array('command' => 'list', '--verbose' => true)); - $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed'); - - $tester->run(array('command' => 'list', '--verbose' => 1)); - $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose=1 is passed'); - - $tester->run(array('command' => 'list', '--verbose' => 2)); - $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to very verbose if --verbose=2 is passed'); - - $tester->run(array('command' => 'list', '--verbose' => 3)); - $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to debug if --verbose=3 is passed'); - - $tester->run(array('command' => 'list', '--verbose' => 4)); - $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if unknown --verbose level is passed'); - - $tester->run(array('command' => 'list', '-v' => true)); - $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); - - $tester->run(array('command' => 'list', '-vv' => true)); - $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); - - $tester->run(array('command' => 'list', '-vvv' => true)); - $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed'); - - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - $application->add(new \FooCommand()); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false)); - $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed'); - - $tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false)); - $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed'); - } - - /** - * Issue #9285. - * - * If the "verbose" option is just before an argument in ArgvInput, - * an argument value should not be treated as verbosity value. - * This test will fail with "Not enough arguments." if broken - */ - public function testVerboseValueNotBreakArguments() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - $application->add(new \FooCommand()); - - $output = new StreamOutput(fopen('php://memory', 'w', false)); - - $input = new ArgvInput(array('cli.php', '-v', 'foo:bar')); - $application->run($input, $output); - - $input = new ArgvInput(array('cli.php', '--verbose', 'foo:bar')); - $application->run($input, $output); - } - - public function testRunReturnsIntegerExitCode() - { - $exception = new \Exception('', 4); - - $application = $this->getMock('Symfony\Component\Console\Application', array('doRun')); - $application->setAutoExit(false); - $application->expects($this->once()) - ->method('doRun') - ->will($this->throwException($exception)); - - $exitCode = $application->run(new ArrayInput(array()), new NullOutput()); - - $this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception'); - } - - public function testRunReturnsExitCodeOneForExceptionCodeZero() - { - $exception = new \Exception('', 0); - - $application = $this->getMock('Symfony\Component\Console\Application', array('doRun')); - $application->setAutoExit(false); - $application->expects($this->once()) - ->method('doRun') - ->will($this->throwException($exception)); - - $exitCode = $application->run(new ArrayInput(array()), new NullOutput()); - - $this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0'); - } - - /** - * @expectedException \LogicException - * @dataProvider getAddingAlreadySetDefinitionElementData - */ - public function testAddingAlreadySetDefinitionElementData($def) - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - $application - ->register('foo') - ->setDefinition(array($def)) - ->setCode(function (InputInterface $input, OutputInterface $output) {}) - ; - - $input = new ArrayInput(array('command' => 'foo')); - $output = new NullOutput(); - $application->run($input, $output); - } - - public function getAddingAlreadySetDefinitionElementData() - { - return array( - array(new InputArgument('command', InputArgument::REQUIRED)), - array(new InputOption('quiet', '', InputOption::VALUE_NONE)), - array(new InputOption('query', 'q', InputOption::VALUE_NONE)), - ); - } - - public function testGetDefaultHelperSetReturnsDefaultValues() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $helperSet = $application->getHelperSet(); - - $this->assertTrue($helperSet->has('formatter')); - $this->assertTrue($helperSet->has('dialog')); - $this->assertTrue($helperSet->has('progress')); - } - - public function testAddingSingleHelperSetOverwritesDefaultValues() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $application->setHelperSet(new HelperSet(array(new FormatterHelper()))); - - $helperSet = $application->getHelperSet(); - - $this->assertTrue($helperSet->has('formatter')); - - // no other default helper set should be returned - $this->assertFalse($helperSet->has('dialog')); - $this->assertFalse($helperSet->has('progress')); - } - - public function testOverwritingDefaultHelperSetOverwritesDefaultValues() - { - $application = new CustomApplication(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $application->setHelperSet(new HelperSet(array(new FormatterHelper()))); - - $helperSet = $application->getHelperSet(); - - $this->assertTrue($helperSet->has('formatter')); - - // no other default helper set should be returned - $this->assertFalse($helperSet->has('dialog')); - $this->assertFalse($helperSet->has('progress')); - } - - public function testGetDefaultInputDefinitionReturnsDefaultValues() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $inputDefinition = $application->getDefinition(); - - $this->assertTrue($inputDefinition->hasArgument('command')); - - $this->assertTrue($inputDefinition->hasOption('help')); - $this->assertTrue($inputDefinition->hasOption('quiet')); - $this->assertTrue($inputDefinition->hasOption('verbose')); - $this->assertTrue($inputDefinition->hasOption('version')); - $this->assertTrue($inputDefinition->hasOption('ansi')); - $this->assertTrue($inputDefinition->hasOption('no-ansi')); - $this->assertTrue($inputDefinition->hasOption('no-interaction')); - } - - public function testOverwritingDefaultInputDefinitionOverwritesDefaultValues() - { - $application = new CustomApplication(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $inputDefinition = $application->getDefinition(); - - // check whether the default arguments and options are not returned any more - $this->assertFalse($inputDefinition->hasArgument('command')); - - $this->assertFalse($inputDefinition->hasOption('help')); - $this->assertFalse($inputDefinition->hasOption('quiet')); - $this->assertFalse($inputDefinition->hasOption('verbose')); - $this->assertFalse($inputDefinition->hasOption('version')); - $this->assertFalse($inputDefinition->hasOption('ansi')); - $this->assertFalse($inputDefinition->hasOption('no-ansi')); - $this->assertFalse($inputDefinition->hasOption('no-interaction')); - - $this->assertTrue($inputDefinition->hasOption('custom')); - } - - public function testSettingCustomInputDefinitionOverwritesDefaultValues() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $application->setDefinition(new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')))); - - $inputDefinition = $application->getDefinition(); - - // check whether the default arguments and options are not returned any more - $this->assertFalse($inputDefinition->hasArgument('command')); - - $this->assertFalse($inputDefinition->hasOption('help')); - $this->assertFalse($inputDefinition->hasOption('quiet')); - $this->assertFalse($inputDefinition->hasOption('verbose')); - $this->assertFalse($inputDefinition->hasOption('version')); - $this->assertFalse($inputDefinition->hasOption('ansi')); - $this->assertFalse($inputDefinition->hasOption('no-ansi')); - $this->assertFalse($inputDefinition->hasOption('no-interaction')); - - $this->assertTrue($inputDefinition->hasOption('custom')); - } - - public function testRunWithDispatcher() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setDispatcher($this->getDispatcher()); - - $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { - $output->write('foo.'); - }); - - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); - $this->assertEquals('before.foo.after.'.PHP_EOL, $tester->getDisplay()); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage caught - */ - public function testRunWithExceptionAndDispatcher() - { - $application = new Application(); - $application->setDispatcher($this->getDispatcher()); - $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { - throw new \RuntimeException('foo'); - }); - - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); - } - - public function testRunDispatchesAllEventsWithException() - { - $application = new Application(); - $application->setDispatcher($this->getDispatcher()); - $application->setAutoExit(false); - - $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { - $output->write('foo.'); - - throw new \RuntimeException('foo'); - }); - - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); - $this->assertContains('before.foo.caught.after.', $tester->getDisplay()); - } - - public function testRunWithDispatcherSkippingCommand() - { - $application = new Application(); - $application->setDispatcher($this->getDispatcher(true)); - $application->setAutoExit(false); - - $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { - $output->write('foo.'); - }); - - $tester = new ApplicationTester($application); - $exitCode = $tester->run(array('command' => 'foo')); - $this->assertContains('before.after.', $tester->getDisplay()); - $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode); - } - - public function testTerminalDimensions() - { - $application = new Application(); - $originalDimensions = $application->getTerminalDimensions(); - $this->assertCount(2, $originalDimensions); - - $width = 80; - if ($originalDimensions[0] == $width) { - $width = 100; - } - - $application->setTerminalDimensions($width, 80); - $this->assertSame(array($width, 80), $application->getTerminalDimensions()); - } - - protected function getDispatcher($skipCommand = false) - { - $dispatcher = new EventDispatcher(); - $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use ($skipCommand) { - $event->getOutput()->write('before.'); - - if ($skipCommand) { - $event->disableCommand(); - } - }); - $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) { - $event->getOutput()->writeln('after.'); - - if (!$skipCommand) { - $event->setExitCode(113); - } - }); - $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) { - $event->getOutput()->write('caught.'); - - $event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException())); - }); - - return $dispatcher; - } - - public function testSetRunCustomDefaultCommand() - { - $command = new \FooCommand(); - - $application = new Application(); - $application->setAutoExit(false); - $application->add($command); - $application->setDefaultCommand($command->getName()); - - $tester = new ApplicationTester($application); - $tester->run(array()); - $this->assertEquals('interact called'.PHP_EOL.'called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); - - $application = new CustomDefaultCommandApplication(); - $application->setAutoExit(false); - - $tester = new ApplicationTester($application); - $tester->run(array()); - - $this->assertEquals('interact called'.PHP_EOL.'called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); - } - - public function testCanCheckIfTerminalIsInteractive() - { - if (!function_exists('posix_isatty')) { - $this->markTestSkipped('posix_isatty function is required'); - } - - $application = new CustomDefaultCommandApplication(); - $application->setAutoExit(false); - - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'help')); - - $this->assertFalse($tester->getInput()->hasParameterOption(array('--no-interaction', '-n'))); - - $inputStream = $application->getHelperSet()->get('question')->getInputStream(); - $this->assertEquals($tester->getInput()->isInteractive(), @posix_isatty($inputStream)); - } -} - -class CustomApplication extends Application -{ - /** - * Overwrites the default input definition. - * - * @return InputDefinition An InputDefinition instance - */ - protected function getDefaultInputDefinition() - { - return new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.'))); - } - - /** - * Gets the default helper set with the helpers that should always be available. - * - * @return HelperSet A HelperSet instance - */ - protected function getDefaultHelperSet() - { - return new HelperSet(array(new FormatterHelper())); - } -} - -class CustomDefaultCommandApplication extends Application -{ - /** - * Overwrites the constructor in order to set a different default command. - */ - public function __construct() - { - parent::__construct(); - - $command = new \FooCommand(); - $this->add($command); - $this->setDefaultCommand($command->getName()); - } -} diff --git a/vendor/symfony/console/Tests/ClockMock.php b/vendor/symfony/console/Tests/ClockMock.php deleted file mode 100644 index 0e92316..0000000 --- a/vendor/symfony/console/Tests/ClockMock.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Tests; - -function time() -{ - return Tests\time(); -} - -namespace Symfony\Component\Console\Tests; - -function with_clock_mock($enable = null) -{ - static $enabled; - - if (null === $enable) { - return $enabled; - } - - $enabled = $enable; -} - -function time() -{ - if (!with_clock_mock()) { - return \time(); - } - - return $_SERVER['REQUEST_TIME']; -} diff --git a/vendor/symfony/console/Tests/Command/CommandTest.php b/vendor/symfony/console/Tests/Command/CommandTest.php deleted file mode 100644 index 7ab993b..0000000 --- a/vendor/symfony/console/Tests/Command/CommandTest.php +++ /dev/null @@ -1,337 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Command; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\StringInput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Tester\CommandTester; - -class CommandTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = __DIR__.'/../Fixtures/'; - require_once self::$fixturesPath.'/TestCommand.php'; - } - - public function testConstructor() - { - $command = new Command('foo:bar'); - $this->assertEquals('foo:bar', $command->getName(), '__construct() takes the command name as its first argument'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage The command defined in "Symfony\Component\Console\Command\Command" cannot have an empty name. - */ - public function testCommandNameCannotBeEmpty() - { - new Command(); - } - - public function testSetApplication() - { - $application = new Application(); - $command = new \TestCommand(); - $command->setApplication($application); - $this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application'); - } - - public function testSetGetDefinition() - { - $command = new \TestCommand(); - $ret = $command->setDefinition($definition = new InputDefinition()); - $this->assertEquals($command, $ret, '->setDefinition() implements a fluent interface'); - $this->assertEquals($definition, $command->getDefinition(), '->setDefinition() sets the current InputDefinition instance'); - $command->setDefinition(array(new InputArgument('foo'), new InputOption('bar'))); - $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); - $this->assertTrue($command->getDefinition()->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument'); - $command->setDefinition(new InputDefinition()); - } - - public function testAddArgument() - { - $command = new \TestCommand(); - $ret = $command->addArgument('foo'); - $this->assertEquals($command, $ret, '->addArgument() implements a fluent interface'); - $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->addArgument() adds an argument to the command'); - } - - public function testAddOption() - { - $command = new \TestCommand(); - $ret = $command->addOption('foo'); - $this->assertEquals($command, $ret, '->addOption() implements a fluent interface'); - $this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command'); - } - - public function testGetNamespaceGetNameSetName() - { - $command = new \TestCommand(); - $this->assertEquals('namespace:name', $command->getName(), '->getName() returns the command name'); - $command->setName('foo'); - $this->assertEquals('foo', $command->getName(), '->setName() sets the command name'); - - $ret = $command->setName('foobar:bar'); - $this->assertEquals($command, $ret, '->setName() implements a fluent interface'); - $this->assertEquals('foobar:bar', $command->getName(), '->setName() sets the command name'); - } - - /** - * @dataProvider provideInvalidCommandNames - */ - public function testInvalidCommandNames($name) - { - $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name)); - - $command = new \TestCommand(); - $command->setName($name); - } - - public function provideInvalidCommandNames() - { - return array( - array(''), - array('foo:'), - ); - } - - public function testGetSetDescription() - { - $command = new \TestCommand(); - $this->assertEquals('description', $command->getDescription(), '->getDescription() returns the description'); - $ret = $command->setDescription('description1'); - $this->assertEquals($command, $ret, '->setDescription() implements a fluent interface'); - $this->assertEquals('description1', $command->getDescription(), '->setDescription() sets the description'); - } - - public function testGetSetHelp() - { - $command = new \TestCommand(); - $this->assertEquals('help', $command->getHelp(), '->getHelp() returns the help'); - $ret = $command->setHelp('help1'); - $this->assertEquals($command, $ret, '->setHelp() implements a fluent interface'); - $this->assertEquals('help1', $command->getHelp(), '->setHelp() sets the help'); - $command->setHelp(''); - $this->assertEquals('description', $command->getHelp(), '->getHelp() fallback to the description'); - } - - public function testGetProcessedHelp() - { - $command = new \TestCommand(); - $command->setHelp('The %command.name% command does... Example: php %command.full_name%.'); - $this->assertContains('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly'); - $this->assertNotContains('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%'); - } - - public function testGetSetAliases() - { - $command = new \TestCommand(); - $this->assertEquals(array('name'), $command->getAliases(), '->getAliases() returns the aliases'); - $ret = $command->setAliases(array('name1')); - $this->assertEquals($command, $ret, '->setAliases() implements a fluent interface'); - $this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases'); - } - - public function testGetSynopsis() - { - $command = new \TestCommand(); - $command->addOption('foo'); - $command->addArgument('bar'); - $this->assertEquals('namespace:name [--foo] [--] []', $command->getSynopsis(), '->getSynopsis() returns the synopsis'); - } - - public function testGetHelper() - { - $application = new Application(); - $command = new \TestCommand(); - $command->setApplication($application); - $formatterHelper = new FormatterHelper(); - $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper'); - } - - public function testMergeApplicationDefinition() - { - $application1 = new Application(); - $application1->getDefinition()->addArguments(array(new InputArgument('foo'))); - $application1->getDefinition()->addOptions(array(new InputOption('bar'))); - $command = new \TestCommand(); - $command->setApplication($application1); - $command->setDefinition($definition = new InputDefinition(array(new InputArgument('bar'), new InputOption('foo')))); - - $r = new \ReflectionObject($command); - $m = $r->getMethod('mergeApplicationDefinition'); - $m->setAccessible(true); - $m->invoke($command); - $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition() merges the application arguments and the command arguments'); - $this->assertTrue($command->getDefinition()->hasArgument('bar'), '->mergeApplicationDefinition() merges the application arguments and the command arguments'); - $this->assertTrue($command->getDefinition()->hasOption('foo'), '->mergeApplicationDefinition() merges the application options and the command options'); - $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition() merges the application options and the command options'); - - $m->invoke($command); - $this->assertEquals(3, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments and options'); - } - - public function testMergeApplicationDefinitionWithoutArgsThenWithArgsAddsArgs() - { - $application1 = new Application(); - $application1->getDefinition()->addArguments(array(new InputArgument('foo'))); - $application1->getDefinition()->addOptions(array(new InputOption('bar'))); - $command = new \TestCommand(); - $command->setApplication($application1); - $command->setDefinition($definition = new InputDefinition(array())); - - $r = new \ReflectionObject($command); - $m = $r->getMethod('mergeApplicationDefinition'); - $m->setAccessible(true); - $m->invoke($command, false); - $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition(false) merges the application and the command options'); - $this->assertFalse($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(false) does not merge the application arguments'); - - $m->invoke($command, true); - $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(true) merges the application arguments and the command arguments'); - - $m->invoke($command); - $this->assertEquals(2, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments'); - } - - public function testRunInteractive() - { - $tester = new CommandTester(new \TestCommand()); - - $tester->execute(array(), array('interactive' => true)); - - $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive'); - } - - public function testRunNonInteractive() - { - $tester = new CommandTester(new \TestCommand()); - - $tester->execute(array(), array('interactive' => false)); - - $this->assertEquals('execute called'.PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You must override the execute() method in the concrete command class. - */ - public function testExecuteMethodNeedsToBeOverridden() - { - $command = new Command('foo'); - $command->run(new StringInput(''), new NullOutput()); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "--bar" option does not exist. - */ - public function testRunWithInvalidOption() - { - $command = new \TestCommand(); - $tester = new CommandTester($command); - $tester->execute(array('--bar' => true)); - } - - public function testRunReturnsIntegerExitCode() - { - $command = new \TestCommand(); - $exitCode = $command->run(new StringInput(''), new NullOutput()); - $this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)'); - - $command = $this->getMock('TestCommand', array('execute')); - $command->expects($this->once()) - ->method('execute') - ->will($this->returnValue('2.3')); - $exitCode = $command->run(new StringInput(''), new NullOutput()); - $this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)'); - } - - public function testRunReturnsAlwaysInteger() - { - $command = new \TestCommand(); - - $this->assertSame(0, $command->run(new StringInput(''), new NullOutput())); - } - - public function testSetCode() - { - $command = new \TestCommand(); - $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) { - $output->writeln('from the code...'); - }); - $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); - $tester = new CommandTester($command); - $tester->execute(array()); - $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); - } - - public function testSetCodeWithNonClosureCallable() - { - $command = new \TestCommand(); - $ret = $command->setCode(array($this, 'callableMethodCommand')); - $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); - $tester = new CommandTester($command); - $tester->execute(array()); - $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid callable provided to Command::setCode. - */ - public function testSetCodeWithNonCallable() - { - $command = new \TestCommand(); - $command->setCode(array($this, 'nonExistentMethod')); - } - - public function callableMethodCommand(InputInterface $input, OutputInterface $output) - { - $output->writeln('from the code...'); - } - - /** - * @group legacy - */ - public function testLegacyAsText() - { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command'); - } - - /** - * @group legacy - */ - public function testLegacyAsXml() - { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/command_asxml.txt', $command->asXml(), '->asXml() returns an XML representation of the command'); - } -} diff --git a/vendor/symfony/console/Tests/Command/HelpCommandTest.php b/vendor/symfony/console/Tests/Command/HelpCommandTest.php deleted file mode 100644 index 9e06858..0000000 --- a/vendor/symfony/console/Tests/Command/HelpCommandTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Command; - -use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Application; - -class HelpCommandTest extends \PHPUnit_Framework_TestCase -{ - public function testExecuteForCommandAlias() - { - $command = new HelpCommand(); - $command->setApplication(new Application()); - $commandTester = new CommandTester($command); - $commandTester->execute(array('command_name' => 'li'), array('decorated' => false)); - $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); - $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); - $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias'); - } - - public function testExecuteForCommand() - { - $command = new HelpCommand(); - $commandTester = new CommandTester($command); - $command->setCommand(new ListCommand()); - $commandTester->execute(array(), array('decorated' => false)); - $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - } - - public function testExecuteForCommandWithXmlOption() - { - $command = new HelpCommand(); - $commandTester = new CommandTester($command); - $command->setCommand(new ListCommand()); - $commandTester->execute(array('--format' => 'xml')); - $this->assertContains('getDisplay(), '->execute() returns an XML help text if --xml is passed'); - } - - public function testExecuteForApplicationCommand() - { - $application = new Application(); - $commandTester = new CommandTester($application->get('help')); - $commandTester->execute(array('command_name' => 'list')); - $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - } - - public function testExecuteForApplicationCommandWithXmlOption() - { - $application = new Application(); - $commandTester = new CommandTester($application->get('help')); - $commandTester->execute(array('command_name' => 'list', '--format' => 'xml')); - $this->assertContains('list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); - $this->assertContains('getDisplay(), '->execute() returns an XML help text if --format=xml is passed'); - } -} diff --git a/vendor/symfony/console/Tests/Command/ListCommandTest.php b/vendor/symfony/console/Tests/Command/ListCommandTest.php deleted file mode 100644 index 3578d48..0000000 --- a/vendor/symfony/console/Tests/Command/ListCommandTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Command; - -use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Console\Application; - -class ListCommandTest extends \PHPUnit_Framework_TestCase -{ - public function testExecuteListsCommands() - { - $application = new Application(); - $commandTester = new CommandTester($command = $application->get('list')); - $commandTester->execute(array('command' => $command->getName()), array('decorated' => false)); - - $this->assertRegExp('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); - } - - public function testExecuteListsCommandsWithXmlOption() - { - $application = new Application(); - $commandTester = new CommandTester($command = $application->get('list')); - $commandTester->execute(array('command' => $command->getName(), '--format' => 'xml')); - $this->assertRegExp('//', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed'); - } - - public function testExecuteListsCommandsWithRawOption() - { - $application = new Application(); - $commandTester = new CommandTester($command = $application->get('list')); - $commandTester->execute(array('command' => $command->getName(), '--raw' => true)); - $output = <<assertEquals($output, $commandTester->getDisplay(true)); - } - - public function testExecuteListsCommandsWithNamespaceArgument() - { - require_once realpath(__DIR__.'/../Fixtures/FooCommand.php'); - $application = new Application(); - $application->add(new \FooCommand()); - $commandTester = new CommandTester($command = $application->get('list')); - $commandTester->execute(array('command' => $command->getName(), 'namespace' => 'foo', '--raw' => true)); - $output = <<assertEquals($output, $commandTester->getDisplay(true)); - } -} diff --git a/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php deleted file mode 100644 index f582e7f..0000000 --- a/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\BufferedOutput; - -abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getDescribeInputArgumentTestData */ - public function testDescribeInputArgument(InputArgument $argument, $expectedDescription) - { - $this->assertDescription($expectedDescription, $argument); - } - - /** @dataProvider getDescribeInputOptionTestData */ - public function testDescribeInputOption(InputOption $option, $expectedDescription) - { - $this->assertDescription($expectedDescription, $option); - } - - /** @dataProvider getDescribeInputDefinitionTestData */ - public function testDescribeInputDefinition(InputDefinition $definition, $expectedDescription) - { - $this->assertDescription($expectedDescription, $definition); - } - - /** @dataProvider getDescribeCommandTestData */ - public function testDescribeCommand(Command $command, $expectedDescription) - { - $this->assertDescription($expectedDescription, $command); - } - - /** @dataProvider getDescribeApplicationTestData */ - public function testDescribeApplication(Application $application, $expectedDescription) - { - // Replaces the dynamic placeholders of the command help text with a static version. - // The placeholder %command.full_name% includes the script path that is not predictable - // and can not be tested against. - foreach ($application->all() as $command) { - $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp())); - } - - $this->assertDescription($expectedDescription, $application); - } - - public function getDescribeInputArgumentTestData() - { - return $this->getDescriptionTestData(ObjectsProvider::getInputArguments()); - } - - public function getDescribeInputOptionTestData() - { - return $this->getDescriptionTestData(ObjectsProvider::getInputOptions()); - } - - public function getDescribeInputDefinitionTestData() - { - return $this->getDescriptionTestData(ObjectsProvider::getInputDefinitions()); - } - - public function getDescribeCommandTestData() - { - return $this->getDescriptionTestData(ObjectsProvider::getCommands()); - } - - public function getDescribeApplicationTestData() - { - return $this->getDescriptionTestData(ObjectsProvider::getApplications()); - } - - abstract protected function getDescriptor(); - abstract protected function getFormat(); - - private function getDescriptionTestData(array $objects) - { - $data = array(); - foreach ($objects as $name => $object) { - $description = file_get_contents(sprintf('%s/../Fixtures/%s.%s', __DIR__, $name, $this->getFormat())); - $data[] = array($object, $description); - } - - return $data; - } - - protected function assertDescription($expectedDescription, $describedObject) - { - $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); - $this->getDescriptor()->describe($output, $describedObject, array('raw_output' => true)); - $this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch()))); - } -} diff --git a/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php deleted file mode 100644 index f9a1561..0000000 --- a/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Descriptor; - -use Symfony\Component\Console\Descriptor\JsonDescriptor; -use Symfony\Component\Console\Output\BufferedOutput; - -class JsonDescriptorTest extends AbstractDescriptorTest -{ - protected function getDescriptor() - { - return new JsonDescriptor(); - } - - protected function getFormat() - { - return 'json'; - } - - protected function assertDescription($expectedDescription, $describedObject) - { - $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); - $this->getDescriptor()->describe($output, $describedObject, array('raw_output' => true)); - $this->assertEquals(json_decode(trim($expectedDescription), true), json_decode(trim(str_replace(PHP_EOL, "\n", $output->fetch())), true)); - } -} diff --git a/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php deleted file mode 100644 index c85e8a5..0000000 --- a/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Descriptor; - -use Symfony\Component\Console\Descriptor\MarkdownDescriptor; - -class MarkdownDescriptorTest extends AbstractDescriptorTest -{ - protected function getDescriptor() - { - return new MarkdownDescriptor(); - } - - protected function getFormat() - { - return 'md'; - } -} diff --git a/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php b/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php deleted file mode 100644 index 45b3b2f..0000000 --- a/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Descriptor; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication1; -use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2; -use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand1; -use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand2; - -/** - * @author Jean-François Simon - */ -class ObjectsProvider -{ - public static function getInputArguments() - { - return array( - 'input_argument_1' => new InputArgument('argument_name', InputArgument::REQUIRED), - 'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'), - 'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'), - 'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"), - ); - } - - public static function getInputOptions() - { - return array( - 'input_option_1' => new InputOption('option_name', 'o', InputOption::VALUE_NONE), - 'input_option_2' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', 'default_value'), - 'input_option_3' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description'), - 'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()), - 'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"), - 'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'), - ); - } - - public static function getInputDefinitions() - { - return array( - 'input_definition_1' => new InputDefinition(), - 'input_definition_2' => new InputDefinition(array(new InputArgument('argument_name', InputArgument::REQUIRED))), - 'input_definition_3' => new InputDefinition(array(new InputOption('option_name', 'o', InputOption::VALUE_NONE))), - 'input_definition_4' => new InputDefinition(array( - new InputArgument('argument_name', InputArgument::REQUIRED), - new InputOption('option_name', 'o', InputOption::VALUE_NONE), - )), - ); - } - - public static function getCommands() - { - return array( - 'command_1' => new DescriptorCommand1(), - 'command_2' => new DescriptorCommand2(), - ); - } - - public static function getApplications() - { - return array( - 'application_1' => new DescriptorApplication1(), - 'application_2' => new DescriptorApplication2(), - ); - } -} diff --git a/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php deleted file mode 100644 index 350b679..0000000 --- a/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Descriptor; - -use Symfony\Component\Console\Descriptor\TextDescriptor; - -class TextDescriptorTest extends AbstractDescriptorTest -{ - protected function getDescriptor() - { - return new TextDescriptor(); - } - - protected function getFormat() - { - return 'txt'; - } -} diff --git a/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php deleted file mode 100644 index 59a5d1e..0000000 --- a/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Descriptor; - -use Symfony\Component\Console\Descriptor\XmlDescriptor; - -class XmlDescriptorTest extends AbstractDescriptorTest -{ - protected function getDescriptor() - { - return new XmlDescriptor(); - } - - protected function getFormat() - { - return 'xml'; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php b/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php deleted file mode 100644 index 52b619e..0000000 --- a/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php +++ /dev/null @@ -1,11 +0,0 @@ -setName('bar:buc'); - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication1.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication1.php deleted file mode 100644 index 132b6d5..0000000 --- a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication1.php +++ /dev/null @@ -1,18 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Fixtures; - -use Symfony\Component\Console\Application; - -class DescriptorApplication1 extends Application -{ -} diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php deleted file mode 100644 index ff55135..0000000 --- a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Fixtures; - -use Symfony\Component\Console\Application; - -class DescriptorApplication2 extends Application -{ - public function __construct() - { - parent::__construct('My Symfony application', 'v1.0'); - $this->add(new DescriptorCommand1()); - $this->add(new DescriptorCommand2()); - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php deleted file mode 100644 index ede05d7..0000000 --- a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Fixtures; - -use Symfony\Component\Console\Command\Command; - -class DescriptorCommand1 extends Command -{ - protected function configure() - { - $this - ->setName('descriptor:command1') - ->setAliases(array('alias1', 'alias2')) - ->setDescription('command 1 description') - ->setHelp('command 1 help') - ; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php deleted file mode 100644 index 51106b9..0000000 --- a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Fixtures; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class DescriptorCommand2 extends Command -{ - protected function configure() - { - $this - ->setName('descriptor:command2') - ->setDescription('command 2 description') - ->setHelp('command 2 help') - ->addUsage('-o|--option_name ') - ->addUsage('') - ->addArgument('argument_name', InputArgument::REQUIRED) - ->addOption('option_name', 'o', InputOption::VALUE_NONE) - ; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/DummyOutput.php b/vendor/symfony/console/Tests/Fixtures/DummyOutput.php deleted file mode 100644 index 0070c0a..0000000 --- a/vendor/symfony/console/Tests/Fixtures/DummyOutput.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Fixtures; - -use Symfony\Component\Console\Output\BufferedOutput; - -/** - * Dummy output. - * - * @author Kévin Dunglas - */ -class DummyOutput extends BufferedOutput -{ - /** - * @return array - */ - public function getLogs() - { - $logs = array(); - foreach (explode("\n", trim($this->fetch())) as $message) { - preg_match('/^\[(.*)\] (.*)/', $message, $matches); - $logs[] = sprintf('%s %s', $matches[1], $matches[2]); - } - - return $logs; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/Foo1Command.php b/vendor/symfony/console/Tests/Fixtures/Foo1Command.php deleted file mode 100644 index 254162f..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Foo1Command.php +++ /dev/null @@ -1,26 +0,0 @@ -setName('foo:bar1') - ->setDescription('The foo:bar1 command') - ->setAliases(array('afoobar1')) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/Foo2Command.php b/vendor/symfony/console/Tests/Fixtures/Foo2Command.php deleted file mode 100644 index 8071dc8..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Foo2Command.php +++ /dev/null @@ -1,21 +0,0 @@ -setName('foo1:bar') - ->setDescription('The foo1:bar command') - ->setAliases(array('afoobar2')) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/Foo3Command.php b/vendor/symfony/console/Tests/Fixtures/Foo3Command.php deleted file mode 100644 index 6c890fa..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Foo3Command.php +++ /dev/null @@ -1,29 +0,0 @@ -setName('foo3:bar') - ->setDescription('The foo3:bar command') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - try { - try { - throw new \Exception('First exception

this is html

'); - } catch (\Exception $e) { - throw new \Exception('Second exception comment', 0, $e); - } - } catch (\Exception $e) { - throw new \Exception('Third exception comment', 0, $e); - } - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/Foo4Command.php b/vendor/symfony/console/Tests/Fixtures/Foo4Command.php deleted file mode 100644 index 1c54639..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Foo4Command.php +++ /dev/null @@ -1,11 +0,0 @@ -setName('foo3:bar:toh'); - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/Foo5Command.php b/vendor/symfony/console/Tests/Fixtures/Foo5Command.php deleted file mode 100644 index a1c6082..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Foo5Command.php +++ /dev/null @@ -1,10 +0,0 @@ -setName('foo:bar') - ->setDescription('The foo:bar command') - ->setAliases(array('afoobar')) - ; - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $output->writeln('interact called'); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - - $output->writeln('called'); - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php deleted file mode 100644 index fc50c72..0000000 --- a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php +++ /dev/null @@ -1,26 +0,0 @@ -setName('foo:bar:baz') - ->setDescription('The foo:bar:baz command') - ->setAliases(array('foobarbaz')) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php deleted file mode 100644 index 1cf31ff..0000000 --- a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php +++ /dev/null @@ -1,26 +0,0 @@ -setName('foo:go:bret') - ->setDescription('The foo:bar:go command') - ->setAliases(array('foobargo')) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php b/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php deleted file mode 100644 index 9681628..0000000 --- a/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php +++ /dev/null @@ -1,25 +0,0 @@ -setName('foobar:foo') - ->setDescription('The foobar:foo command') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php deleted file mode 100644 index 8fe7c07..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php +++ /dev/null @@ -1,11 +0,0 @@ -caution('Lorem ipsum dolor sit amet'); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php deleted file mode 100644 index e5c700d..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php +++ /dev/null @@ -1,13 +0,0 @@ -title('Title'); - $output->warning('Lorem ipsum dolor sit amet'); - $output->title('Title'); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php deleted file mode 100644 index 791b626..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php +++ /dev/null @@ -1,16 +0,0 @@ -warning('Warning'); - $output->caution('Caution'); - $output->error('Error'); - $output->success('Success'); - $output->note('Note'); - $output->block('Custom block', 'CUSTOM', 'fg=white;bg=green', 'X ', true); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php deleted file mode 100644 index 99253a6..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php +++ /dev/null @@ -1,12 +0,0 @@ -title('First title'); - $output->title('Second title'); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php deleted file mode 100644 index 0c5d3fb..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php +++ /dev/null @@ -1,34 +0,0 @@ -write('Lorem ipsum dolor sit amet'); - $output->title('First title'); - - $output->writeln('Lorem ipsum dolor sit amet'); - $output->title('Second title'); - - $output->write('Lorem ipsum dolor sit amet'); - $output->write(''); - $output->title('Third title'); - - //Ensure edge case by appending empty strings to history: - $output->write('Lorem ipsum dolor sit amet'); - $output->write(array('', '', '')); - $output->title('Fourth title'); - - //Ensure have manual control over number of blank lines: - $output->writeln('Lorem ipsum dolor sit amet'); - $output->writeln(array('', '')); //Should append an extra blank line - $output->title('Fifth title'); - - $output->writeln('Lorem ipsum dolor sit amet'); - $output->newLine(2); //Should append an extra blank line - $output->title('Fifth title'); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php deleted file mode 100644 index 4543ad8..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php +++ /dev/null @@ -1,29 +0,0 @@ -writeln('Lorem ipsum dolor sit amet'); - $output->listing(array( - 'Lorem ipsum dolor sit amet', - 'consectetur adipiscing elit', - )); - - //Even using write: - $output->write('Lorem ipsum dolor sit amet'); - $output->listing(array( - 'Lorem ipsum dolor sit amet', - 'consectetur adipiscing elit', - )); - - $output->write('Lorem ipsum dolor sit amet'); - $output->text(array( - 'Lorem ipsum dolor sit amet', - 'consectetur adipiscing elit', - )); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php deleted file mode 100644 index 8031ec9..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php +++ /dev/null @@ -1,16 +0,0 @@ -listing(array( - 'Lorem ipsum dolor sit amet', - 'consectetur adipiscing elit', - )); - $output->success('Lorem ipsum dolor sit amet'); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php deleted file mode 100644 index 203eb5b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php +++ /dev/null @@ -1,15 +0,0 @@ -title('Title'); - $output->askHidden('Hidden question'); - $output->choice('Choice question with default', array('choice1', 'choice2'), 'choice1'); - $output->confirm('Confirmation with yes default', true); - $output->text('Duis aute irure dolor in reprehenderit in voluptate velit esse'); -}; diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt deleted file mode 100644 index a42e0f7..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt +++ /dev/null @@ -1,3 +0,0 @@ - - ! [CAUTION] Lorem ipsum dolor sit amet - diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt deleted file mode 100644 index 334875f..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt +++ /dev/null @@ -1,9 +0,0 @@ - -Title -===== - - [WARNING] Lorem ipsum dolor sit amet - -Title -===== - diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt deleted file mode 100644 index ca60976..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt +++ /dev/null @@ -1,13 +0,0 @@ - - [WARNING] Warning - - ! [CAUTION] Caution - - [ERROR] Error - - [OK] Success - - ! [NOTE] Note - -X [CUSTOM] Custom block - diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt deleted file mode 100644 index f4b6d58..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt +++ /dev/null @@ -1,7 +0,0 @@ - -First title -=========== - -Second title -============ - diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt deleted file mode 100644 index 2646d85..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt +++ /dev/null @@ -1,32 +0,0 @@ -Lorem ipsum dolor sit amet - -First title -=========== - -Lorem ipsum dolor sit amet - -Second title -============ - -Lorem ipsum dolor sit amet - -Third title -=========== - -Lorem ipsum dolor sit amet - -Fourth title -============ - -Lorem ipsum dolor sit amet - - -Fifth title -=========== - -Lorem ipsum dolor sit amet - - -Fifth title -=========== - diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt deleted file mode 100644 index 910240f..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt +++ /dev/null @@ -1,11 +0,0 @@ -Lorem ipsum dolor sit amet - * Lorem ipsum dolor sit amet - * consectetur adipiscing elit - -Lorem ipsum dolor sit amet - * Lorem ipsum dolor sit amet - * consectetur adipiscing elit - -Lorem ipsum dolor sit amet - // Lorem ipsum dolor sit amet - // consectetur adipiscing elit diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt deleted file mode 100644 index 5f2d33c..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt +++ /dev/null @@ -1,6 +0,0 @@ - - * Lorem ipsum dolor sit amet - * consectetur adipiscing elit - - [OK] Lorem ipsum dolor sit amet - diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt deleted file mode 100644 index ab18e5d..0000000 --- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt +++ /dev/null @@ -1,5 +0,0 @@ - -Title -===== - - // Duis aute irure dolor in reprehenderit in voluptate velit esse diff --git a/vendor/symfony/console/Tests/Fixtures/TestCommand.php b/vendor/symfony/console/Tests/Fixtures/TestCommand.php deleted file mode 100644 index dcd3273..0000000 --- a/vendor/symfony/console/Tests/Fixtures/TestCommand.php +++ /dev/null @@ -1,28 +0,0 @@ -setName('namespace:name') - ->setAliases(array('name')) - ->setDescription('description') - ->setHelp('help') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $output->writeln('execute called'); - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $output->writeln('interact called'); - } -} diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.json b/vendor/symfony/console/Tests/Fixtures/application_1.json deleted file mode 100644 index b17b38d..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_1.json +++ /dev/null @@ -1 +0,0 @@ -{"commands":[{"name":"help","usage":["help [--xml] [--format FORMAT] [--raw] [--] []"],"description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--xml] [--raw] [--format FORMAT] [--] []"],"description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]} diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.md b/vendor/symfony/console/Tests/Fixtures/application_1.md deleted file mode 100644 index 82a605d..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_1.md +++ /dev/null @@ -1,201 +0,0 @@ -UNKNOWN -======= - -* help -* list - -help ----- - -* Description: Displays help for a command -* Usage: - - * `help [--xml] [--format FORMAT] [--raw] [--] []` - -The help command displays help for a given command: - - php app/console help list - -You can also output the help in other formats by using the --format option: - - php app/console help --format=xml list - -To display the list of available commands, please use the list command. - -### Arguments: - -**command_name:** - -* Name: command_name -* Is required: no -* Is array: no -* Description: The command name -* Default: `'help'` - -### Options: - -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output help as XML -* Default: `false` - -**format:** - -* Name: `--format` -* Shortcut: -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: The output format (txt, xml, json, or md) -* Default: `'txt'` - -**raw:** - -* Name: `--raw` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output raw command help -* Default: `false` - -**help:** - -* Name: `--help` -* Shortcut: `-h` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this help message -* Default: `false` - -**quiet:** - -* Name: `--quiet` -* Shortcut: `-q` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not output any message -* Default: `false` - -**verbose:** - -* Name: `--verbose` -* Shortcut: `-v|-vv|-vvv` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug -* Default: `false` - -**version:** - -* Name: `--version` -* Shortcut: `-V` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this application version -* Default: `false` - -**ansi:** - -* Name: `--ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Force ANSI output -* Default: `false` - -**no-ansi:** - -* Name: `--no-ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Disable ANSI output -* Default: `false` - -**no-interaction:** - -* Name: `--no-interaction` -* Shortcut: `-n` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not ask any interactive question -* Default: `false` - -list ----- - -* Description: Lists commands -* Usage: - - * `list [--xml] [--raw] [--format FORMAT] [--] []` - -The list command lists all commands: - - php app/console list - -You can also display the commands for a specific namespace: - - php app/console list test - -You can also output the information in other formats by using the --format option: - - php app/console list --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - php app/console list --raw - -### Arguments: - -**namespace:** - -* Name: namespace -* Is required: no -* Is array: no -* Description: The namespace name -* Default: `NULL` - -### Options: - -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output list as XML -* Default: `false` - -**raw:** - -* Name: `--raw` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output raw command list -* Default: `false` - -**format:** - -* Name: `--format` -* Shortcut: -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: The output format (txt, xml, json, or md) -* Default: `'txt'` diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.txt b/vendor/symfony/console/Tests/Fixtures/application_1.txt deleted file mode 100644 index c4cf8f2..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_1.txt +++ /dev/null @@ -1,17 +0,0 @@ -Console Tool - -Usage: - command [options] [arguments] - -Options: - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Available commands: - help Displays help for a command - list Lists commands diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.xml b/vendor/symfony/console/Tests/Fixtures/application_1.xml deleted file mode 100644 index 35d1db4..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_1.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - help [--xml] [--format FORMAT] [--raw] [--] [<command_name>] - - Displays help for a command - The <info>help</info> command displays help for a given command: - - <info>php app/console help list</info> - - You can also output the help in other formats by using the <comment>--format</comment> option: - - <info>php app/console help --format=xml list</info> - - To display the list of available commands, please use the <info>list</info> command. - - - The command name - - help - - - - - - - - - - - - - - - - - - - list [--xml] [--raw] [--format FORMAT] [--] [<namespace>] - - Lists commands - The <info>list</info> command lists all commands: - - <info>php app/console list</info> - - You can also display the commands for a specific namespace: - - <info>php app/console list test</info> - - You can also output the information in other formats by using the <comment>--format</comment> option: - - <info>php app/console list --format=xml</info> - - It's also possible to get raw list of commands (useful for embedding command runner): - - <info>php app/console list --raw</info> - - - The namespace name - - - - - - - - - - - - - help - list - - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.json b/vendor/symfony/console/Tests/Fixtures/application_2.json deleted file mode 100644 index e47a7a9..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_2.json +++ /dev/null @@ -1 +0,0 @@ -{"commands":[{"name":"help","usage":["help [--xml] [--format FORMAT] [--raw] [--] []"],"description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--xml] [--raw] [--format FORMAT] [--] []"],"description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}},{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":{"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] ", "descriptor:command2 -o|--option_name ", "descriptor:command2 "],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}}],"namespaces":[{"id":"_global","commands":["alias1","alias2","help","list"]},{"id":"descriptor","commands":["descriptor:command1","descriptor:command2"]}]} \ No newline at end of file diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.md b/vendor/symfony/console/Tests/Fixtures/application_2.md deleted file mode 100644 index f031c9e..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_2.md +++ /dev/null @@ -1,396 +0,0 @@ -My Symfony application -====================== - -* alias1 -* alias2 -* help -* list - -**descriptor:** - -* descriptor:command1 -* descriptor:command2 - -help ----- - -* Description: Displays help for a command -* Usage: - - * `help [--xml] [--format FORMAT] [--raw] [--] []` - -The help command displays help for a given command: - - php app/console help list - -You can also output the help in other formats by using the --format option: - - php app/console help --format=xml list - -To display the list of available commands, please use the list command. - -### Arguments: - -**command_name:** - -* Name: command_name -* Is required: no -* Is array: no -* Description: The command name -* Default: `'help'` - -### Options: - -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output help as XML -* Default: `false` - -**format:** - -* Name: `--format` -* Shortcut: -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: The output format (txt, xml, json, or md) -* Default: `'txt'` - -**raw:** - -* Name: `--raw` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output raw command help -* Default: `false` - -**help:** - -* Name: `--help` -* Shortcut: `-h` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this help message -* Default: `false` - -**quiet:** - -* Name: `--quiet` -* Shortcut: `-q` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not output any message -* Default: `false` - -**verbose:** - -* Name: `--verbose` -* Shortcut: `-v|-vv|-vvv` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug -* Default: `false` - -**version:** - -* Name: `--version` -* Shortcut: `-V` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this application version -* Default: `false` - -**ansi:** - -* Name: `--ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Force ANSI output -* Default: `false` - -**no-ansi:** - -* Name: `--no-ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Disable ANSI output -* Default: `false` - -**no-interaction:** - -* Name: `--no-interaction` -* Shortcut: `-n` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not ask any interactive question -* Default: `false` - -list ----- - -* Description: Lists commands -* Usage: - - * `list [--xml] [--raw] [--format FORMAT] [--] []` - -The list command lists all commands: - - php app/console list - -You can also display the commands for a specific namespace: - - php app/console list test - -You can also output the information in other formats by using the --format option: - - php app/console list --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - php app/console list --raw - -### Arguments: - -**namespace:** - -* Name: namespace -* Is required: no -* Is array: no -* Description: The namespace name -* Default: `NULL` - -### Options: - -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output list as XML -* Default: `false` - -**raw:** - -* Name: `--raw` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output raw command list -* Default: `false` - -**format:** - -* Name: `--format` -* Shortcut: -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: The output format (txt, xml, json, or md) -* Default: `'txt'` - -descriptor:command1 -------------------- - -* Description: command 1 description -* Usage: - - * `descriptor:command1` - * `alias1` - * `alias2` - -command 1 help - -### Options: - -**help:** - -* Name: `--help` -* Shortcut: `-h` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this help message -* Default: `false` - -**quiet:** - -* Name: `--quiet` -* Shortcut: `-q` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not output any message -* Default: `false` - -**verbose:** - -* Name: `--verbose` -* Shortcut: `-v|-vv|-vvv` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug -* Default: `false` - -**version:** - -* Name: `--version` -* Shortcut: `-V` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this application version -* Default: `false` - -**ansi:** - -* Name: `--ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Force ANSI output -* Default: `false` - -**no-ansi:** - -* Name: `--no-ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Disable ANSI output -* Default: `false` - -**no-interaction:** - -* Name: `--no-interaction` -* Shortcut: `-n` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not ask any interactive question -* Default: `false` - -descriptor:command2 -------------------- - -* Description: command 2 description -* Usage: - - * `descriptor:command2 [-o|--option_name] [--] ` - * `descriptor:command2 -o|--option_name ` - * `descriptor:command2 ` - -command 2 help - -### Arguments: - -**argument_name:** - -* Name: argument_name -* Is required: yes -* Is array: no -* Description: -* Default: `NULL` - -### Options: - -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: -* Default: `false` - -**help:** - -* Name: `--help` -* Shortcut: `-h` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this help message -* Default: `false` - -**quiet:** - -* Name: `--quiet` -* Shortcut: `-q` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not output any message -* Default: `false` - -**verbose:** - -* Name: `--verbose` -* Shortcut: `-v|-vv|-vvv` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug -* Default: `false` - -**version:** - -* Name: `--version` -* Shortcut: `-V` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this application version -* Default: `false` - -**ansi:** - -* Name: `--ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Force ANSI output -* Default: `false` - -**no-ansi:** - -* Name: `--no-ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Disable ANSI output -* Default: `false` - -**no-interaction:** - -* Name: `--no-interaction` -* Shortcut: `-n` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not ask any interactive question -* Default: `false` diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.txt b/vendor/symfony/console/Tests/Fixtures/application_2.txt deleted file mode 100644 index 292aa82..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_2.txt +++ /dev/null @@ -1,22 +0,0 @@ -My Symfony application version v1.0 - -Usage: - command [options] [arguments] - -Options: - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Available commands: - alias1 command 1 description - alias2 command 1 description - help Displays help for a command - list Lists commands - descriptor - descriptor:command1 command 1 description - descriptor:command2 command 2 description diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.xml b/vendor/symfony/console/Tests/Fixtures/application_2.xml deleted file mode 100644 index bc8ab21..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_2.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - help [--xml] [--format FORMAT] [--raw] [--] [<command_name>] - - Displays help for a command - The <info>help</info> command displays help for a given command: - - <info>php app/console help list</info> - - You can also output the help in other formats by using the <comment>--format</comment> option: - - <info>php app/console help --format=xml list</info> - - To display the list of available commands, please use the <info>list</info> command. - - - The command name - - help - - - - - - - - - - - - - - - - - - - list [--xml] [--raw] [--format FORMAT] [--] [<namespace>] - - Lists commands - The <info>list</info> command lists all commands: - - <info>php app/console list</info> - - You can also display the commands for a specific namespace: - - <info>php app/console list test</info> - - You can also output the information in other formats by using the <comment>--format</comment> option: - - <info>php app/console list --format=xml</info> - - It's also possible to get raw list of commands (useful for embedding command runner): - - <info>php app/console list --raw</info> - - - The namespace name - - - - - - - - - - - - descriptor:command1 - alias1 - alias2 - - command 1 description - command 1 help - - - - - - - - - - - - - - descriptor:command2 [-o|--option_name] [--] <argument_name> - descriptor:command2 -o|--option_name <argument_name> - descriptor:command2 <argument_name> - - command 2 description - command 2 help - - - - - - - - - - - - - - - - - - - - - alias1 - alias2 - help - list - - - descriptor:command1 - descriptor:command2 - - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_astext1.txt b/vendor/symfony/console/Tests/Fixtures/application_astext1.txt deleted file mode 100644 index 19dacb2..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_astext1.txt +++ /dev/null @@ -1,20 +0,0 @@ -Console Tool - -Usage: - command [options] [arguments] - -Options: - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Available commands: - afoobar The foo:bar command - help Displays help for a command - list Lists commands - foo - foo:bar The foo:bar command diff --git a/vendor/symfony/console/Tests/Fixtures/application_astext2.txt b/vendor/symfony/console/Tests/Fixtures/application_astext2.txt deleted file mode 100644 index c99ccdd..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_astext2.txt +++ /dev/null @@ -1,16 +0,0 @@ -Console Tool - -Usage: - command [options] [arguments] - -Options: - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Available commands for the "foo" namespace: - foo:bar The foo:bar command diff --git a/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt b/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt deleted file mode 100644 index 8277d9e..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - help [--xml] [--format FORMAT] [--raw] [--] [<command_name>] - - Displays help for a command - The <info>help</info> command displays help for a given command: - - <info>php app/console help list</info> - - You can also output the help in other formats by using the <comment>--format</comment> option: - - <info>php app/console help --format=xml list</info> - - To display the list of available commands, please use the <info>list</info> command. - - - The command name - - help - - - - - - - - - - - - - - - - - - - list [--xml] [--raw] [--format FORMAT] [--] [<namespace>] - - Lists commands - The <info>list</info> command lists all commands: - - <info>php app/console list</info> - - You can also display the commands for a specific namespace: - - <info>php app/console list test</info> - - You can also output the information in other formats by using the <comment>--format</comment> option: - - <info>php app/console list --format=xml</info> - - It's also possible to get raw list of commands (useful for embedding command runner): - - <info>php app/console list --raw</info> - - - The namespace name - - - - - - - - - - - - foo:bar - afoobar - - The foo:bar command - The foo:bar command - - - - - - - - - - - - - - - afoobar - help - list - - - foo:bar - - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt b/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt deleted file mode 100644 index 93d6d4e..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - foo:bar - afoobar - - The foo:bar command - The foo:bar command - - - - - - - - - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt b/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt deleted file mode 100644 index 0c16e3c..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt +++ /dev/null @@ -1 +0,0 @@ -Console Tool \ No newline at end of file diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt deleted file mode 100644 index 4629345..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt +++ /dev/null @@ -1,8 +0,0 @@ - - - - [InvalidArgumentException] - Command "foo" is not defined. - - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt deleted file mode 100644 index 3d9d363..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt +++ /dev/null @@ -1,11 +0,0 @@ - - - - [InvalidArgumentException] - The "--foo" option does not exist. - - - -list [--xml] [--raw] [--format FORMAT] [--] [] - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt deleted file mode 100644 index 72a7286..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt +++ /dev/null @@ -1,27 +0,0 @@ - - - - [Exception] - Third exception comment - - - - - - - [Exception] - Second exception comment - - - - - - - [Exception] - First exception

this is html

- - - -foo3:bar - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt deleted file mode 100644 index b44d50b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -  - [Exception]  - Third exception comment  -  - - - - -  - [Exception]  - Second exception comment  -  - - - - -  - [Exception]  - First exception 

this is html

  -  - - -foo3:bar - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt deleted file mode 100644 index 19f893b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt +++ /dev/null @@ -1,9 +0,0 @@ - - - - [InvalidArgumentException] - Command "foo" is not define - d. - - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt deleted file mode 100644 index 6a98660..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt +++ /dev/null @@ -1,11 +0,0 @@ - - - - [Exception] - エラーメッセージ - - - -foo - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt deleted file mode 100644 index 8c8801b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt +++ /dev/null @@ -1,11 +0,0 @@ - - -  - [Exception]  - エラーメッセージ  -  - - -foo - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt deleted file mode 100644 index 545cd7b0..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt +++ /dev/null @@ -1,12 +0,0 @@ - - - - [Exception] - コマンドの実行中にエラーが - 発生しました。 - - - -foo - - diff --git a/vendor/symfony/console/Tests/Fixtures/application_run1.txt b/vendor/symfony/console/Tests/Fixtures/application_run1.txt deleted file mode 100644 index 0dc2730..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_run1.txt +++ /dev/null @@ -1,17 +0,0 @@ -Console Tool - -Usage: - command [options] [arguments] - -Options: - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Available commands: - help Displays help for a command - list Lists commands diff --git a/vendor/symfony/console/Tests/Fixtures/application_run2.txt b/vendor/symfony/console/Tests/Fixtures/application_run2.txt deleted file mode 100644 index d28b928..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_run2.txt +++ /dev/null @@ -1,29 +0,0 @@ -Usage: - help [options] [--] [] - -Arguments: - command The command to execute - command_name The command name [default: "help"] - -Options: - --xml To output help as XML - --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"] - --raw To output raw command help - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Help: - The help command displays help for a given command: - - php app/console help list - - You can also output the help in other formats by using the --format option: - - php app/console help --format=xml list - - To display the list of available commands, please use the list command. diff --git a/vendor/symfony/console/Tests/Fixtures/application_run3.txt b/vendor/symfony/console/Tests/Fixtures/application_run3.txt deleted file mode 100644 index bc51995..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_run3.txt +++ /dev/null @@ -1,27 +0,0 @@ -Usage: - list [options] [--] [] - -Arguments: - namespace The namespace name - -Options: - --xml To output list as XML - --raw To output raw command list - --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"] - -Help: - The list command lists all commands: - - php app/console list - - You can also display the commands for a specific namespace: - - php app/console list test - - You can also output the information in other formats by using the --format option: - - php app/console list --format=xml - - It's also possible to get raw list of commands (useful for embedding command runner): - - php app/console list --raw diff --git a/vendor/symfony/console/Tests/Fixtures/application_run4.txt b/vendor/symfony/console/Tests/Fixtures/application_run4.txt deleted file mode 100644 index 47187fc..0000000 --- a/vendor/symfony/console/Tests/Fixtures/application_run4.txt +++ /dev/null @@ -1 +0,0 @@ -Console Tool diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.json b/vendor/symfony/console/Tests/Fixtures/command_1.json deleted file mode 100644 index 20f310b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_1.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":[]}} diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.md b/vendor/symfony/console/Tests/Fixtures/command_1.md deleted file mode 100644 index 34ed3ea..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_1.md +++ /dev/null @@ -1,11 +0,0 @@ -descriptor:command1 -------------------- - -* Description: command 1 description -* Usage: - - * `descriptor:command1` - * `alias1` - * `alias2` - -command 1 help diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.txt b/vendor/symfony/console/Tests/Fixtures/command_1.txt deleted file mode 100644 index 28e14a0..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_1.txt +++ /dev/null @@ -1,7 +0,0 @@ -Usage: - descriptor:command1 - alias1 - alias2 - -Help: - command 1 help diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.xml b/vendor/symfony/console/Tests/Fixtures/command_1.xml deleted file mode 100644 index 838b9bd..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_1.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - descriptor:command1 - alias1 - alias2 - - command 1 description - command 1 help - - - diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.json b/vendor/symfony/console/Tests/Fixtures/command_2.json deleted file mode 100644 index 38edd1e..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_2.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] ", "descriptor:command2 -o|--option_name ", "descriptor:command2 "],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}} diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.md b/vendor/symfony/console/Tests/Fixtures/command_2.md deleted file mode 100644 index 6f538b6..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_2.md +++ /dev/null @@ -1,33 +0,0 @@ -descriptor:command2 -------------------- - -* Description: command 2 description -* Usage: - - * `descriptor:command2 [-o|--option_name] [--] ` - * `descriptor:command2 -o|--option_name ` - * `descriptor:command2 ` - -command 2 help - -### Arguments: - -**argument_name:** - -* Name: argument_name -* Is required: yes -* Is array: no -* Description: -* Default: `NULL` - -### Options: - -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: -* Default: `false` diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.txt b/vendor/symfony/console/Tests/Fixtures/command_2.txt deleted file mode 100644 index 72f7ce0..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_2.txt +++ /dev/null @@ -1,13 +0,0 @@ -Usage: - descriptor:command2 [options] [--] - descriptor:command2 -o|--option_name - descriptor:command2 - -Arguments: - argument_name - -Options: - -o, --option_name - -Help: - command 2 help diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.xml b/vendor/symfony/console/Tests/Fixtures/command_2.xml deleted file mode 100644 index 67364ca..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_2.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - descriptor:command2 [-o|--option_name] [--] <argument_name> - descriptor:command2 -o|--option_name <argument_name> - descriptor:command2 <argument_name> - - command 2 description - command 2 help - - - - - - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/command_astext.txt b/vendor/symfony/console/Tests/Fixtures/command_astext.txt deleted file mode 100644 index 7e20638..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_astext.txt +++ /dev/null @@ -1,18 +0,0 @@ -Usage: - namespace:name - name - -Arguments: - command The command to execute - -Options: - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Help: - help diff --git a/vendor/symfony/console/Tests/Fixtures/command_asxml.txt b/vendor/symfony/console/Tests/Fixtures/command_asxml.txt deleted file mode 100644 index 5e77623..0000000 --- a/vendor/symfony/console/Tests/Fixtures/command_asxml.txt +++ /dev/null @@ -1,38 +0,0 @@ - - - - namespace:name - name - - description - help - - - The command to execute - - - - - - - - - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/definition_astext.txt b/vendor/symfony/console/Tests/Fixtures/definition_astext.txt deleted file mode 100644 index 0431c07..0000000 --- a/vendor/symfony/console/Tests/Fixtures/definition_astext.txt +++ /dev/null @@ -1,11 +0,0 @@ -Arguments: - foo The foo argument - baz The baz argument [default: true] - bar The bar argument [default: ["http://foo.com/"]] - -Options: - -f, --foo=FOO The foo option - --baz[=BAZ] The baz option [default: false] - -b, --bar[=BAR] The bar option [default: "bar"] - --qux[=QUX] The qux option [default: ["http://foo.com/","bar"]] (multiple values allowed) - --qux2[=QUX2] The qux2 option [default: {"foo":"bar"}] (multiple values allowed) \ No newline at end of file diff --git a/vendor/symfony/console/Tests/Fixtures/definition_asxml.txt b/vendor/symfony/console/Tests/Fixtures/definition_asxml.txt deleted file mode 100644 index eec8c07..0000000 --- a/vendor/symfony/console/Tests/Fixtures/definition_asxml.txt +++ /dev/null @@ -1,39 +0,0 @@ - - - - - The foo argument - - - - The baz argument - - true - - - - The bar argument - - bar - - - - - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.json b/vendor/symfony/console/Tests/Fixtures/input_argument_1.json deleted file mode 100644 index b8173b6..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null} diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.md b/vendor/symfony/console/Tests/Fixtures/input_argument_1.md deleted file mode 100644 index 88f311a..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.md +++ /dev/null @@ -1,7 +0,0 @@ -**argument_name:** - -* Name: argument_name -* Is required: yes -* Is array: no -* Description: -* Default: `NULL` diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt deleted file mode 100644 index 5503518..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt +++ /dev/null @@ -1 +0,0 @@ - argument_name diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml deleted file mode 100644 index cb37f81..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.json b/vendor/symfony/console/Tests/Fixtures/input_argument_2.json deleted file mode 100644 index ef06b09..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"argument_name","is_required":false,"is_array":true,"description":"argument description","default":[]} diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.md b/vendor/symfony/console/Tests/Fixtures/input_argument_2.md deleted file mode 100644 index 3cdb00c..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.md +++ /dev/null @@ -1,7 +0,0 @@ -**argument_name:** - -* Name: argument_name -* Is required: no -* Is array: yes -* Description: argument description -* Default: `array ()` diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt deleted file mode 100644 index e713660..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt +++ /dev/null @@ -1 +0,0 @@ - argument_name argument description diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml deleted file mode 100644 index 629da5a..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - argument description - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.json b/vendor/symfony/console/Tests/Fixtures/input_argument_3.json deleted file mode 100644 index de8484e..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"argument_name","is_required":false,"is_array":false,"description":"argument description","default":"default_value"} diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.md b/vendor/symfony/console/Tests/Fixtures/input_argument_3.md deleted file mode 100644 index be1c443..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.md +++ /dev/null @@ -1,7 +0,0 @@ -**argument_name:** - -* Name: argument_name -* Is required: no -* Is array: no -* Description: argument description -* Default: `'default_value'` diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt deleted file mode 100644 index 6b76639..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt +++ /dev/null @@ -1 +0,0 @@ - argument_name argument description [default: "default_value"] diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml deleted file mode 100644 index 399a5c8..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - argument description - - default_value - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.json b/vendor/symfony/console/Tests/Fixtures/input_argument_4.json deleted file mode 100644 index 8067a4d..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"argument_name","is_required":true,"is_array":false,"description":"multiline argument description","default":null} diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.md b/vendor/symfony/console/Tests/Fixtures/input_argument_4.md deleted file mode 100644 index f026ab3..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.md +++ /dev/null @@ -1,8 +0,0 @@ -**argument_name:** - -* Name: argument_name -* Is required: yes -* Is array: no -* Description: multiline - argument description -* Default: `NULL` diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt deleted file mode 100644 index aa74e8c..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt +++ /dev/null @@ -1,2 +0,0 @@ - argument_name multiline - argument description diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml deleted file mode 100644 index 5ca135e..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - multiline -argument description - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.json b/vendor/symfony/console/Tests/Fixtures/input_definition_1.json deleted file mode 100644 index c7a7d83..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_1.json +++ /dev/null @@ -1 +0,0 @@ -{"arguments":[],"options":[]} diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.md b/vendor/symfony/console/Tests/Fixtures/input_definition_1.md deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_1.txt deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml deleted file mode 100644 index b5481ce..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.json b/vendor/symfony/console/Tests/Fixtures/input_definition_2.json deleted file mode 100644 index 9964a55..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.json +++ /dev/null @@ -1 +0,0 @@ -{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":[]} diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.md b/vendor/symfony/console/Tests/Fixtures/input_definition_2.md deleted file mode 100644 index 923191c..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.md +++ /dev/null @@ -1,9 +0,0 @@ -### Arguments: - -**argument_name:** - -* Name: argument_name -* Is required: yes -* Is array: no -* Description: -* Default: `NULL` diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt deleted file mode 100644 index 73b0f30..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt +++ /dev/null @@ -1,2 +0,0 @@ -Arguments: - argument_name diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml deleted file mode 100644 index 102efc1..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.json b/vendor/symfony/console/Tests/Fixtures/input_definition_3.json deleted file mode 100644 index 6a86056..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.json +++ /dev/null @@ -1 +0,0 @@ -{"arguments":[],"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}} diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.md b/vendor/symfony/console/Tests/Fixtures/input_definition_3.md deleted file mode 100644 index 40fd7b0..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.md +++ /dev/null @@ -1,11 +0,0 @@ -### Options: - -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: -* Default: `false` diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt deleted file mode 100644 index c02766f..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt +++ /dev/null @@ -1,2 +0,0 @@ -Options: - -o, --option_name diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml deleted file mode 100644 index bc95151..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.json b/vendor/symfony/console/Tests/Fixtures/input_definition_4.json deleted file mode 100644 index c5a0019..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.json +++ /dev/null @@ -1 +0,0 @@ -{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}} diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.md b/vendor/symfony/console/Tests/Fixtures/input_definition_4.md deleted file mode 100644 index a31feea..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.md +++ /dev/null @@ -1,21 +0,0 @@ -### Arguments: - -**argument_name:** - -* Name: argument_name -* Is required: yes -* Is array: no -* Description: -* Default: `NULL` - -### Options: - -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: -* Default: `false` diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt deleted file mode 100644 index 63aa81d..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt +++ /dev/null @@ -1,5 +0,0 @@ -Arguments: - argument_name - -Options: - -o, --option_name diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml deleted file mode 100644 index cffceec..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.json b/vendor/symfony/console/Tests/Fixtures/input_option_1.json deleted file mode 100644 index 60c5b56..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_1.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false} diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.md b/vendor/symfony/console/Tests/Fixtures/input_option_1.md deleted file mode 100644 index 6f9e9a7..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_1.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: -* Default: `false` diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.txt b/vendor/symfony/console/Tests/Fixtures/input_option_1.txt deleted file mode 100644 index 3a5e4ee..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_1.txt +++ /dev/null @@ -1 +0,0 @@ - -o, --option_name diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.xml b/vendor/symfony/console/Tests/Fixtures/input_option_1.xml deleted file mode 100644 index 8a64ea6..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_1.xml +++ /dev/null @@ -1,4 +0,0 @@ - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.json b/vendor/symfony/console/Tests/Fixtures/input_option_2.json deleted file mode 100644 index 04e4228..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_2.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":false,"description":"option description","default":"default_value"} diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.md b/vendor/symfony/console/Tests/Fixtures/input_option_2.md deleted file mode 100644 index 634ac0b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_2.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: yes -* Is value required: no -* Is multiple: no -* Description: option description -* Default: `'default_value'` diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.txt b/vendor/symfony/console/Tests/Fixtures/input_option_2.txt deleted file mode 100644 index 1009eff..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_2.txt +++ /dev/null @@ -1 +0,0 @@ - -o, --option_name[=OPTION_NAME] option description [default: "default_value"] diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.xml b/vendor/symfony/console/Tests/Fixtures/input_option_2.xml deleted file mode 100644 index 4afac5b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_2.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.json b/vendor/symfony/console/Tests/Fixtures/input_option_3.json deleted file mode 100644 index c1ea120..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_3.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option description","default":null} diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.md b/vendor/symfony/console/Tests/Fixtures/input_option_3.md deleted file mode 100644 index 3428289..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_3.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: option description -* Default: `NULL` diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.txt b/vendor/symfony/console/Tests/Fixtures/input_option_3.txt deleted file mode 100644 index 947bb65..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_3.txt +++ /dev/null @@ -1 +0,0 @@ - -o, --option_name=OPTION_NAME option description diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.xml b/vendor/symfony/console/Tests/Fixtures/input_option_3.xml deleted file mode 100644 index dcc0631..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_3.xml +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.json b/vendor/symfony/console/Tests/Fixtures/input_option_4.json deleted file mode 100644 index 1b671d8..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_4.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":true,"description":"option description","default":[]} diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.md b/vendor/symfony/console/Tests/Fixtures/input_option_4.md deleted file mode 100644 index 8ffba56..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_4.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: yes -* Is value required: no -* Is multiple: yes -* Description: option description -* Default: `array ()` diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.txt b/vendor/symfony/console/Tests/Fixtures/input_option_4.txt deleted file mode 100644 index 27edf77..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_4.txt +++ /dev/null @@ -1 +0,0 @@ - -o, --option_name[=OPTION_NAME] option description (multiple values allowed) diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.xml b/vendor/symfony/console/Tests/Fixtures/input_option_4.xml deleted file mode 100644 index 5e2418b..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_4.xml +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.json b/vendor/symfony/console/Tests/Fixtures/input_option_5.json deleted file mode 100644 index 35a1405..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_5.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"multiline option description","default":null} diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.md b/vendor/symfony/console/Tests/Fixtures/input_option_5.md deleted file mode 100644 index 82f51ca..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_5.md +++ /dev/null @@ -1,10 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: multiline - option description -* Default: `NULL` diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.txt b/vendor/symfony/console/Tests/Fixtures/input_option_5.txt deleted file mode 100644 index 4368883..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_5.txt +++ /dev/null @@ -1,2 +0,0 @@ - -o, --option_name=OPTION_NAME multiline - option description diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.xml b/vendor/symfony/console/Tests/Fixtures/input_option_5.xml deleted file mode 100644 index 90040cc..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_5.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.json b/vendor/symfony/console/Tests/Fixtures/input_option_6.json deleted file mode 100644 index d84e872..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_6.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"--option_name","shortcut":"-o|-O","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option with multiple shortcuts","default":null} diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.md b/vendor/symfony/console/Tests/Fixtures/input_option_6.md deleted file mode 100644 index ed1ea1c..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_6.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o|-O` -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: option with multiple shortcuts -* Default: `NULL` diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.txt b/vendor/symfony/console/Tests/Fixtures/input_option_6.txt deleted file mode 100644 index 0e6c975..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_6.txt +++ /dev/null @@ -1 +0,0 @@ - -o|O, --option_name=OPTION_NAME option with multiple shortcuts diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.xml b/vendor/symfony/console/Tests/Fixtures/input_option_6.xml deleted file mode 100644 index 06126a2..0000000 --- a/vendor/symfony/console/Tests/Fixtures/input_option_6.xml +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php deleted file mode 100644 index 774df26..0000000 --- a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Formatter; - -use Symfony\Component\Console\Formatter\OutputFormatterStyleStack; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class OutputFormatterStyleStackTest extends \PHPUnit_Framework_TestCase -{ - public function testPush() - { - $stack = new OutputFormatterStyleStack(); - $stack->push($s1 = new OutputFormatterStyle('white', 'black')); - $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); - - $this->assertEquals($s2, $stack->getCurrent()); - - $stack->push($s3 = new OutputFormatterStyle('green', 'red')); - - $this->assertEquals($s3, $stack->getCurrent()); - } - - public function testPop() - { - $stack = new OutputFormatterStyleStack(); - $stack->push($s1 = new OutputFormatterStyle('white', 'black')); - $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); - - $this->assertEquals($s2, $stack->pop()); - $this->assertEquals($s1, $stack->pop()); - } - - public function testPopEmpty() - { - $stack = new OutputFormatterStyleStack(); - $style = new OutputFormatterStyle(); - - $this->assertEquals($style, $stack->pop()); - } - - public function testPopNotLast() - { - $stack = new OutputFormatterStyleStack(); - $stack->push($s1 = new OutputFormatterStyle('white', 'black')); - $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); - $stack->push($s3 = new OutputFormatterStyle('green', 'red')); - - $this->assertEquals($s2, $stack->pop($s2)); - $this->assertEquals($s1, $stack->pop()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testInvalidPop() - { - $stack = new OutputFormatterStyleStack(); - $stack->push(new OutputFormatterStyle('white', 'black')); - $stack->pop(new OutputFormatterStyle('yellow', 'blue')); - } -} diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php deleted file mode 100644 index 0abfb3c..0000000 --- a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Formatter; - -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $style = new OutputFormatterStyle('green', 'black', array('bold', 'underscore')); - $this->assertEquals("\033[32;40;1;4mfoo\033[39;49;22;24m", $style->apply('foo')); - - $style = new OutputFormatterStyle('red', null, array('blink')); - $this->assertEquals("\033[31;5mfoo\033[39;25m", $style->apply('foo')); - - $style = new OutputFormatterStyle(null, 'white'); - $this->assertEquals("\033[47mfoo\033[49m", $style->apply('foo')); - } - - public function testForeground() - { - $style = new OutputFormatterStyle(); - - $style->setForeground('black'); - $this->assertEquals("\033[30mfoo\033[39m", $style->apply('foo')); - - $style->setForeground('blue'); - $this->assertEquals("\033[34mfoo\033[39m", $style->apply('foo')); - - $style->setForeground('default'); - $this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo')); - - $this->setExpectedException('InvalidArgumentException'); - $style->setForeground('undefined-color'); - } - - public function testBackground() - { - $style = new OutputFormatterStyle(); - - $style->setBackground('black'); - $this->assertEquals("\033[40mfoo\033[49m", $style->apply('foo')); - - $style->setBackground('yellow'); - $this->assertEquals("\033[43mfoo\033[49m", $style->apply('foo')); - - $style->setBackground('default'); - $this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo')); - - $this->setExpectedException('InvalidArgumentException'); - $style->setBackground('undefined-color'); - } - - public function testOptions() - { - $style = new OutputFormatterStyle(); - - $style->setOptions(array('reverse', 'conceal')); - $this->assertEquals("\033[7;8mfoo\033[27;28m", $style->apply('foo')); - - $style->setOption('bold'); - $this->assertEquals("\033[7;8;1mfoo\033[27;28;22m", $style->apply('foo')); - - $style->unsetOption('reverse'); - $this->assertEquals("\033[8;1mfoo\033[28;22m", $style->apply('foo')); - - $style->setOption('bold'); - $this->assertEquals("\033[8;1mfoo\033[28;22m", $style->apply('foo')); - - $style->setOptions(array('bold')); - $this->assertEquals("\033[1mfoo\033[22m", $style->apply('foo')); - - try { - $style->setOption('foo'); - $this->fail('->setOption() throws an \InvalidArgumentException when the option does not exist in the available options'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->setOption() throws an \InvalidArgumentException when the option does not exist in the available options'); - $this->assertContains('Invalid option specified: "foo"', $e->getMessage(), '->setOption() throws an \InvalidArgumentException when the option does not exist in the available options'); - } - - try { - $style->unsetOption('foo'); - $this->fail('->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options'); - $this->assertContains('Invalid option specified: "foo"', $e->getMessage(), '->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options'); - } - } -} diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php deleted file mode 100644 index 510a4e7..0000000 --- a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php +++ /dev/null @@ -1,273 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Formatter; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class OutputFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function testEmptyTag() - { - $formatter = new OutputFormatter(true); - $this->assertEquals('foo<>bar', $formatter->format('foo<>bar')); - } - - public function testLGCharEscaping() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals('fooformat('foo\\assertEquals('some info', $formatter->format('\\some info\\')); - $this->assertEquals('\\some info\\', OutputFormatter::escape('some info')); - - $this->assertEquals( - "\033[33mSymfony\\Component\\Console does work very well!\033[39m", - $formatter->format('Symfony\Component\Console does work very well!') - ); - } - - public function testBundledStyles() - { - $formatter = new OutputFormatter(true); - - $this->assertTrue($formatter->hasStyle('error')); - $this->assertTrue($formatter->hasStyle('info')); - $this->assertTrue($formatter->hasStyle('comment')); - $this->assertTrue($formatter->hasStyle('question')); - - $this->assertEquals( - "\033[37;41msome error\033[39;49m", - $formatter->format('some error') - ); - $this->assertEquals( - "\033[32msome info\033[39m", - $formatter->format('some info') - ); - $this->assertEquals( - "\033[33msome comment\033[39m", - $formatter->format('some comment') - ); - $this->assertEquals( - "\033[30;46msome question\033[39;49m", - $formatter->format('some question') - ); - } - - public function testNestedStyles() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals( - "\033[37;41msome \033[39;49m\033[32msome info\033[39m\033[37;41m error\033[39;49m", - $formatter->format('some some info error') - ); - } - - public function testAdjacentStyles() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals( - "\033[37;41msome error\033[39;49m\033[32msome info\033[39m", - $formatter->format('some errorsome info') - ); - } - - public function testStyleMatchingNotGreedy() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals( - "(\033[32m>=2.0,<2.3\033[39m)", - $formatter->format('(>=2.0,<2.3)') - ); - } - - public function testStyleEscaping() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals( - "(\033[32mz>=2.0,format('('.$formatter->escape('z>=2.0,)') - ); - - $this->assertEquals( - "\033[32msome error\033[39m", - $formatter->format(''.$formatter->escape('some error').'') - ); - } - - public function testDeepNestedStyles() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals( - "\033[37;41merror\033[39;49m\033[32minfo\033[39m\033[33mcomment\033[39m\033[37;41merror\033[39;49m", - $formatter->format('errorinfocommenterror') - ); - } - - public function testNewStyle() - { - $formatter = new OutputFormatter(true); - - $style = new OutputFormatterStyle('blue', 'white'); - $formatter->setStyle('test', $style); - - $this->assertEquals($style, $formatter->getStyle('test')); - $this->assertNotEquals($style, $formatter->getStyle('info')); - - $style = new OutputFormatterStyle('blue', 'white'); - $formatter->setStyle('b', $style); - - $this->assertEquals("\033[34;47msome \033[39;49m\033[34;47mcustom\033[39;49m\033[34;47m msg\033[39;49m", $formatter->format('some custom msg')); - } - - public function testRedefineStyle() - { - $formatter = new OutputFormatter(true); - - $style = new OutputFormatterStyle('blue', 'white'); - $formatter->setStyle('info', $style); - - $this->assertEquals("\033[34;47msome custom msg\033[39;49m", $formatter->format('some custom msg')); - } - - public function testInlineStyle() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals("\033[34;41msome text\033[39;49m", $formatter->format('some text')); - $this->assertEquals("\033[34;41msome text\033[39;49m", $formatter->format('some text')); - } - - public function testNonStyleTag() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals("\033[32msome \033[39m\033[32m\033[39m\033[32m \033[39m\033[32m\033[39m\033[32m styled \033[39m\033[32m

\033[39m\033[32msingle-char tag\033[39m\033[32m

\033[39m", $formatter->format('some styled

single-char tag

')); - } - - public function testFormatLongString() - { - $formatter = new OutputFormatter(true); - $long = str_repeat('\\', 14000); - $this->assertEquals("\033[37;41msome error\033[39;49m".$long, $formatter->format('some error'.$long)); - } - - public function testFormatToStringObject() - { - $formatter = new OutputFormatter(false); - $this->assertEquals( - 'some info', $formatter->format(new TableCell()) - ); - } - - public function testNotDecoratedFormatter() - { - $formatter = new OutputFormatter(false); - - $this->assertTrue($formatter->hasStyle('error')); - $this->assertTrue($formatter->hasStyle('info')); - $this->assertTrue($formatter->hasStyle('comment')); - $this->assertTrue($formatter->hasStyle('question')); - - $this->assertEquals( - 'some error', $formatter->format('some error') - ); - $this->assertEquals( - 'some info', $formatter->format('some info') - ); - $this->assertEquals( - 'some comment', $formatter->format('some comment') - ); - $this->assertEquals( - 'some question', $formatter->format('some question') - ); - - $formatter->setDecorated(true); - - $this->assertEquals( - "\033[37;41msome error\033[39;49m", $formatter->format('some error') - ); - $this->assertEquals( - "\033[32msome info\033[39m", $formatter->format('some info') - ); - $this->assertEquals( - "\033[33msome comment\033[39m", $formatter->format('some comment') - ); - $this->assertEquals( - "\033[30;46msome question\033[39;49m", $formatter->format('some question') - ); - } - - public function testContentWithLineBreaks() - { - $formatter = new OutputFormatter(true); - - $this->assertEquals(<<format(<< -some text
-EOF - )); - - $this->assertEquals(<<format(<<some text -
-EOF - )); - - $this->assertEquals(<<format(<< -some text -
-EOF - )); - - $this->assertEquals(<<format(<< -some text -more text -
-EOF - )); - } -} - -class TableCell -{ - public function __toString() - { - return 'some info'; - } -} diff --git a/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php b/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php deleted file mode 100644 index e332774..0000000 --- a/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\FormatterHelper; - -class FormatterHelperTest extends \PHPUnit_Framework_TestCase -{ - public function testFormatSection() - { - $formatter = new FormatterHelper(); - - $this->assertEquals( - '[cli] Some text to display', - $formatter->formatSection('cli', 'Some text to display'), - '::formatSection() formats a message in a section' - ); - } - - public function testFormatBlock() - { - $formatter = new FormatterHelper(); - - $this->assertEquals( - ' Some text to display ', - $formatter->formatBlock('Some text to display', 'error'), - '::formatBlock() formats a message in a block' - ); - - $this->assertEquals( - ' Some text to display '."\n". - ' foo bar ', - $formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'), - '::formatBlock() formats a message in a block' - ); - - $this->assertEquals( - ' '."\n". - ' Some text to display '."\n". - ' ', - $formatter->formatBlock('Some text to display', 'error', true), - '::formatBlock() formats a message in a block' - ); - } - - public function testFormatBlockWithDiacriticLetters() - { - if (!function_exists('mb_detect_encoding')) { - $this->markTestSkipped('This test requires mbstring to work.'); - } - - $formatter = new FormatterHelper(); - - $this->assertEquals( - ' '."\n". - ' Du texte à afficher '."\n". - ' ', - $formatter->formatBlock('Du texte à afficher', 'error', true), - '::formatBlock() formats a message in a block' - ); - } - - public function testFormatBlockWithDoubleWidthDiacriticLetters() - { - if (!extension_loaded('mbstring')) { - $this->markTestSkipped('This test requires mbstring to work.'); - } - $formatter = new FormatterHelper(); - $this->assertEquals( - ' '."\n". - ' 表示するテキスト '."\n". - ' ', - $formatter->formatBlock('表示するテキスト', 'error', true), - '::formatBlock() formats a message in a block' - ); - } - - public function testFormatBlockLGEscaping() - { - $formatter = new FormatterHelper(); - - $this->assertEquals( - ' '."\n". - ' \some info\ '."\n". - ' ', - $formatter->formatBlock('some info', 'error', true), - '::formatBlock() escapes \'<\' chars' - ); - } -} diff --git a/vendor/symfony/console/Tests/Helper/HelperSetTest.php b/vendor/symfony/console/Tests/Helper/HelperSetTest.php deleted file mode 100644 index bf58a45..0000000 --- a/vendor/symfony/console/Tests/Helper/HelperSetTest.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Command\Command; - -class HelperSetTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers \Symfony\Component\Console\Helper\HelperSet::__construct - */ - public function testConstructor() - { - $mock_helper = $this->getGenericMockHelper('fake_helper'); - $helperset = new HelperSet(array('fake_helper_alias' => $mock_helper)); - - $this->assertEquals($mock_helper, $helperset->get('fake_helper_alias'), '__construct sets given helper to helpers'); - $this->assertTrue($helperset->has('fake_helper_alias'), '__construct sets helper alias for given helper'); - } - - /** - * @covers \Symfony\Component\Console\Helper\HelperSet::set - */ - public function testSet() - { - $helperset = new HelperSet(); - $helperset->set($this->getGenericMockHelper('fake_helper', $helperset)); - $this->assertTrue($helperset->has('fake_helper'), '->set() adds helper to helpers'); - - $helperset = new HelperSet(); - $helperset->set($this->getGenericMockHelper('fake_helper_01', $helperset)); - $helperset->set($this->getGenericMockHelper('fake_helper_02', $helperset)); - $this->assertTrue($helperset->has('fake_helper_01'), '->set() will set multiple helpers on consecutive calls'); - $this->assertTrue($helperset->has('fake_helper_02'), '->set() will set multiple helpers on consecutive calls'); - - $helperset = new HelperSet(); - $helperset->set($this->getGenericMockHelper('fake_helper', $helperset), 'fake_helper_alias'); - $this->assertTrue($helperset->has('fake_helper'), '->set() adds helper alias when set'); - $this->assertTrue($helperset->has('fake_helper_alias'), '->set() adds helper alias when set'); - } - - /** - * @covers \Symfony\Component\Console\Helper\HelperSet::has - */ - public function testHas() - { - $helperset = new HelperSet(array('fake_helper_alias' => $this->getGenericMockHelper('fake_helper'))); - $this->assertTrue($helperset->has('fake_helper'), '->has() finds set helper'); - $this->assertTrue($helperset->has('fake_helper_alias'), '->has() finds set helper by alias'); - } - - /** - * @covers \Symfony\Component\Console\Helper\HelperSet::get - */ - public function testGet() - { - $helper_01 = $this->getGenericMockHelper('fake_helper_01'); - $helper_02 = $this->getGenericMockHelper('fake_helper_02'); - $helperset = new HelperSet(array('fake_helper_01_alias' => $helper_01, 'fake_helper_02_alias' => $helper_02)); - $this->assertEquals($helper_01, $helperset->get('fake_helper_01'), '->get() returns correct helper by name'); - $this->assertEquals($helper_01, $helperset->get('fake_helper_01_alias'), '->get() returns correct helper by alias'); - $this->assertEquals($helper_02, $helperset->get('fake_helper_02'), '->get() returns correct helper by name'); - $this->assertEquals($helper_02, $helperset->get('fake_helper_02_alias'), '->get() returns correct helper by alias'); - - $helperset = new HelperSet(); - try { - $helperset->get('foo'); - $this->fail('->get() throws \InvalidArgumentException when helper not found'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws \InvalidArgumentException when helper not found'); - $this->assertContains('The helper "foo" is not defined.', $e->getMessage(), '->get() throws \InvalidArgumentException when helper not found'); - } - } - - /** - * @covers \Symfony\Component\Console\Helper\HelperSet::setCommand - */ - public function testSetCommand() - { - $cmd_01 = new Command('foo'); - $cmd_02 = new Command('bar'); - - $helperset = new HelperSet(); - $helperset->setCommand($cmd_01); - $this->assertEquals($cmd_01, $helperset->getCommand(), '->setCommand() stores given command'); - - $helperset = new HelperSet(); - $helperset->setCommand($cmd_01); - $helperset->setCommand($cmd_02); - $this->assertEquals($cmd_02, $helperset->getCommand(), '->setCommand() overwrites stored command with consecutive calls'); - } - - /** - * @covers \Symfony\Component\Console\Helper\HelperSet::getCommand - */ - public function testGetCommand() - { - $cmd = new Command('foo'); - $helperset = new HelperSet(); - $helperset->setCommand($cmd); - $this->assertEquals($cmd, $helperset->getCommand(), '->getCommand() retrieves stored command'); - } - - /** - * @covers \Symfony\Component\Console\Helper\HelperSet::getIterator - */ - public function testIteration() - { - $helperset = new HelperSet(); - $helperset->set($this->getGenericMockHelper('fake_helper_01', $helperset)); - $helperset->set($this->getGenericMockHelper('fake_helper_02', $helperset)); - - $helpers = array('fake_helper_01', 'fake_helper_02'); - $i = 0; - - foreach ($helperset as $helper) { - $this->assertEquals($helpers[$i++], $helper->getName()); - } - } - - /** - * Create a generic mock for the helper interface. Optionally check for a call to setHelperSet with a specific - * helperset instance. - * - * @param string $name - * @param HelperSet $helperset allows a mock to verify a particular helperset set is being added to the Helper - */ - private function getGenericMockHelper($name, HelperSet $helperset = null) - { - $mock_helper = $this->getMock('\Symfony\Component\Console\Helper\HelperInterface'); - $mock_helper->expects($this->any()) - ->method('getName') - ->will($this->returnValue($name)); - - if ($helperset) { - $mock_helper->expects($this->any()) - ->method('setHelperSet') - ->with($this->equalTo($helperset)); - } - - return $mock_helper; - } -} diff --git a/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php deleted file mode 100644 index e130cdc..0000000 --- a/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php +++ /dev/null @@ -1,195 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Helper\DialogHelper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @group legacy - */ -class LegacyDialogHelperTest extends \PHPUnit_Framework_TestCase -{ - public function testSelect() - { - $dialog = new DialogHelper(); - - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $heroes = array('Superman', 'Batman', 'Spiderman'); - - $dialog->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n")); - $this->assertEquals('2', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '2')); - $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes)); - $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes)); - $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', false)); - - rewind($output->getStream()); - $this->assertContains('Input "Fabien" is not a superhero!', stream_get_contents($output->getStream())); - - try { - $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, 1)); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('Value "Fabien" is invalid', $e->getMessage()); - } - - $this->assertEquals(array('1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '0,1', false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, ' 0 , 1 ', false, 'Input "%s" is not a superhero!', true)); - } - - public function testAsk() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n8AM\n")); - - $this->assertEquals('2PM', $dialog->ask($this->getOutputStream(), 'What time is it?', '2PM')); - $this->assertEquals('8AM', $dialog->ask($output = $this->getOutputStream(), 'What time is it?', '2PM')); - - rewind($output->getStream()); - $this->assertEquals('What time is it?', stream_get_contents($output->getStream())); - } - - public function testAskWithAutocomplete() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stty` is required to test autocomplete functionality'); - } - - // Acm - // AcsTest - // - // - // Test - // - // S - // F00oo - $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n"); - - $dialog = new DialogHelper(); - $dialog->setInputStream($inputStream); - - $bundles = array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle'); - - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AsseticBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FrameworkBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('SecurityBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FooBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AsseticBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FooBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - } - - /** - * @group tty - */ - public function testAskHiddenResponse() - { - if ('\\' === DIRECTORY_SEPARATOR) { - $this->markTestSkipped('This test is not supported on Windows'); - } - - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("8AM\n")); - - $this->assertEquals('8AM', $dialog->askHiddenResponse($this->getOutputStream(), 'What time is it?')); - } - - public function testAskConfirmation() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?')); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("y\nyes\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("n\nno\n")); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - } - - public function testAskAndValidate() - { - $dialog = new DialogHelper(); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = 'What color was the white horse of Henry IV?'; - $error = 'This is not a color!'; - $validator = function ($color) use ($error) { - if (!in_array($color, array('white', 'black'))) { - throw new \InvalidArgumentException($error); - } - - return $color; - }; - - $dialog->setInputStream($this->getInputStream("\nblack\n")); - $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - $this->assertEquals('black', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - - $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n")); - try { - $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals($error, $e->getMessage()); - } - } - - public function testNoInteraction() - { - $dialog = new DialogHelper(); - - $input = new ArrayInput(array()); - $input->setInteractive(false); - - $dialog->setInput($input); - - $this->assertEquals('not yet', $dialog->ask($this->getOutputStream(), 'Do you have a job?', 'not yet')); - } - - protected function getInputStream($input) - { - $stream = fopen('php://memory', 'r+', false); - fwrite($stream, $input); - rewind($stream); - - return $stream; - } - - protected function getOutputStream() - { - return new StreamOutput(fopen('php://memory', 'r+', false)); - } - - private function hasSttyAvailable() - { - exec('stty 2>&1', $output, $exitcode); - - return $exitcode === 0; - } -} diff --git a/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php deleted file mode 100644 index e027246..0000000 --- a/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php +++ /dev/null @@ -1,240 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\ProgressHelper; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Tests; - -require_once __DIR__.'/../ClockMock.php'; - -/** - * @group legacy - */ -class LegacyProgressHelperTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - Tests\with_clock_mock(true); - } - - protected function tearDown() - { - Tests\with_clock_mock(false); - } - - public function testAdvance() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 1 [->--------------------------]'), stream_get_contents($output->getStream())); - } - - public function testAdvanceWithStep() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(5); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); - } - - public function testAdvanceMultipleTimes() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(3); - $progress->advance(2); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 3 [--->------------------------]').$this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); - } - - public function testCustomizations() - { - $progress = new ProgressHelper(); - $progress->setBarWidth(10); - $progress->setBarCharacter('_'); - $progress->setEmptyBarCharacter(' '); - $progress->setProgressCharacter('/'); - $progress->setFormat(' %current%/%max% [%bar%] %percent%%'); - $progress->start($output = $this->getOutputStream(), 10); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 1/10 [_/ ] 10%'), stream_get_contents($output->getStream())); - } - - public function testPercent() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 0/50 [>---------------------------] 0%').$this->generateOutput(' 1/50 [>---------------------------] 2%').$this->generateOutput(' 2/50 [=>--------------------------] 4%'), stream_get_contents($output->getStream())); - } - - public function testOverwriteWithShorterLine() - { - $progress = new ProgressHelper(); - $progress->setFormat(' %current%/%max% [%bar%] %percent%%'); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - - // set shorter format - $progress->setFormat(' %current%/%max% [%bar%]'); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 2/50 [=>--------------------------] '), - stream_get_contents($output->getStream()) - ); - } - - public function testSetCurrentProgress() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - $progress->setCurrent(15); - $progress->setCurrent(25); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 15/50 [========>-------------------] 30%'). - $this->generateOutput(' 25/50 [==============>-------------] 50%'), - stream_get_contents($output->getStream()) - ); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You must start the progress bar - */ - public function testSetCurrentBeforeStarting() - { - $progress = new ProgressHelper(); - $progress->setCurrent(15); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You can't regress the progress bar - */ - public function testRegressProgress() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->setCurrent(15); - $progress->setCurrent(10); - } - - public function testRedrawFrequency() - { - $progress = $this->getMock('Symfony\Component\Console\Helper\ProgressHelper', array('display')); - $progress->expects($this->exactly(4)) - ->method('display'); - - $progress->setRedrawFrequency(2); - - $progress->start($output = $this->getOutputStream(), 6); - $progress->setCurrent(1); - $progress->advance(2); - $progress->advance(2); - $progress->advance(1); - } - - public function testMultiByteSupport() - { - if (!function_exists('mb_strlen') || (false === $encoding = mb_detect_encoding('■'))) { - $this->markTestSkipped('The mbstring extension is needed for multi-byte support'); - } - - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->setBarCharacter('■'); - $progress->advance(3); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 3 [■■■>------------------------]'), stream_get_contents($output->getStream())); - } - - public function testClear() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->setCurrent(25); - $progress->clear(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 25/50 [==============>-------------] 50%').$this->generateOutput(''), - stream_get_contents($output->getStream()) - ); - } - - public function testPercentNotHundredBeforeComplete() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 200); - $progress->display(); - $progress->advance(199); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 0/200 [>---------------------------] 0%').$this->generateOutput(' 199/200 [===========================>] 99%').$this->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output->getStream())); - } - - public function testNonDecoratedOutput() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(false)); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals('', stream_get_contents($output->getStream())); - } - - protected function getOutputStream($decorated = true) - { - return new StreamOutput(fopen('php://memory', 'r+', false), StreamOutput::VERBOSITY_NORMAL, $decorated); - } - - protected $lastMessagesLength; - - protected function generateOutput($expected) - { - $expectedout = $expected; - - if ($this->lastMessagesLength !== null) { - $expectedout = str_pad($expected, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT); - } - - $this->lastMessagesLength = strlen($expectedout); - - return "\x0D".$expectedout; - } -} diff --git a/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php deleted file mode 100644 index 3b32423..0000000 --- a/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php +++ /dev/null @@ -1,324 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\TableHelper; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @group legacy - */ -class LegacyTableHelperTest extends \PHPUnit_Framework_TestCase -{ - protected $stream; - - protected function setUp() - { - $this->stream = fopen('php://memory', 'r+'); - } - - protected function tearDown() - { - fclose($this->stream); - $this->stream = null; - } - - /** - * @dataProvider testRenderProvider - */ - public function testRender($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRows($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->addRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setLayout($layout) - ; - foreach ($rows as $row) { - $table->addRow($row); - } - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - public function testRenderProvider() - { - $books = array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - ); - - return array( - array( - array('ISBN', 'Title', 'Author'), - $books, - TableHelper::LAYOUT_DEFAULT, -<< array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<
array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-700', 'Divine Com', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<
99921-58-10-700 | Divine Com | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -+----------------------------------+----------------------+-----------------+ - -TABLE - ), - ); - } - - public function testRenderMultiByte() - { - if (!function_exists('mb_strwidth')) { - $this->markTestSkipped('The "mbstring" extension is not available'); - } - - $table = new TableHelper(); - $table - ->setHeaders(array('■■')) - ->setRows(array(array(1234))) - ->setLayout(TableHelper::LAYOUT_DEFAULT) - ; - $table->render($output = $this->getOutputStream()); - - $expected = -<<
assertEquals($expected, $this->getOutputContent($output)); - } - - public function testRenderFullWidthCharacters() - { - if (!function_exists('mb_strwidth')) { - $this->markTestSkipped('The "mbstring" extension is not available'); - } - - $table = new TableHelper(); - $table - ->setHeaders(array('あいうえお')) - ->setRows(array(array(1234567890))) - ->setLayout(TableHelper::LAYOUT_DEFAULT) - ; - $table->render($output = $this->getOutputStream()); - - $expected = - <<
assertEquals($expected, $this->getOutputContent($output)); - } - - protected function getOutputStream() - { - return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false); - } - - protected function getOutputContent(StreamOutput $output) - { - rewind($output->getStream()); - - return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream())); - } -} diff --git a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php b/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php deleted file mode 100644 index a51fb43..0000000 --- a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\DebugFormatterHelper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Helper\ProcessHelper; -use Symfony\Component\Process\Process; - -class ProcessHelperTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider provideCommandsAndOutput - */ - public function testVariousProcessRuns($expected, $cmd, $verbosity, $error) - { - $helper = new ProcessHelper(); - $helper->setHelperSet(new HelperSet(array(new DebugFormatterHelper()))); - $output = $this->getOutputStream($verbosity); - $helper->run($output, $cmd, $error); - $this->assertEquals($expected, $this->getOutput($output)); - } - - public function testPassedCallbackIsExecuted() - { - $helper = new ProcessHelper(); - $helper->setHelperSet(new HelperSet(array(new DebugFormatterHelper()))); - $output = $this->getOutputStream(StreamOutput::VERBOSITY_NORMAL); - - $executed = false; - $callback = function () use (&$executed) { $executed = true; }; - - $helper->run($output, 'php -r "echo 42;"', null, $callback); - $this->assertTrue($executed); - } - - public function provideCommandsAndOutput() - { - $successOutputVerbose = <<42';" - OUT 42 - RES Command ran successfully - -EOT; - $successOutputProcessDebug = <<42\';"', StreamOutput::VERBOSITY_DEBUG, null), - array('', 'php -r "syntax error"', StreamOutput::VERBOSITY_VERBOSE, null), - array($syntaxErrorOutputVerbose, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, null), - array($syntaxErrorOutputDebug, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, null), - array($errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERBOSE, $errorMessage), - array($syntaxErrorOutputVerbose.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, $errorMessage), - array($syntaxErrorOutputDebug.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, $errorMessage), - array($successOutputProcessDebug, array('php', '-r', 'echo 42;'), StreamOutput::VERBOSITY_DEBUG, null), - array($successOutputDebug, new Process('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUG, null), - ); - } - - private function getOutputStream($verbosity) - { - return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, false); - } - - private function getOutput(StreamOutput $output) - { - rewind($output->getStream()); - - return stream_get_contents($output->getStream()); - } -} diff --git a/vendor/symfony/console/Tests/Helper/ProgressBarTest.php b/vendor/symfony/console/Tests/Helper/ProgressBarTest.php deleted file mode 100644 index e37853e..0000000 --- a/vendor/symfony/console/Tests/Helper/ProgressBarTest.php +++ /dev/null @@ -1,612 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Tests; - -class ProgressBarTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - Tests\with_clock_mock(true); - } - - protected function tearDown() - { - Tests\with_clock_mock(false); - } - - public function testMultipleStart() - { - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->start(); - $bar->advance(); - $bar->start(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0 [>---------------------------]'). - $this->generateOutput(' 1 [->--------------------------]'). - $this->generateOutput(' 0 [>---------------------------]'), - stream_get_contents($output->getStream()) - ); - } - - public function testAdvance() - { - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->start(); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0 [>---------------------------]'). - $this->generateOutput(' 1 [->--------------------------]'), - stream_get_contents($output->getStream()) - ); - } - - public function testAdvanceWithStep() - { - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->start(); - $bar->advance(5); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0 [>---------------------------]'). - $this->generateOutput(' 5 [----->----------------------]'), - stream_get_contents($output->getStream()) - ); - } - - public function testAdvanceMultipleTimes() - { - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->start(); - $bar->advance(3); - $bar->advance(2); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0 [>---------------------------]'). - $this->generateOutput(' 3 [--->------------------------]'). - $this->generateOutput(' 5 [----->----------------------]'), - stream_get_contents($output->getStream()) - ); - } - - public function testAdvanceOverMax() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 10); - $bar->setProgress(9); - $bar->advance(); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 9/10 [=========================>--] 90%'). - $this->generateOutput(' 10/10 [============================] 100%'). - $this->generateOutput(' 11/11 [============================] 100%'), - stream_get_contents($output->getStream()) - ); - } - - public function testCustomizations() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 10); - $bar->setBarWidth(10); - $bar->setBarCharacter('_'); - $bar->setEmptyBarCharacter(' '); - $bar->setProgressCharacter('/'); - $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%%'); - $bar->start(); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/10 [/ ] 0%'). - $this->generateOutput(' 1/10 [_/ ] 10%'), - stream_get_contents($output->getStream()) - ); - } - - public function testDisplayWithoutStart() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 50); - $bar->display(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'), - stream_get_contents($output->getStream()) - ); - } - - public function testDisplayWithQuietVerbosity() - { - $bar = new ProgressBar($output = $this->getOutputStream(true, StreamOutput::VERBOSITY_QUIET), 50); - $bar->display(); - - rewind($output->getStream()); - $this->assertEquals( - '', - stream_get_contents($output->getStream()) - ); - } - - public function testFinishWithoutStart() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 50); - $bar->finish(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 50/50 [============================] 100%'), - stream_get_contents($output->getStream()) - ); - } - - public function testPercent() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 50); - $bar->start(); - $bar->display(); - $bar->advance(); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 2/50 [=>--------------------------] 4%'), - stream_get_contents($output->getStream()) - ); - } - - public function testOverwriteWithShorterLine() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 50); - $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%%'); - $bar->start(); - $bar->display(); - $bar->advance(); - - // set shorter format - $bar->setFormat(' %current%/%max% [%bar%]'); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 2/50 [=>--------------------------] '), - stream_get_contents($output->getStream()) - ); - } - - public function testStartWithMax() - { - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->setFormat('%current%/%max% [%bar%]'); - $bar->start(50); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------]'). - $this->generateOutput(' 1/50 [>---------------------------]'), - stream_get_contents($output->getStream()) - ); - } - - public function testSetCurrentProgress() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 50); - $bar->start(); - $bar->display(); - $bar->advance(); - $bar->setProgress(15); - $bar->setProgress(25); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 15/50 [========>-------------------] 30%'). - $this->generateOutput(' 25/50 [==============>-------------] 50%'), - stream_get_contents($output->getStream()) - ); - } - - /** - */ - public function testSetCurrentBeforeStarting() - { - $bar = new ProgressBar($this->getOutputStream()); - $bar->setProgress(15); - $this->assertNotNull($bar->getStartTime()); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You can't regress the progress bar - */ - public function testRegressProgress() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 50); - $bar->start(); - $bar->setProgress(15); - $bar->setProgress(10); - } - - public function testRedrawFrequency() - { - $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($output = $this->getOutputStream(), 6)); - $bar->expects($this->exactly(4))->method('display'); - - $bar->setRedrawFrequency(2); - $bar->start(); - $bar->setProgress(1); - $bar->advance(2); - $bar->advance(2); - $bar->advance(1); - } - - public function testMultiByteSupport() - { - if (!function_exists('mb_strlen') || (false === $encoding = mb_detect_encoding('■'))) { - $this->markTestSkipped('The mbstring extension is needed for multi-byte support'); - } - - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->start(); - $bar->setBarCharacter('■'); - $bar->advance(3); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0 [>---------------------------]'). - $this->generateOutput(' 3 [■■■>------------------------]'), - stream_get_contents($output->getStream()) - ); - } - - public function testClear() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 50); - $bar->start(); - $bar->setProgress(25); - $bar->clear(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 25/50 [==============>-------------] 50%'). - $this->generateOutput(' '), - stream_get_contents($output->getStream()) - ); - } - - public function testPercentNotHundredBeforeComplete() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 200); - $bar->start(); - $bar->display(); - $bar->advance(199); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/200 [>---------------------------] 0%'). - $this->generateOutput(' 0/200 [>---------------------------] 0%'). - $this->generateOutput(' 199/200 [===========================>] 99%'). - $this->generateOutput(' 200/200 [============================] 100%'), - stream_get_contents($output->getStream()) - ); - } - - public function testNonDecoratedOutput() - { - $bar = new ProgressBar($output = $this->getOutputStream(false), 200); - $bar->start(); - - for ($i = 0; $i < 200; ++$i) { - $bar->advance(); - } - - $bar->finish(); - - rewind($output->getStream()); - $this->assertEquals( - ' 0/200 [>---------------------------] 0%'.PHP_EOL. - ' 20/200 [==>-------------------------] 10%'.PHP_EOL. - ' 40/200 [=====>----------------------] 20%'.PHP_EOL. - ' 60/200 [========>-------------------] 30%'.PHP_EOL. - ' 80/200 [===========>----------------] 40%'.PHP_EOL. - ' 100/200 [==============>-------------] 50%'.PHP_EOL. - ' 120/200 [================>-----------] 60%'.PHP_EOL. - ' 140/200 [===================>--------] 70%'.PHP_EOL. - ' 160/200 [======================>-----] 80%'.PHP_EOL. - ' 180/200 [=========================>--] 90%'.PHP_EOL. - ' 200/200 [============================] 100%', - stream_get_contents($output->getStream()) - ); - } - - public function testNonDecoratedOutputWithClear() - { - $bar = new ProgressBar($output = $this->getOutputStream(false), 50); - $bar->start(); - $bar->setProgress(25); - $bar->clear(); - $bar->setProgress(50); - $bar->finish(); - - rewind($output->getStream()); - $this->assertEquals( - ' 0/50 [>---------------------------] 0%'.PHP_EOL. - ' 25/50 [==============>-------------] 50%'.PHP_EOL. - ' 50/50 [============================] 100%', - stream_get_contents($output->getStream()) - ); - } - - public function testNonDecoratedOutputWithoutMax() - { - $bar = new ProgressBar($output = $this->getOutputStream(false)); - $bar->start(); - $bar->advance(); - - rewind($output->getStream()); - $this->assertEquals( - ' 0 [>---------------------------]'.PHP_EOL. - ' 1 [->--------------------------]', - stream_get_contents($output->getStream()) - ); - } - - public function testParallelBars() - { - $output = $this->getOutputStream(); - $bar1 = new ProgressBar($output, 2); - $bar2 = new ProgressBar($output, 3); - $bar2->setProgressCharacter('#'); - $bar3 = new ProgressBar($output); - - $bar1->start(); - $output->write("\n"); - $bar2->start(); - $output->write("\n"); - $bar3->start(); - - for ($i = 1; $i <= 3; ++$i) { - // up two lines - $output->write("\033[2A"); - if ($i <= 2) { - $bar1->advance(); - } - $output->write("\n"); - $bar2->advance(); - $output->write("\n"); - $bar3->advance(); - } - $output->write("\033[2A"); - $output->write("\n"); - $output->write("\n"); - $bar3->finish(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/2 [>---------------------------] 0%')."\n". - $this->generateOutput(' 0/3 [#---------------------------] 0%')."\n". - rtrim($this->generateOutput(' 0 [>---------------------------]')). - - "\033[2A". - $this->generateOutput(' 1/2 [==============>-------------] 50%')."\n". - $this->generateOutput(' 1/3 [=========#------------------] 33%')."\n". - rtrim($this->generateOutput(' 1 [->--------------------------]')). - - "\033[2A". - $this->generateOutput(' 2/2 [============================] 100%')."\n". - $this->generateOutput(' 2/3 [==================#---------] 66%')."\n". - rtrim($this->generateOutput(' 2 [-->-------------------------]')). - - "\033[2A". - "\n". - $this->generateOutput(' 3/3 [============================] 100%')."\n". - rtrim($this->generateOutput(' 3 [--->------------------------]')). - - "\033[2A". - "\n". - "\n". - rtrim($this->generateOutput(' 3 [============================]')), - stream_get_contents($output->getStream()) - ); - } - - public function testWithoutMax() - { - $output = $this->getOutputStream(); - - $bar = new ProgressBar($output); - $bar->start(); - $bar->advance(); - $bar->advance(); - $bar->advance(); - $bar->finish(); - - rewind($output->getStream()); - $this->assertEquals( - rtrim($this->generateOutput(' 0 [>---------------------------]')). - rtrim($this->generateOutput(' 1 [->--------------------------]')). - rtrim($this->generateOutput(' 2 [-->-------------------------]')). - rtrim($this->generateOutput(' 3 [--->------------------------]')). - rtrim($this->generateOutput(' 3 [============================]')), - stream_get_contents($output->getStream()) - ); - } - - public function testAddingPlaceholderFormatter() - { - ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function (ProgressBar $bar) { - return $bar->getMaxSteps() - $bar->getProgress(); - }); - $bar = new ProgressBar($output = $this->getOutputStream(), 3); - $bar->setFormat(' %remaining_steps% [%bar%]'); - - $bar->start(); - $bar->advance(); - $bar->finish(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 3 [>---------------------------]'). - $this->generateOutput(' 2 [=========>------------------]'). - $this->generateOutput(' 0 [============================]'), - stream_get_contents($output->getStream()) - ); - } - - public function testMultilineFormat() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 3); - $bar->setFormat("%bar%\nfoobar"); - - $bar->start(); - $bar->advance(); - $bar->clear(); - $bar->finish(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(">---------------------------\nfoobar"). - $this->generateOutput("=========>------------------\nfoobar "). - $this->generateOutput(" \n "). - $this->generateOutput("============================\nfoobar "), - stream_get_contents($output->getStream()) - ); - } - - /** - * @requires extension mbstring - */ - public function testAnsiColorsAndEmojis() - { - $bar = new ProgressBar($output = $this->getOutputStream(), 15); - ProgressBar::setPlaceholderFormatterDefinition('memory', function (ProgressBar $bar) { - static $i = 0; - $mem = 100000 * $i; - $colors = $i++ ? '41;37' : '44;37'; - - return "\033[".$colors.'m '.Helper::formatMemory($mem)." \033[0m"; - }); - $bar->setFormat(" \033[44;37m %title:-37s% \033[0m\n %current%/%max% %bar% %percent:3s%%\n 🏁 %remaining:-10s% %memory:37s%"); - $bar->setBarCharacter($done = "\033[32m●\033[0m"); - $bar->setEmptyBarCharacter($empty = "\033[31m●\033[0m"); - $bar->setProgressCharacter($progress = "\033[32m➤ \033[0m"); - - $bar->setMessage('Starting the demo... fingers crossed', 'title'); - $bar->start(); - $bar->setMessage('Looks good to me...', 'title'); - $bar->advance(4); - $bar->setMessage('Thanks, bye', 'title'); - $bar->finish(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput( - " \033[44;37m Starting the demo... fingers crossed \033[0m\n". - ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n". - " \xf0\x9f\x8f\x81 1 sec \033[44;37m 0 B \033[0m" - ). - $this->generateOutput( - " \033[44;37m Looks good to me... \033[0m\n". - ' 4/15 '.str_repeat($done, 7).$progress.str_repeat($empty, 19)." 26%\n". - " \xf0\x9f\x8f\x81 1 sec \033[41;37m 97 KiB \033[0m" - ). - $this->generateOutput( - " \033[44;37m Thanks, bye \033[0m\n". - ' 15/15 '.str_repeat($done, 28)." 100%\n". - " \xf0\x9f\x8f\x81 1 sec \033[41;37m 195 KiB \033[0m" - ), - stream_get_contents($output->getStream()) - ); - } - - public function testSetFormat() - { - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->setFormat('normal'); - $bar->start(); - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0 [>---------------------------]'), - stream_get_contents($output->getStream()) - ); - - $bar = new ProgressBar($output = $this->getOutputStream(), 10); - $bar->setFormat('normal'); - $bar->start(); - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/10 [>---------------------------] 0%'), - stream_get_contents($output->getStream()) - ); - } - - /** - * @dataProvider provideFormat - */ - public function testFormatsWithoutMax($format) - { - $bar = new ProgressBar($output = $this->getOutputStream()); - $bar->setFormat($format); - $bar->start(); - - rewind($output->getStream()); - $this->assertNotEmpty(stream_get_contents($output->getStream())); - } - - /** - * Provides each defined format. - * - * @return array - */ - public function provideFormat() - { - return array( - array('normal'), - array('verbose'), - array('very_verbose'), - array('debug'), - ); - } - - protected function getOutputStream($decorated = true, $verbosity = StreamOutput::VERBOSITY_NORMAL) - { - return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated); - } - - protected function generateOutput($expected) - { - $count = substr_count($expected, "\n"); - - return "\x0D".($count ? sprintf("\033[%dA", $count) : '').$expected; - } -} diff --git a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php deleted file mode 100644 index a1f85b1..0000000 --- a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php +++ /dev/null @@ -1,383 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; - -/** - * @group tty - */ -class QuestionHelperTest extends \PHPUnit_Framework_TestCase -{ - public function testAskChoice() - { - $questionHelper = new QuestionHelper(); - - $helperSet = new HelperSet(array(new FormatterHelper())); - $questionHelper->setHelperSet($helperSet); - - $heroes = array('Superman', 'Batman', 'Spiderman'); - - $questionHelper->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n")); - - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '2'); - $question->setMaxAttempts(1); - // first answer is an empty answer, we're supposed to receive the default value - $this->assertEquals('Spiderman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes); - $question->setMaxAttempts(1); - $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes); - $question->setErrorMessage('Input "%s" is not a superhero!'); - $question->setMaxAttempts(2); - $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question)); - - rewind($output->getStream()); - $stream = stream_get_contents($output->getStream()); - $this->assertContains('Input "Fabien" is not a superhero!', $stream); - - try { - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1'); - $question->setMaxAttempts(1); - $questionHelper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('Value "Fabien" is invalid', $e->getMessage()); - } - - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null); - $question->setMaxAttempts(1); - $question->setMultiselect(true); - - $this->assertEquals(array('Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0,1'); - $question->setMaxAttempts(1); - $question->setMultiselect(true); - - $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, ' 0 , 1 '); - $question->setMaxAttempts(1); - $question->setMultiselect(true); - - $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - } - - public function testAsk() - { - $dialog = new QuestionHelper(); - - $dialog->setInputStream($this->getInputStream("\n8AM\n")); - - $question = new Question('What time is it?', '2PM'); - $this->assertEquals('2PM', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - - $question = new Question('What time is it?', '2PM'); - $this->assertEquals('8AM', $dialog->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question)); - - rewind($output->getStream()); - $this->assertEquals('What time is it?', stream_get_contents($output->getStream())); - } - - public function testAskWithAutocomplete() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stty` is required to test autocomplete functionality'); - } - - // Acm - // AcsTest - // - // - // Test - // - // S - // F00oo - $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n"); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($inputStream); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new Question('Please select a bundle', 'FrameworkBundle'); - $question->setAutocompleterValues(array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle')); - - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('FrameworkBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('SecurityBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('FooBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('AsseticBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('FooBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - } - - public function testAskHiddenResponse() - { - if ('\\' === DIRECTORY_SEPARATOR) { - $this->markTestSkipped('This test is not supported on Windows'); - } - - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream("8AM\n")); - - $question = new Question('What time is it?'); - $question->setHidden(true); - - $this->assertEquals('8AM', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - } - - /** - * @dataProvider getAskConfirmationData - */ - public function testAskConfirmation($question, $expected, $default = true) - { - $dialog = new QuestionHelper(); - - $dialog->setInputStream($this->getInputStream($question."\n")); - $question = new ConfirmationQuestion('Do you like French fries?', $default); - $this->assertEquals($expected, $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question), 'confirmation question should '.($expected ? 'pass' : 'cancel')); - } - - public function getAskConfirmationData() - { - return array( - array('', true), - array('', false, false), - array('y', true), - array('yes', true), - array('n', false), - array('no', false), - ); - } - - public function testAskConfirmationWithCustomTrueAnswer() - { - $dialog = new QuestionHelper(); - - $dialog->setInputStream($this->getInputStream("j\ny\n")); - $question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i'); - $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i'); - $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - } - - public function testAskAndValidate() - { - $dialog = new QuestionHelper(); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $error = 'This is not a color!'; - $validator = function ($color) use ($error) { - if (!in_array($color, array('white', 'black'))) { - throw new \InvalidArgumentException($error); - } - - return $color; - }; - - $question = new Question('What color was the white horse of Henry IV?', 'white'); - $question->setValidator($validator); - $question->setMaxAttempts(2); - - $dialog->setInputStream($this->getInputStream("\nblack\n")); - $this->assertEquals('white', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('black', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - - $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n")); - try { - $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals($error, $e->getMessage()); - } - } - - /** - * @dataProvider simpleAnswerProvider - */ - public function testSelectChoiceFromSimpleChoices($providedAnswer, $expectedValue) - { - $possibleChoices = array( - 'My environment 1', - 'My environment 2', - 'My environment 3', - ); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream($providedAnswer."\n")); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices); - $question->setMaxAttempts(1); - $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); - - $this->assertSame($expectedValue, $answer); - } - - public function simpleAnswerProvider() - { - return array( - array(0, 'My environment 1'), - array(1, 'My environment 2'), - array(2, 'My environment 3'), - array('My environment 1', 'My environment 1'), - array('My environment 2', 'My environment 2'), - array('My environment 3', 'My environment 3'), - ); - } - - /** - * @dataProvider mixedKeysChoiceListAnswerProvider - */ - public function testChoiceFromChoicelistWithMixedKeys($providedAnswer, $expectedValue) - { - $possibleChoices = array( - '0' => 'No environment', - '1' => 'My environment 1', - 'env_2' => 'My environment 2', - 3 => 'My environment 3', - ); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream($providedAnswer."\n")); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices); - $question->setMaxAttempts(1); - $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); - - $this->assertSame($expectedValue, $answer); - } - - public function mixedKeysChoiceListAnswerProvider() - { - return array( - array('0', '0'), - array('No environment', '0'), - array('1', '1'), - array('env_2', 'env_2'), - array(3, '3'), - array('My environment 1', '1'), - ); - } - - /** - * @dataProvider answerProvider - */ - public function testSelectChoiceFromChoiceList($providedAnswer, $expectedValue) - { - $possibleChoices = array( - 'env_1' => 'My environment 1', - 'env_2' => 'My environment', - 'env_3' => 'My environment', - ); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream($providedAnswer."\n")); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices); - $question->setMaxAttempts(1); - $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); - - $this->assertSame($expectedValue, $answer); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The provided answer is ambiguous. Value should be one of env_2 or env_3. - */ - public function testAmbiguousChoiceFromChoicelist() - { - $possibleChoices = array( - 'env_1' => 'My first environment', - 'env_2' => 'My environment', - 'env_3' => 'My environment', - ); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream("My environment\n")); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices); - $question->setMaxAttempts(1); - - $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); - } - - public function answerProvider() - { - return array( - array('env_1', 'env_1'), - array('env_2', 'env_2'), - array('env_3', 'env_3'), - array('My environment 1', 'env_1'), - ); - } - - public function testNoInteraction() - { - $dialog = new QuestionHelper(); - $question = new Question('Do you have a job?', 'not yet'); - $this->assertEquals('not yet', $dialog->ask($this->createInputInterfaceMock(false), $this->createOutputInterface(), $question)); - } - - protected function getInputStream($input) - { - $stream = fopen('php://memory', 'r+', false); - fwrite($stream, $input); - rewind($stream); - - return $stream; - } - - protected function createOutputInterface() - { - return new StreamOutput(fopen('php://memory', 'r+', false)); - } - - protected function createInputInterfaceMock($interactive = true) - { - $mock = $this->getMock('Symfony\Component\Console\Input\InputInterface'); - $mock->expects($this->any()) - ->method('isInteractive') - ->will($this->returnValue($interactive)); - - return $mock; - } - - private function hasSttyAvailable() - { - exec('stty 2>&1', $output, $exitcode); - - return $exitcode === 0; - } -} diff --git a/vendor/symfony/console/Tests/Helper/TableStyleTest.php b/vendor/symfony/console/Tests/Helper/TableStyleTest.php deleted file mode 100644 index 587d841..0000000 --- a/vendor/symfony/console/Tests/Helper/TableStyleTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\TableStyle; - -class TableStyleTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH). - */ - public function testSetPadTypeWithInvalidType() - { - $style = new TableStyle(); - $style->setPadType('TEST'); - } -} diff --git a/vendor/symfony/console/Tests/Helper/TableTest.php b/vendor/symfony/console/Tests/Helper/TableTest.php deleted file mode 100644 index ad05379..0000000 --- a/vendor/symfony/console/Tests/Helper/TableTest.php +++ /dev/null @@ -1,568 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableStyle; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Output\StreamOutput; - -class TableTest extends \PHPUnit_Framework_TestCase -{ - protected $stream; - - protected function setUp() - { - $this->stream = fopen('php://memory', 'r+'); - } - - protected function tearDown() - { - fclose($this->stream); - $this->stream = null; - } - - /** - * @dataProvider testRenderProvider - */ - public function testRender($headers, $rows, $style, $expected) - { - $table = new Table($output = $this->getOutputStream()); - $table - ->setHeaders($headers) - ->setRows($rows) - ->setStyle($style) - ; - $table->render(); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRows($headers, $rows, $style, $expected) - { - $table = new Table($output = $this->getOutputStream()); - $table - ->setHeaders($headers) - ->addRows($rows) - ->setStyle($style) - ; - $table->render(); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected) - { - $table = new Table($output = $this->getOutputStream()); - $table - ->setHeaders($headers) - ->setStyle($style) - ; - foreach ($rows as $row) { - $table->addRow($row); - } - $table->render(); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - public function testRenderProvider() - { - $books = array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - ); - - return array( - array( - array('ISBN', 'Title', 'Author'), - $books, - 'default', -<<
array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - 'default', -<<
array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-700', 'Divine Com', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - 'default', -<<
99921-58-10-700 | Divine Com | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -+----------------------------------+----------------------+-----------------+ - -TABLE - ), - 'Cell with colspan' => array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - new TableSeparator(), - array(new TableCell('Divine Comedy(Dante Alighieri)', array('colspan' => 3))), - new TableSeparator(), - array( - new TableCell('Arduino: A Quick-Start Guide', array('colspan' => 2)), - 'Mark Schmidt', - ), - new TableSeparator(), - array( - '9971-5-0210-0', - new TableCell("A Tale of \nTwo Cities", array('colspan' => 2)), - ), - ), - 'default', -<<
array( - array('ISBN', 'Title', 'Author'), - array( - array( - new TableCell('9971-5-0210-0', array('rowspan' => 3)), - 'Divine Comedy', - 'Dante Alighieri', - ), - array('A Tale of Two Cities', 'Charles Dickens'), - array("The Lord of \nthe Rings", "J. R. \nR. Tolkien"), - new TableSeparator(), - array('80-902734-1-6', new TableCell("And Then \nThere \nWere None", array('rowspan' => 3)), 'Agatha Christie'), - array('80-902734-1-7', 'Test'), - ), - 'default', -<<
array( - array('ISBN', 'Title', 'Author'), - array( - array( - new TableCell('9971-5-0210-0', array('rowspan' => 2, 'colspan' => 2)), - 'Dante Alighieri', - ), - array('Charles Dickens'), - new TableSeparator(), - array( - 'Dante Alighieri', - new TableCell('9971-5-0210-0', array('rowspan' => 3, 'colspan' => 2)), - ), - array('J. R. R. Tolkien'), - array('J. R. R'), - ), - 'default', -<<
array( - array('ISBN', 'Title', 'Author'), - array( - array( - new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)), - 'Dante Alighieri', - ), - array('Charles Dickens'), - new TableSeparator(), - array( - 'Dante Alighieri', - new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)), - ), - array('Charles Dickens'), - new TableSeparator(), - array( - new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)), - new TableCell("Dante \nAlighieri", array('rowspan' => 2, 'colspan' => 1)), - ), - ), - 'default', -<<
array( - array('ISBN', 'Title', 'Author'), - array( - array( - new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)), - 'Dante Alighieri', - ), - array('Charles Dickens'), - array( - 'Dante Alighieri', - new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)), - ), - array('Charles Dickens'), - ), - 'default', -<<
array( - array('ISBN', 'Author'), - array( - array( - new TableCell('9971-5-0210-0', array('rowspan' => 3, 'colspan' => 1)), - 'Dante Alighieri', - ), - array(new TableSeparator()), - array('Charles Dickens'), - ), - 'default', -<<
array( - array( - array(new TableCell('Main title', array('colspan' => 3))), - array('ISBN', 'Title', 'Author'), - ), - array(), - 'default', -<<
markTestSkipped('The "mbstring" extension is not available'); - } - - $table = new Table($output = $this->getOutputStream()); - $table - ->setHeaders(array('■■')) - ->setRows(array(array(1234))) - ->setStyle('default') - ; - $table->render(); - - $expected = -<<
assertEquals($expected, $this->getOutputContent($output)); - } - - public function testStyle() - { - $style = new TableStyle(); - $style - ->setHorizontalBorderChar('.') - ->setVerticalBorderChar('.') - ->setCrossingChar('.') - ; - - Table::setStyleDefinition('dotfull', $style); - $table = new Table($output = $this->getOutputStream()); - $table - ->setHeaders(array('Foo')) - ->setRows(array(array('Bar'))) - ->setStyle('dotfull'); - $table->render(); - - $expected = -<<
assertEquals($expected, $this->getOutputContent($output)); - } - - public function testRowSeparator() - { - $table = new Table($output = $this->getOutputStream()); - $table - ->setHeaders(array('Foo')) - ->setRows(array( - array('Bar1'), - new TableSeparator(), - array('Bar2'), - new TableSeparator(), - array('Bar3'), - )); - $table->render(); - - $expected = -<<
assertEquals($expected, $this->getOutputContent($output)); - - $this->assertEquals($table, $table->addRow(new TableSeparator()), 'fluent interface on addRow() with a single TableSeparator() works'); - } - - protected function getOutputStream() - { - return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false); - } - - protected function getOutputContent(StreamOutput $output) - { - rewind($output->getStream()); - - return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream())); - } -} diff --git a/vendor/symfony/console/Tests/Input/ArgvInputTest.php b/vendor/symfony/console/Tests/Input/ArgvInputTest.php deleted file mode 100644 index d2c540e..0000000 --- a/vendor/symfony/console/Tests/Input/ArgvInputTest.php +++ /dev/null @@ -1,317 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class ArgvInputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $_SERVER['argv'] = array('cli.php', 'foo'); - $input = new ArgvInput(); - $r = new \ReflectionObject($input); - $p = $r->getProperty('tokens'); - $p->setAccessible(true); - - $this->assertEquals(array('foo'), $p->getValue($input), '__construct() automatically get its input from the argv server variable'); - } - - public function testParseArguments() - { - $input = new ArgvInput(array('cli.php', 'foo')); - $input->bind(new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments'); - - $input->bind(new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() is stateless'); - } - - /** - * @dataProvider provideOptions - */ - public function testParseOptions($input, $options, $expectedOptions, $message) - { - $input = new ArgvInput($input); - $input->bind(new InputDefinition($options)); - - $this->assertEquals($expectedOptions, $input->getOptions(), $message); - } - - public function provideOptions() - { - return array( - array( - array('cli.php', '--foo'), - array(new InputOption('foo')), - array('foo' => true), - '->parse() parses long options without a value', - ), - array( - array('cli.php', '--foo=bar'), - array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), - array('foo' => 'bar'), - '->parse() parses long options with a required value (with a = separator)', - ), - array( - array('cli.php', '--foo', 'bar'), - array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), - array('foo' => 'bar'), - '->parse() parses long options with a required value (with a space separator)', - ), - array( - array('cli.php', '-f'), - array(new InputOption('foo', 'f')), - array('foo' => true), - '->parse() parses short options without a value', - ), - array( - array('cli.php', '-fbar'), - array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), - array('foo' => 'bar'), - '->parse() parses short options with a required value (with no separator)', - ), - array( - array('cli.php', '-f', 'bar'), - array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), - array('foo' => 'bar'), - '->parse() parses short options with a required value (with a space separator)', - ), - array( - array('cli.php', '-f', ''), - array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)), - array('foo' => ''), - '->parse() parses short options with an optional empty value', - ), - array( - array('cli.php', '-f', '', 'foo'), - array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)), - array('foo' => ''), - '->parse() parses short options with an optional empty value followed by an argument', - ), - array( - array('cli.php', '-f', '', '-b'), - array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')), - array('foo' => '', 'bar' => true), - '->parse() parses short options with an optional empty value followed by an option', - ), - array( - array('cli.php', '-f', '-b', 'foo'), - array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')), - array('foo' => null, 'bar' => true), - '->parse() parses short options with an optional value which is not present', - ), - array( - array('cli.php', '-fb'), - array(new InputOption('foo', 'f'), new InputOption('bar', 'b')), - array('foo' => true, 'bar' => true), - '->parse() parses short options when they are aggregated as a single one', - ), - array( - array('cli.php', '-fb', 'bar'), - array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)), - array('foo' => true, 'bar' => 'bar'), - '->parse() parses short options when they are aggregated as a single one and the last one has a required value', - ), - array( - array('cli.php', '-fb', 'bar'), - array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)), - array('foo' => true, 'bar' => 'bar'), - '->parse() parses short options when they are aggregated as a single one and the last one has an optional value', - ), - array( - array('cli.php', '-fbbar'), - array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)), - array('foo' => true, 'bar' => 'bar'), - '->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator', - ), - array( - array('cli.php', '-fbbar'), - array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)), - array('foo' => 'bbar', 'bar' => null), - '->parse() parses short options when they are aggregated as a single one and one of them takes a value', - ), - ); - } - - /** - * @dataProvider provideInvalidInput - */ - public function testInvalidInput($argv, $definition, $expectedExceptionMessage) - { - $this->setExpectedException('RuntimeException', $expectedExceptionMessage); - - $input = new ArgvInput($argv); - $input->bind($definition); - } - - public function provideInvalidInput() - { - return array( - array( - array('cli.php', '--foo'), - new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), - 'The "--foo" option requires a value.', - ), - array( - array('cli.php', '-f'), - new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), - 'The "--foo" option requires a value.', - ), - array( - array('cli.php', '-ffoo'), - new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))), - 'The "-o" option does not exist.', - ), - array( - array('cli.php', '--foo=bar'), - new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))), - 'The "--foo" option does not accept a value.', - ), - array( - array('cli.php', 'foo', 'bar'), - new InputDefinition(), - 'Too many arguments.', - ), - array( - array('cli.php', '--foo'), - new InputDefinition(), - 'The "--foo" option does not exist.', - ), - array( - array('cli.php', '-f'), - new InputDefinition(), - 'The "-f" option does not exist.', - ), - array( - array('cli.php', '-1'), - new InputDefinition(array(new InputArgument('number'))), - 'The "-1" option does not exist.', - ), - ); - } - - public function testParseArrayArgument() - { - $input = new ArgvInput(array('cli.php', 'foo', 'bar', 'baz', 'bat')); - $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::IS_ARRAY)))); - - $this->assertEquals(array('name' => array('foo', 'bar', 'baz', 'bat')), $input->getArguments(), '->parse() parses array arguments'); - } - - public function testParseArrayOption() - { - $input = new ArgvInput(array('cli.php', '--name=foo', '--name=bar', '--name=baz')); - $input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY)))); - - $this->assertEquals(array('name' => array('foo', 'bar', 'baz')), $input->getOptions(), '->parse() parses array options ("--option=value" syntax)'); - - $input = new ArgvInput(array('cli.php', '--name', 'foo', '--name', 'bar', '--name', 'baz')); - $input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY)))); - $this->assertEquals(array('name' => array('foo', 'bar', 'baz')), $input->getOptions(), '->parse() parses array options ("--option value" syntax)'); - - $input = new ArgvInput(array('cli.php', '--name=foo', '--name=bar', '--name=')); - $input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY)))); - $this->assertSame(array('name' => array('foo', 'bar', null)), $input->getOptions(), '->parse() parses empty array options as null ("--option=value" syntax)'); - - $input = new ArgvInput(array('cli.php', '--name', 'foo', '--name', 'bar', '--name', '--anotherOption')); - $input->bind(new InputDefinition(array( - new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY), - new InputOption('anotherOption', null, InputOption::VALUE_NONE), - ))); - $this->assertSame(array('name' => array('foo', 'bar', null), 'anotherOption' => true), $input->getOptions(), '->parse() parses empty array options as null ("--option value" syntax)'); - } - - public function testParseNegativeNumberAfterDoubleDash() - { - $input = new ArgvInput(array('cli.php', '--', '-1')); - $input->bind(new InputDefinition(array(new InputArgument('number')))); - $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence'); - - $input = new ArgvInput(array('cli.php', '-f', 'bar', '--', '-1')); - $input->bind(new InputDefinition(array(new InputArgument('number'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)))); - $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses arguments with leading dashes as options before having encountered a double-dash sequence'); - $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence'); - } - - public function testParseEmptyStringArgument() - { - $input = new ArgvInput(array('cli.php', '-f', 'bar', '')); - $input->bind(new InputDefinition(array(new InputArgument('empty'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)))); - - $this->assertEquals(array('empty' => ''), $input->getArguments(), '->parse() parses empty string arguments'); - } - - public function testGetFirstArgument() - { - $input = new ArgvInput(array('cli.php', '-fbbar')); - $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null when there is no arguments'); - - $input = new ArgvInput(array('cli.php', '-fbbar', 'foo')); - $this->assertEquals('foo', $input->getFirstArgument(), '->getFirstArgument() returns the first argument from the raw input'); - } - - public function testHasParameterOption() - { - $input = new ArgvInput(array('cli.php', '-f', 'foo')); - $this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input'); - - $input = new ArgvInput(array('cli.php', '--foo', 'foo')); - $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input'); - - $input = new ArgvInput(array('cli.php', 'foo')); - $this->assertFalse($input->hasParameterOption('--foo'), '->hasParameterOption() returns false if the given short option is not in the raw input'); - - $input = new ArgvInput(array('cli.php', '--foo=bar')); - $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given option with provided value is in the raw input'); - } - - public function testToString() - { - $input = new ArgvInput(array('cli.php', '-f', 'foo')); - $this->assertEquals('-f foo', (string) $input); - - $input = new ArgvInput(array('cli.php', '-f', '--bar=foo', 'a b c d', "A\nB'C")); - $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input); - } - - /** - * @dataProvider provideGetParameterOptionValues - */ - public function testGetParameterOptionEqualSign($argv, $key, $expected) - { - $input = new ArgvInput($argv); - $this->assertEquals($expected, $input->getParameterOption($key), '->getParameterOption() returns the expected value'); - } - - public function provideGetParameterOptionValues() - { - return array( - array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), '--env', 'dev'), - array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'dev'), - array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), '1'), - array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), '1'), - ); - } - - public function testParseSingleDashAsArgument() - { - $input = new ArgvInput(array('cli.php', '-')); - $input->bind(new InputDefinition(array(new InputArgument('file')))); - $this->assertEquals(array('file' => '-'), $input->getArguments(), '->parse() parses single dash as an argument'); - } -} diff --git a/vendor/symfony/console/Tests/Input/ArrayInputTest.php b/vendor/symfony/console/Tests/Input/ArrayInputTest.php deleted file mode 100644 index cc89083..0000000 --- a/vendor/symfony/console/Tests/Input/ArrayInputTest.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class ArrayInputTest extends \PHPUnit_Framework_TestCase -{ - public function testGetFirstArgument() - { - $input = new ArrayInput(array()); - $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null if no argument were passed'); - $input = new ArrayInput(array('name' => 'Fabien')); - $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument'); - $input = new ArrayInput(array('--foo' => 'bar', 'name' => 'Fabien')); - $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument'); - } - - public function testHasParameterOption() - { - $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar')); - $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters'); - $this->assertFalse($input->hasParameterOption('--bar'), '->hasParameterOption() returns false if an option is not present in the passed parameters'); - - $input = new ArrayInput(array('--foo')); - $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters'); - } - - public function testGetParameterOption() - { - $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar')); - $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name'); - - $input = new ArrayInput(array('Fabien', '--foo' => 'bar')); - $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name'); - } - - public function testParseArguments() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name')))); - - $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments'); - } - - /** - * @dataProvider provideOptions - */ - public function testParseOptions($input, $options, $expectedOptions, $message) - { - $input = new ArrayInput($input, new InputDefinition($options)); - - $this->assertEquals($expectedOptions, $input->getOptions(), $message); - } - - public function provideOptions() - { - return array( - array( - array('--foo' => 'bar'), - array(new InputOption('foo')), - array('foo' => 'bar'), - '->parse() parses long options', - ), - array( - array('--foo' => 'bar'), - array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')), - array('foo' => 'bar'), - '->parse() parses long options with a default value', - ), - array( - array('--foo' => null), - array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')), - array('foo' => 'default'), - '->parse() parses long options with a default value', - ), - array( - array('-f' => 'bar'), - array(new InputOption('foo', 'f')), - array('foo' => 'bar'), - '->parse() parses short options', - ), - ); - } - - /** - * @dataProvider provideInvalidInput - */ - public function testParseInvalidInput($parameters, $definition, $expectedExceptionMessage) - { - $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage); - - new ArrayInput($parameters, $definition); - } - - public function provideInvalidInput() - { - return array( - array( - array('foo' => 'foo'), - new InputDefinition(array(new InputArgument('name'))), - 'The "foo" argument does not exist.', - ), - array( - array('--foo' => null), - new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), - 'The "--foo" option requires a value.', - ), - array( - array('--foo' => 'foo'), - new InputDefinition(), - 'The "--foo" option does not exist.', - ), - array( - array('-o' => 'foo'), - new InputDefinition(), - 'The "-o" option does not exist.', - ), - ); - } - - public function testToString() - { - $input = new ArrayInput(array('-f' => null, '-b' => 'bar', '--foo' => 'b a z', '--lala' => null, 'test' => 'Foo', 'test2' => "A\nB'C")); - $this->assertEquals('-f -b=bar --foo='.escapeshellarg('b a z').' --lala Foo '.escapeshellarg("A\nB'C"), (string) $input); - } -} diff --git a/vendor/symfony/console/Tests/Input/InputArgumentTest.php b/vendor/symfony/console/Tests/Input/InputArgumentTest.php deleted file mode 100644 index cfb37cd..0000000 --- a/vendor/symfony/console/Tests/Input/InputArgumentTest.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\InputArgument; - -class InputArgumentTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $argument = new InputArgument('foo'); - $this->assertEquals('foo', $argument->getName(), '__construct() takes a name as its first argument'); - } - - public function testModes() - { - $argument = new InputArgument('foo'); - $this->assertFalse($argument->isRequired(), '__construct() gives a "InputArgument::OPTIONAL" mode by default'); - - $argument = new InputArgument('foo', null); - $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode'); - - $argument = new InputArgument('foo', InputArgument::OPTIONAL); - $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode'); - - $argument = new InputArgument('foo', InputArgument::REQUIRED); - $this->assertTrue($argument->isRequired(), '__construct() can take "InputArgument::REQUIRED" as its mode'); - } - - /** - * @dataProvider provideInvalidModes - */ - public function testInvalidModes($mode) - { - $this->setExpectedException('InvalidArgumentException', sprintf('Argument mode "%s" is not valid.', $mode)); - - new InputArgument('foo', $mode); - } - - public function provideInvalidModes() - { - return array( - array('ANOTHER_ONE'), - array(-1), - ); - } - - public function testIsArray() - { - $argument = new InputArgument('foo', InputArgument::IS_ARRAY); - $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array'); - $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY); - $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array'); - $argument = new InputArgument('foo', InputArgument::OPTIONAL); - $this->assertFalse($argument->isArray(), '->isArray() returns false if the argument can not be an array'); - } - - public function testGetDescription() - { - $argument = new InputArgument('foo', null, 'Some description'); - $this->assertEquals('Some description', $argument->getDescription(), '->getDescription() return the message description'); - } - - public function testGetDefault() - { - $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default'); - $this->assertEquals('default', $argument->getDefault(), '->getDefault() return the default value'); - } - - public function testSetDefault() - { - $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default'); - $argument->setDefault(null); - $this->assertNull($argument->getDefault(), '->setDefault() can reset the default value by passing null'); - $argument->setDefault('another'); - $this->assertEquals('another', $argument->getDefault(), '->setDefault() changes the default value'); - - $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY); - $argument->setDefault(array(1, 2)); - $this->assertEquals(array(1, 2), $argument->getDefault(), '->setDefault() changes the default value'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot set a default value except for InputArgument::OPTIONAL mode. - */ - public function testSetDefaultWithRequiredArgument() - { - $argument = new InputArgument('foo', InputArgument::REQUIRED); - $argument->setDefault('default'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage A default value for an array argument must be an array. - */ - public function testSetDefaultWithArrayArgument() - { - $argument = new InputArgument('foo', InputArgument::IS_ARRAY); - $argument->setDefault('default'); - } -} diff --git a/vendor/symfony/console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/console/Tests/Input/InputDefinitionTest.php deleted file mode 100644 index 7e0a242..0000000 --- a/vendor/symfony/console/Tests/Input/InputDefinitionTest.php +++ /dev/null @@ -1,437 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class InputDefinitionTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixtures; - - protected $foo, $bar, $foo1, $foo2; - - public static function setUpBeforeClass() - { - self::$fixtures = __DIR__.'/../Fixtures/'; - } - - public function testConstructorArguments() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $this->assertEquals(array(), $definition->getArguments(), '__construct() creates a new InputDefinition object'); - - $definition = new InputDefinition(array($this->foo, $this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '__construct() takes an array of InputArgument objects as its first argument'); - } - - public function testConstructorOptions() - { - $this->initializeOptions(); - - $definition = new InputDefinition(); - $this->assertEquals(array(), $definition->getOptions(), '__construct() creates a new InputDefinition object'); - - $definition = new InputDefinition(array($this->foo, $this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '__construct() takes an array of InputOption objects as its first argument'); - } - - public function testSetArguments() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->setArguments(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->setArguments() sets the array of InputArgument objects'); - $definition->setArguments(array($this->bar)); - - $this->assertEquals(array('bar' => $this->bar), $definition->getArguments(), '->setArguments() clears all InputArgument objects'); - } - - public function testAddArguments() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArguments(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArguments() adds an array of InputArgument objects'); - $definition->addArguments(array($this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArguments() does not clear existing InputArgument objects'); - } - - public function testAddArgument() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo); - $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArgument() adds a InputArgument object'); - $definition->addArgument($this->bar); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArgument() adds a InputArgument object'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage An argument with name "foo" already exists. - */ - public function testArgumentsMustHaveDifferentNames() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo); - $definition->addArgument($this->foo1); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot add an argument after an array argument. - */ - public function testArrayArgumentHasToBeLast() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument(new InputArgument('fooarray', InputArgument::IS_ARRAY)); - $definition->addArgument(new InputArgument('anotherbar')); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot add a required argument after an optional one. - */ - public function testRequiredArgumentCannotFollowAnOptionalOne() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo); - $definition->addArgument($this->foo2); - } - - public function testGetArgument() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArguments(array($this->foo)); - $this->assertEquals($this->foo, $definition->getArgument('foo'), '->getArgument() returns a InputArgument by its name'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "bar" argument does not exist. - */ - public function testGetInvalidArgument() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArguments(array($this->foo)); - $definition->getArgument('bar'); - } - - public function testHasArgument() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArguments(array($this->foo)); - - $this->assertTrue($definition->hasArgument('foo'), '->hasArgument() returns true if a InputArgument exists for the given name'); - $this->assertFalse($definition->hasArgument('bar'), '->hasArgument() returns false if a InputArgument exists for the given name'); - } - - public function testGetArgumentRequiredCount() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo2); - $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments'); - $definition->addArgument($this->foo); - $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments'); - } - - public function testGetArgumentCount() - { - $this->initializeArguments(); - - $definition = new InputDefinition(); - $definition->addArgument($this->foo2); - $this->assertEquals(1, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments'); - $definition->addArgument($this->foo); - $this->assertEquals(2, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments'); - } - - public function testGetArgumentDefaults() - { - $definition = new InputDefinition(array( - new InputArgument('foo1', InputArgument::OPTIONAL), - new InputArgument('foo2', InputArgument::OPTIONAL, '', 'default'), - new InputArgument('foo3', InputArgument::OPTIONAL | InputArgument::IS_ARRAY), - // new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)), - )); - $this->assertEquals(array('foo1' => null, 'foo2' => 'default', 'foo3' => array()), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument'); - - $definition = new InputDefinition(array( - new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)), - )); - $this->assertEquals(array('foo4' => array(1, 2)), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument'); - } - - public function testSetOptions() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->setOptions() sets the array of InputOption objects'); - $definition->setOptions(array($this->bar)); - $this->assertEquals(array('bar' => $this->bar), $definition->getOptions(), '->setOptions() clears all InputOption objects'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "-f" option does not exist. - */ - public function testSetOptionsClearsOptions() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $definition->setOptions(array($this->bar)); - $definition->getOptionForShortcut('f'); - } - - public function testAddOptions() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOptions() adds an array of InputOption objects'); - $definition->addOptions(array($this->bar)); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOptions() does not clear existing InputOption objects'); - } - - public function testAddOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(); - $definition->addOption($this->foo); - $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOption() adds a InputOption object'); - $definition->addOption($this->bar); - $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOption() adds a InputOption object'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage An option named "foo" already exists. - */ - public function testAddDuplicateOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(); - $definition->addOption($this->foo); - $definition->addOption($this->foo2); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage An option with shortcut "f" already exists. - */ - public function testAddDuplicateShortcutOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(); - $definition->addOption($this->foo); - $definition->addOption($this->foo1); - } - - public function testGetOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals($this->foo, $definition->getOption('foo'), '->getOption() returns a InputOption by its name'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "--bar" option does not exist. - */ - public function testGetInvalidOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $definition->getOption('bar'); - } - - public function testHasOption() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertTrue($definition->hasOption('foo'), '->hasOption() returns true if a InputOption exists for the given name'); - $this->assertFalse($definition->hasOption('bar'), '->hasOption() returns false if a InputOption exists for the given name'); - } - - public function testHasShortcut() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertTrue($definition->hasShortcut('f'), '->hasShortcut() returns true if a InputOption exists for the given shortcut'); - $this->assertFalse($definition->hasShortcut('b'), '->hasShortcut() returns false if a InputOption exists for the given shortcut'); - } - - public function testGetOptionForShortcut() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $this->assertEquals($this->foo, $definition->getOptionForShortcut('f'), '->getOptionForShortcut() returns a InputOption by its shortcut'); - } - - public function testGetOptionForMultiShortcut() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->multi)); - $this->assertEquals($this->multi, $definition->getOptionForShortcut('m'), '->getOptionForShortcut() returns a InputOption by its shortcut'); - $this->assertEquals($this->multi, $definition->getOptionForShortcut('mmm'), '->getOptionForShortcut() returns a InputOption by its shortcut'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "-l" option does not exist. - */ - public function testGetOptionForInvalidShortcut() - { - $this->initializeOptions(); - - $definition = new InputDefinition(array($this->foo)); - $definition->getOptionForShortcut('l'); - } - - public function testGetOptionDefaults() - { - $definition = new InputDefinition(array( - new InputOption('foo1', null, InputOption::VALUE_NONE), - new InputOption('foo2', null, InputOption::VALUE_REQUIRED), - new InputOption('foo3', null, InputOption::VALUE_REQUIRED, '', 'default'), - new InputOption('foo4', null, InputOption::VALUE_OPTIONAL), - new InputOption('foo5', null, InputOption::VALUE_OPTIONAL, '', 'default'), - new InputOption('foo6', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY), - new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', array(1, 2)), - )); - $defaults = array( - 'foo1' => false, - 'foo2' => null, - 'foo3' => 'default', - 'foo4' => null, - 'foo5' => 'default', - 'foo6' => array(), - 'foo7' => array(1, 2), - ); - $this->assertSame($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options'); - } - - /** - * @dataProvider getGetSynopsisData - */ - public function testGetSynopsis(InputDefinition $definition, $expectedSynopsis, $message = null) - { - $this->assertEquals($expectedSynopsis, $definition->getSynopsis(), $message ? '->getSynopsis() '.$message : ''); - } - - public function getGetSynopsisData() - { - return array( - array(new InputDefinition(array(new InputOption('foo'))), '[--foo]', 'puts optional options in square brackets'), - array(new InputDefinition(array(new InputOption('foo', 'f'))), '[-f|--foo]', 'separates shortcut with a pipe'), - array(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), '[-f|--foo FOO]', 'uses shortcut as value placeholder'), - array(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL))), '[-f|--foo [FOO]]', 'puts optional values in square brackets'), - - array(new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED))), '', 'puts arguments in angle brackets'), - array(new InputDefinition(array(new InputArgument('foo'))), '[]', 'puts optional arguments in square brackets'), - array(new InputDefinition(array(new InputArgument('foo', InputArgument::IS_ARRAY))), '[]...', 'uses an ellipsis for array arguments'), - array(new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY))), ' ()...', 'uses parenthesis and ellipsis for required array arguments'), - - array(new InputDefinition(array(new InputOption('foo'), new InputArgument('foo', InputArgument::REQUIRED))), '[--foo] [--] ', 'puts [--] between options and arguments'), - ); - } - - public function testGetShortSynopsis() - { - $definition = new InputDefinition(array(new InputOption('foo'), new InputOption('bar'), new InputArgument('cat'))); - $this->assertEquals('[options] [--] []', $definition->getSynopsis(true), '->getSynopsis(true) groups options in [options]'); - } - - /** - * @group legacy - */ - public function testLegacyAsText() - { - $definition = new InputDefinition(array( - new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), - new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), - new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('http://foo.com/')), - new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'), - new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), - new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), - new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array('http://foo.com/', 'bar')), - new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array('foo' => 'bar')), - )); - - $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); - } - - /** - * @group legacy - */ - public function testLegacyAsXml() - { - $definition = new InputDefinition(array( - new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), - new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), - new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('bar')), - new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'), - new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), - new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), - )); - $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asXml() returns an XML representation of the InputDefinition'); - } - - protected function initializeArguments() - { - $this->foo = new InputArgument('foo'); - $this->bar = new InputArgument('bar'); - $this->foo1 = new InputArgument('foo'); - $this->foo2 = new InputArgument('foo2', InputArgument::REQUIRED); - } - - protected function initializeOptions() - { - $this->foo = new InputOption('foo', 'f'); - $this->bar = new InputOption('bar', 'b'); - $this->foo1 = new InputOption('fooBis', 'f'); - $this->foo2 = new InputOption('foo', 'p'); - $this->multi = new InputOption('multi', 'm|mm|mmm'); - } -} diff --git a/vendor/symfony/console/Tests/Input/InputOptionTest.php b/vendor/symfony/console/Tests/Input/InputOptionTest.php deleted file mode 100644 index 53ce1df..0000000 --- a/vendor/symfony/console/Tests/Input/InputOptionTest.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\InputOption; - -class InputOptionTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $option = new InputOption('foo'); - $this->assertEquals('foo', $option->getName(), '__construct() takes a name as its first argument'); - $option = new InputOption('--foo'); - $this->assertEquals('foo', $option->getName(), '__construct() removes the leading -- of the option name'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value. - */ - public function testArrayModeWithoutValue() - { - new InputOption('foo', 'f', InputOption::VALUE_IS_ARRAY); - } - - public function testShortcut() - { - $option = new InputOption('foo', 'f'); - $this->assertEquals('f', $option->getShortcut(), '__construct() can take a shortcut as its second argument'); - $option = new InputOption('foo', '-f|-ff|fff'); - $this->assertEquals('f|ff|fff', $option->getShortcut(), '__construct() removes the leading - of the shortcuts'); - $option = new InputOption('foo', array('f', 'ff', '-fff')); - $this->assertEquals('f|ff|fff', $option->getShortcut(), '__construct() removes the leading - of the shortcuts'); - $option = new InputOption('foo'); - $this->assertNull($option->getShortcut(), '__construct() makes the shortcut null by default'); - } - - public function testModes() - { - $option = new InputOption('foo', 'f'); - $this->assertFalse($option->acceptValue(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'); - $this->assertFalse($option->isValueRequired(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'); - $this->assertFalse($option->isValueOptional(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'); - - $option = new InputOption('foo', 'f', null); - $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - - $option = new InputOption('foo', 'f', InputOption::VALUE_NONE); - $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode'); - - $option = new InputOption('foo', 'f', InputOption::VALUE_REQUIRED); - $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode'); - $this->assertTrue($option->isValueRequired(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode'); - $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode'); - - $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL); - $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode'); - $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode'); - $this->assertTrue($option->isValueOptional(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode'); - } - - /** - * @dataProvider provideInvalidModes - */ - public function testInvalidModes($mode) - { - $this->setExpectedException('InvalidArgumentException', sprintf('Option mode "%s" is not valid.', $mode)); - - new InputOption('foo', 'f', $mode); - } - - public function provideInvalidModes() - { - return array( - array('ANOTHER_ONE'), - array(-1), - ); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEmptyNameIsInvalid() - { - new InputOption(''); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testDoubleDashNameIsInvalid() - { - new InputOption('--'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSingleDashOptionIsInvalid() - { - new InputOption('foo', '-'); - } - - public function testIsArray() - { - $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY); - $this->assertTrue($option->isArray(), '->isArray() returns true if the option can be an array'); - $option = new InputOption('foo', null, InputOption::VALUE_NONE); - $this->assertFalse($option->isArray(), '->isArray() returns false if the option can not be an array'); - } - - public function testGetDescription() - { - $option = new InputOption('foo', 'f', null, 'Some description'); - $this->assertEquals('Some description', $option->getDescription(), '->getDescription() returns the description message'); - } - - public function testGetDefault() - { - $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL, '', 'default'); - $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value'); - - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default'); - $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value'); - - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED); - $this->assertNull($option->getDefault(), '->getDefault() returns null if no default value is configured'); - - $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY); - $this->assertEquals(array(), $option->getDefault(), '->getDefault() returns an empty array if option is an array'); - - $option = new InputOption('foo', null, InputOption::VALUE_NONE); - $this->assertFalse($option->getDefault(), '->getDefault() returns false if the option does not take a value'); - } - - public function testSetDefault() - { - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default'); - $option->setDefault(null); - $this->assertNull($option->getDefault(), '->setDefault() can reset the default value by passing null'); - $option->setDefault('another'); - $this->assertEquals('another', $option->getDefault(), '->setDefault() changes the default value'); - - $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY); - $option->setDefault(array(1, 2)); - $this->assertEquals(array(1, 2), $option->getDefault(), '->setDefault() changes the default value'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Cannot set a default value when using InputOption::VALUE_NONE mode. - */ - public function testDefaultValueWithValueNoneMode() - { - $option = new InputOption('foo', 'f', InputOption::VALUE_NONE); - $option->setDefault('default'); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage A default value for an array option must be an array. - */ - public function testDefaultValueWithIsArrayMode() - { - $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY); - $option->setDefault('default'); - } - - public function testEquals() - { - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('foo', 'f', null, 'Alternative description'); - $this->assertTrue($option->equals($option2)); - - $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description'); - $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description', true); - $this->assertFalse($option->equals($option2)); - - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('bar', 'f', null, 'Some description'); - $this->assertFalse($option->equals($option2)); - - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('foo', '', null, 'Some description'); - $this->assertFalse($option->equals($option2)); - - $option = new InputOption('foo', 'f', null, 'Some description'); - $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description'); - $this->assertFalse($option->equals($option2)); - } -} diff --git a/vendor/symfony/console/Tests/Input/InputTest.php b/vendor/symfony/console/Tests/Input/InputTest.php deleted file mode 100644 index 0b3e38f..0000000 --- a/vendor/symfony/console/Tests/Input/InputTest.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class InputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals('foo', $input->getArgument('name'), '->__construct() takes a InputDefinition as an argument'); - } - - public function testOptions() - { - $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name')))); - $this->assertEquals('foo', $input->getOption('name'), '->getOption() returns the value for the given option'); - - $input->setOption('name', 'bar'); - $this->assertEquals('bar', $input->getOption('name'), '->setOption() sets the value for a given option'); - $this->assertEquals(array('name' => 'bar'), $input->getOptions(), '->getOptions() returns all option values'); - - $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')))); - $this->assertEquals('default', $input->getOption('bar'), '->getOption() returns the default value for optional options'); - $this->assertEquals(array('name' => 'foo', 'bar' => 'default'), $input->getOptions(), '->getOptions() returns all option values, even optional ones'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "foo" option does not exist. - */ - public function testSetInvalidOption() - { - $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')))); - $input->setOption('foo', 'bar'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "foo" option does not exist. - */ - public function testGetInvalidOption() - { - $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')))); - $input->getOption('foo'); - } - - public function testArguments() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name')))); - $this->assertEquals('foo', $input->getArgument('name'), '->getArgument() returns the value for the given argument'); - - $input->setArgument('name', 'bar'); - $this->assertEquals('bar', $input->getArgument('name'), '->setArgument() sets the value for a given argument'); - $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->getArguments() returns all argument values'); - - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default')))); - $this->assertEquals('default', $input->getArgument('bar'), '->getArgument() returns the default value for optional arguments'); - $this->assertEquals(array('name' => 'foo', 'bar' => 'default'), $input->getArguments(), '->getArguments() returns all argument values, even optional ones'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "foo" argument does not exist. - */ - public function testSetInvalidArgument() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default')))); - $input->setArgument('foo', 'bar'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "foo" argument does not exist. - */ - public function testGetInvalidArgument() - { - $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default')))); - $input->getArgument('foo'); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Not enough arguments. - */ - public function testValidateWithMissingArguments() - { - $input = new ArrayInput(array()); - $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED)))); - $input->validate(); - } - - public function testValidate() - { - $input = new ArrayInput(array('name' => 'foo')); - $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED)))); - - $this->assertNull($input->validate()); - } - - public function testSetGetInteractive() - { - $input = new ArrayInput(array()); - $this->assertTrue($input->isInteractive(), '->isInteractive() returns whether the input should be interactive or not'); - $input->setInteractive(false); - $this->assertFalse($input->isInteractive(), '->setInteractive() changes the interactive flag'); - } -} diff --git a/vendor/symfony/console/Tests/Input/StringInputTest.php b/vendor/symfony/console/Tests/Input/StringInputTest.php deleted file mode 100644 index ccf9289..0000000 --- a/vendor/symfony/console/Tests/Input/StringInputTest.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Input; - -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\StringInput; - -class StringInputTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getTokenizeData - */ - public function testTokenize($input, $tokens, $message) - { - $input = new StringInput($input); - $r = new \ReflectionClass('Symfony\Component\Console\Input\ArgvInput'); - $p = $r->getProperty('tokens'); - $p->setAccessible(true); - $this->assertEquals($tokens, $p->getValue($input), $message); - } - - public function testInputOptionWithGivenString() - { - $definition = new InputDefinition( - array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) - ); - - // call to bind - $input = new StringInput('--foo=bar'); - $input->bind($definition); - $this->assertEquals('bar', $input->getOption('foo')); - } - - /** - * @group legacy - */ - public function testLegacyInputOptionDefinitionInConstructor() - { - $definition = new InputDefinition( - array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) - ); - - $input = new StringInput('--foo=bar', $definition); - $this->assertEquals('bar', $input->getOption('foo')); - } - - public function getTokenizeData() - { - return array( - array('', array(), '->tokenize() parses an empty string'), - array('foo', array('foo'), '->tokenize() parses arguments'), - array(' foo bar ', array('foo', 'bar'), '->tokenize() ignores whitespaces between arguments'), - array('"quoted"', array('quoted'), '->tokenize() parses quoted arguments'), - array("'quoted'", array('quoted'), '->tokenize() parses quoted arguments'), - array("'a\rb\nc\td'", array("a\rb\nc\td"), '->tokenize() parses whitespace chars in strings'), - array("'a'\r'b'\n'c'\t'd'", array('a','b','c','d'), '->tokenize() parses whitespace chars between args as spaces'), - array('\"quoted\"', array('"quoted"'), '->tokenize() parses escaped-quoted arguments'), - array("\'quoted\'", array('\'quoted\''), '->tokenize() parses escaped-quoted arguments'), - array('-a', array('-a'), '->tokenize() parses short options'), - array('-azc', array('-azc'), '->tokenize() parses aggregated short options'), - array('-awithavalue', array('-awithavalue'), '->tokenize() parses short options with a value'), - array('-a"foo bar"', array('-afoo bar'), '->tokenize() parses short options with a value'), - array('-a"foo bar""foo bar"', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'), - array('-a\'foo bar\'', array('-afoo bar'), '->tokenize() parses short options with a value'), - array('-a\'foo bar\'\'foo bar\'', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'), - array('-a\'foo bar\'"foo bar"', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'), - array('--long-option', array('--long-option'), '->tokenize() parses long options'), - array('--long-option=foo', array('--long-option=foo'), '->tokenize() parses long options with a value'), - array('--long-option="foo bar"', array('--long-option=foo bar'), '->tokenize() parses long options with a value'), - array('--long-option="foo bar""another"', array('--long-option=foo baranother'), '->tokenize() parses long options with a value'), - array('--long-option=\'foo bar\'', array('--long-option=foo bar'), '->tokenize() parses long options with a value'), - array("--long-option='foo bar''another'", array('--long-option=foo baranother'), '->tokenize() parses long options with a value'), - array("--long-option='foo bar'\"another\"", array('--long-option=foo baranother'), '->tokenize() parses long options with a value'), - array('foo -a -ffoo --long bar', array('foo', '-a', '-ffoo', '--long', 'bar'), '->tokenize() parses when several arguments and options'), - ); - } - - public function testToString() - { - $input = new StringInput('-f foo'); - $this->assertEquals('-f foo', (string) $input); - - $input = new StringInput('-f --bar=foo "a b c d"'); - $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d'), (string) $input); - - $input = new StringInput('-f --bar=foo \'a b c d\' '."'A\nB\\'C'"); - $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input); - } -} diff --git a/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php b/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php deleted file mode 100644 index c5eca2c..0000000 --- a/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Logger; - -use Psr\Log\Test\LoggerInterfaceTest; -use Psr\Log\LogLevel; -use Symfony\Component\Console\Logger\ConsoleLogger; -use Symfony\Component\Console\Tests\Fixtures\DummyOutput; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Console logger test. - * - * @author Kévin Dunglas - */ -class ConsoleLoggerTest extends LoggerInterfaceTest -{ - /** - * @var DummyOutput - */ - protected $output; - - /** - * {@inheritdoc} - */ - public function getLogger() - { - $this->output = new DummyOutput(OutputInterface::VERBOSITY_VERBOSE); - - return new ConsoleLogger($this->output, array( - LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, - LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, - LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, - LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL, - LogLevel::INFO => OutputInterface::VERBOSITY_NORMAL, - LogLevel::DEBUG => OutputInterface::VERBOSITY_NORMAL, - )); - } - - /** - * {@inheritdoc} - */ - public function getLogs() - { - return $this->output->getLogs(); - } -} diff --git a/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php b/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php deleted file mode 100644 index 1afbbb6..0000000 --- a/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\Output; - -class ConsoleOutputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $output = new ConsoleOutput(Output::VERBOSITY_QUIET, true); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); - $this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument'); - } -} diff --git a/vendor/symfony/console/Tests/Output/NullOutputTest.php b/vendor/symfony/console/Tests/Output/NullOutputTest.php deleted file mode 100644 index b20ae4e..0000000 --- a/vendor/symfony/console/Tests/Output/NullOutputTest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Output\OutputInterface; - -class NullOutputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $output = new NullOutput(); - - ob_start(); - $output->write('foo'); - $buffer = ob_get_clean(); - - $this->assertSame('', $buffer, '->write() does nothing (at least nothing is printed)'); - $this->assertFalse($output->isDecorated(), '->isDecorated() returns false'); - } - - public function testVerbosity() - { - $output = new NullOutput(); - $this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() returns VERBOSITY_QUIET for NullOutput by default'); - - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - $this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() always returns VERBOSITY_QUIET for NullOutput'); - } -} diff --git a/vendor/symfony/console/Tests/Output/OutputTest.php b/vendor/symfony/console/Tests/Output/OutputTest.php deleted file mode 100644 index cfb4afe..0000000 --- a/vendor/symfony/console/Tests/Output/OutputTest.php +++ /dev/null @@ -1,156 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -class OutputTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $output = new TestOutput(Output::VERBOSITY_QUIET, true); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); - $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument'); - } - - public function testSetIsDecorated() - { - $output = new TestOutput(); - $output->setDecorated(true); - $this->assertTrue($output->isDecorated(), 'setDecorated() sets the decorated flag'); - } - - public function testSetGetVerbosity() - { - $output = new TestOutput(); - $output->setVerbosity(Output::VERBOSITY_QUIET); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '->setVerbosity() sets the verbosity'); - - $this->assertTrue($output->isQuiet()); - $this->assertFalse($output->isVerbose()); - $this->assertFalse($output->isVeryVerbose()); - $this->assertFalse($output->isDebug()); - - $output->setVerbosity(Output::VERBOSITY_NORMAL); - $this->assertFalse($output->isQuiet()); - $this->assertFalse($output->isVerbose()); - $this->assertFalse($output->isVeryVerbose()); - $this->assertFalse($output->isDebug()); - - $output->setVerbosity(Output::VERBOSITY_VERBOSE); - $this->assertFalse($output->isQuiet()); - $this->assertTrue($output->isVerbose()); - $this->assertFalse($output->isVeryVerbose()); - $this->assertFalse($output->isDebug()); - - $output->setVerbosity(Output::VERBOSITY_VERY_VERBOSE); - $this->assertFalse($output->isQuiet()); - $this->assertTrue($output->isVerbose()); - $this->assertTrue($output->isVeryVerbose()); - $this->assertFalse($output->isDebug()); - - $output->setVerbosity(Output::VERBOSITY_DEBUG); - $this->assertFalse($output->isQuiet()); - $this->assertTrue($output->isVerbose()); - $this->assertTrue($output->isVeryVerbose()); - $this->assertTrue($output->isDebug()); - } - - public function testWriteWithVerbosityQuiet() - { - $output = new TestOutput(Output::VERBOSITY_QUIET); - $output->writeln('foo'); - $this->assertEquals('', $output->output, '->writeln() outputs nothing if verbosity is set to VERBOSITY_QUIET'); - } - - public function testWriteAnArrayOfMessages() - { - $output = new TestOutput(); - $output->writeln(array('foo', 'bar')); - $this->assertEquals("foo\nbar\n", $output->output, '->writeln() can take an array of messages to output'); - } - - /** - * @dataProvider provideWriteArguments - */ - public function testWriteRawMessage($message, $type, $expectedOutput) - { - $output = new TestOutput(); - $output->writeln($message, $type); - $this->assertEquals($expectedOutput, $output->output); - } - - public function provideWriteArguments() - { - return array( - array('foo', Output::OUTPUT_RAW, "foo\n"), - array('foo', Output::OUTPUT_PLAIN, "foo\n"), - ); - } - - public function testWriteWithDecorationTurnedOff() - { - $output = new TestOutput(); - $output->setDecorated(false); - $output->writeln('foo'); - $this->assertEquals("foo\n", $output->output, '->writeln() strips decoration tags if decoration is set to false'); - } - - public function testWriteDecoratedMessage() - { - $fooStyle = new OutputFormatterStyle('yellow', 'red', array('blink')); - $output = new TestOutput(); - $output->getFormatter()->setStyle('FOO', $fooStyle); - $output->setDecorated(true); - $output->writeln('foo'); - $this->assertEquals("\033[33;41;5mfoo\033[39;49;25m\n", $output->output, '->writeln() decorates the output'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unknown output type given (24) - */ - public function testWriteWithInvalidOutputType() - { - $output = new TestOutput(); - $output->writeln('foo', 24); - } - - public function testWriteWithInvalidStyle() - { - $output = new TestOutput(); - - $output->clear(); - $output->write('foo'); - $this->assertEquals('foo', $output->output, '->write() do nothing when a style does not exist'); - - $output->clear(); - $output->writeln('foo'); - $this->assertEquals("foo\n", $output->output, '->writeln() do nothing when a style does not exist'); - } -} - -class TestOutput extends Output -{ - public $output = ''; - - public function clear() - { - $this->output = ''; - } - - protected function doWrite($message, $newline) - { - $this->output .= $message.($newline ? "\n" : ''); - } -} diff --git a/vendor/symfony/console/Tests/Output/StreamOutputTest.php b/vendor/symfony/console/Tests/Output/StreamOutputTest.php deleted file mode 100644 index 2fd4f61..0000000 --- a/vendor/symfony/console/Tests/Output/StreamOutputTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Output; - -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Output\StreamOutput; - -class StreamOutputTest extends \PHPUnit_Framework_TestCase -{ - protected $stream; - - protected function setUp() - { - $this->stream = fopen('php://memory', 'a', false); - } - - protected function tearDown() - { - $this->stream = null; - } - - public function testConstructor() - { - $output = new StreamOutput($this->stream, Output::VERBOSITY_QUIET, true); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); - $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The StreamOutput class needs a stream as its first argument. - */ - public function testStreamIsRequired() - { - new StreamOutput('foo'); - } - - public function testGetStream() - { - $output = new StreamOutput($this->stream); - $this->assertEquals($this->stream, $output->getStream(), '->getStream() returns the current stream'); - } - - public function testDoWrite() - { - $output = new StreamOutput($this->stream); - $output->writeln('foo'); - rewind($output->getStream()); - $this->assertEquals('foo'.PHP_EOL, stream_get_contents($output->getStream()), '->doWrite() writes to the stream'); - } -} diff --git a/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php b/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php deleted file mode 100644 index 2df4f40..0000000 --- a/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php +++ /dev/null @@ -1,64 +0,0 @@ -command = new Command('sfstyle'); - $this->tester = new CommandTester($this->command); - } - - protected function tearDown() - { - $this->command = null; - $this->tester = null; - } - - /** - * @dataProvider inputCommandToOutputFilesProvider - */ - public function testOutputs($inputCommandFilepath, $outputFilepath) - { - $code = require $inputCommandFilepath; - $this->command->setCode($code); - $this->tester->execute(array(), array('interactive' => false, 'decorated' => false)); - $this->assertStringEqualsFile($outputFilepath, $this->tester->getDisplay(true)); - } - - public function inputCommandToOutputFilesProvider() - { - $baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle'; - - return array_map(null, glob($baseDir.'/command/command_*.php'), glob($baseDir.'/output/output_*.txt')); - } - - public function testLongWordsBlockWrapping() - { - $word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon'; - $wordLength = strlen($word); - $maxLineLength = SymfonyStyle::MAX_LINE_LENGTH - 3; - - $this->command->setCode(function (InputInterface $input, OutputInterface $output) use ($word) { - $sfStyle = new SymfonyStyle($input, $output); - $sfStyle->block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false); - }); - - $this->tester->execute(array(), array('interactive' => false, 'decorated' => false)); - $expectedCount = (int) ceil($wordLength / ($maxLineLength)) + (int) ($wordLength > $maxLineLength - 5); - $this->assertSame($expectedCount, substr_count($this->tester->getDisplay(true), ' § ')); - } -} diff --git a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php deleted file mode 100644 index a8389dd..0000000 --- a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Tester\ApplicationTester; - -class ApplicationTesterTest extends \PHPUnit_Framework_TestCase -{ - protected $application; - protected $tester; - - protected function setUp() - { - $this->application = new Application(); - $this->application->setAutoExit(false); - $this->application->register('foo') - ->addArgument('foo') - ->setCode(function ($input, $output) { $output->writeln('foo'); }) - ; - - $this->tester = new ApplicationTester($this->application); - $this->tester->run(array('command' => 'foo', 'foo' => 'bar'), array('interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); - } - - protected function tearDown() - { - $this->application = null; - $this->tester = null; - } - - public function testRun() - { - $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option'); - $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option'); - $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option'); - } - - public function testGetInput() - { - $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance'); - } - - public function testGetOutput() - { - rewind($this->tester->getOutput()->getStream()); - $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance'); - } - - public function testGetDisplay() - { - $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution'); - } - - public function testGetStatusCode() - { - $this->assertSame(0, $this->tester->getStatusCode(), '->getStatusCode() returns the status code'); - } -} diff --git a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php b/vendor/symfony/console/Tests/Tester/CommandTesterTest.php deleted file mode 100644 index b54c00e..0000000 --- a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Console\Tester\CommandTester; - -class CommandTesterTest extends \PHPUnit_Framework_TestCase -{ - protected $command; - protected $tester; - - protected function setUp() - { - $this->command = new Command('foo'); - $this->command->addArgument('command'); - $this->command->addArgument('foo'); - $this->command->setCode(function ($input, $output) { $output->writeln('foo'); }); - - $this->tester = new CommandTester($this->command); - $this->tester->execute(array('foo' => 'bar'), array('interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE)); - } - - protected function tearDown() - { - $this->command = null; - $this->tester = null; - } - - public function testExecute() - { - $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option'); - $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option'); - $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option'); - } - - public function testGetInput() - { - $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance'); - } - - public function testGetOutput() - { - rewind($this->tester->getOutput()->getStream()); - $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance'); - } - - public function testGetDisplay() - { - $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution'); - } - - public function testGetStatusCode() - { - $this->assertSame(0, $this->tester->getStatusCode(), '->getStatusCode() returns the status code'); - } - - public function testCommandFromApplication() - { - $application = new Application(); - $application->setAutoExit(false); - - $command = new Command('foo'); - $command->setCode(function ($input, $output) { $output->writeln('foo'); }); - - $application->add($command); - - $tester = new CommandTester($application->find('foo')); - - // check that there is no need to pass the command name here - $this->assertEquals(0, $tester->execute(array())); - } -} diff --git a/vendor/symfony/css-selector/Tests/CssSelectorTest.php b/vendor/symfony/css-selector/Tests/CssSelectorTest.php deleted file mode 100644 index 61ab80e..0000000 --- a/vendor/symfony/css-selector/Tests/CssSelectorTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests; - -use Symfony\Component\CssSelector\CssSelector; - -class CssSelectorTest extends \PHPUnit_Framework_TestCase -{ - public function testCssToXPath() - { - $this->assertEquals('descendant-or-self::*', CssSelector::toXPath('')); - $this->assertEquals('descendant-or-self::h1', CssSelector::toXPath('h1')); - $this->assertEquals("descendant-or-self::h1[@id = 'foo']", CssSelector::toXPath('h1#foo')); - $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", CssSelector::toXPath('h1.foo')); - $this->assertEquals('descendant-or-self::foo:h1', CssSelector::toXPath('foo|h1')); - } - - /** @dataProvider getCssToXPathWithoutPrefixTestData */ - public function testCssToXPathWithoutPrefix($css, $xpath) - { - $this->assertEquals($xpath, CssSelector::toXPath($css, ''), '->parse() parses an input string and returns a node'); - } - - public function testParseExceptions() - { - try { - CssSelector::toXPath('h1:'); - $this->fail('->parse() throws an Exception if the css selector is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid'); - $this->assertEquals('Expected identifier, but found.', $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); - } - } - - public function getCssToXPathWithoutPrefixTestData() - { - return array( - array('h1', 'h1'), - array('foo|h1', 'foo:h1'), - array('h1, h2, h3', 'h1 | h2 | h3'), - array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"), - array('h1 > p', 'h1/p'), - array('h1#foo', "h1[@id = 'foo']"), - array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"), - array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"), - array('h1[class]', 'h1[@class]'), - array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"), - array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"), - array('div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/AbstractNodeTest.php b/vendor/symfony/css-selector/Tests/Node/AbstractNodeTest.php deleted file mode 100644 index 16a3a34..0000000 --- a/vendor/symfony/css-selector/Tests/Node/AbstractNodeTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\NodeInterface; - -abstract class AbstractNodeTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getToStringConversionTestData */ - public function testToStringConversion(NodeInterface $node, $representation) - { - $this->assertEquals($representation, (string) $node); - } - - /** @dataProvider getSpecificityValueTestData */ - public function testSpecificityValue(NodeInterface $node, $value) - { - $this->assertEquals($value, $node->getSpecificity()->getValue()); - } - - abstract public function getToStringConversionTestData(); - abstract public function getSpecificityValueTestData(); -} diff --git a/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php b/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php deleted file mode 100644 index 1fd090f..0000000 --- a/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\AttributeNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class AttributeNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'), - array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"), - array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10), - array(new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11), - array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10), - array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php b/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php deleted file mode 100644 index e0ab45a..0000000 --- a/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ClassNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class ClassNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new ClassNode(new ElementNode(), 'class'), 10), - array(new ClassNode(new ElementNode(null, 'element'), 'class'), 11), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php b/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php deleted file mode 100644 index 9547298..0000000 --- a/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\CombinedSelectorNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class CombinedSelectorNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'), - array(new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] Element[*]]'), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0), - array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1), - array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/ElementNodeTest.php b/vendor/symfony/css-selector/Tests/Node/ElementNodeTest.php deleted file mode 100644 index 1db6a59..0000000 --- a/vendor/symfony/css-selector/Tests/Node/ElementNodeTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ElementNode; - -class ElementNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new ElementNode(), 'Element[*]'), - array(new ElementNode(null, 'element'), 'Element[element]'), - array(new ElementNode('namespace', 'element'), 'Element[namespace|element]'), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new ElementNode(), 0), - array(new ElementNode(null, 'element'), 1), - array(new ElementNode('namespace', 'element'),1), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php b/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php deleted file mode 100644 index ee3ce51..0000000 --- a/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Node\FunctionNode; -use Symfony\Component\CssSelector\Parser\Token; - -class FunctionNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'), - array(new FunctionNode(new ElementNode(), 'function', array( - new Token(Token::TYPE_IDENTIFIER, 'value', 0), - )), "Function[Element[*]:function(['value'])]"), - array(new FunctionNode(new ElementNode(), 'function', array( - new Token(Token::TYPE_STRING, 'value1', 0), - new Token(Token::TYPE_NUMBER, 'value2', 0), - )), "Function[Element[*]:function(['value1', 'value2'])]"), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new FunctionNode(new ElementNode(), 'function'), 10), - array(new FunctionNode(new ElementNode(), 'function', array( - new Token(Token::TYPE_IDENTIFIER, 'value', 0), - )), 10), - array(new FunctionNode(new ElementNode(), 'function', array( - new Token(Token::TYPE_STRING, 'value1', 0), - new Token(Token::TYPE_NUMBER, 'value2', 0), - )), 10), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/HashNodeTest.php b/vendor/symfony/css-selector/Tests/Node/HashNodeTest.php deleted file mode 100644 index 8554b22..0000000 --- a/vendor/symfony/css-selector/Tests/Node/HashNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\HashNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class HashNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new HashNode(new ElementNode(), 'id'), 100), - array(new HashNode(new ElementNode(null, 'id'), 'class'), 101), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php b/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php deleted file mode 100644 index edf4552..0000000 --- a/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ClassNode; -use Symfony\Component\CssSelector\Node\NegationNode; -use Symfony\Component\CssSelector\Node\ElementNode; - -class NegationNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/PseudoNodeTest.php b/vendor/symfony/css-selector/Tests/Node/PseudoNodeTest.php deleted file mode 100644 index bc57813..0000000 --- a/vendor/symfony/css-selector/Tests/Node/PseudoNodeTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Node\PseudoNode; - -class PseudoNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new PseudoNode(new ElementNode(), 'pseudo'), 10), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/SelectorNodeTest.php b/vendor/symfony/css-selector/Tests/Node/SelectorNodeTest.php deleted file mode 100644 index 5badf71..0000000 --- a/vendor/symfony/css-selector/Tests/Node/SelectorNodeTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\ElementNode; -use Symfony\Component\CssSelector\Node\SelectorNode; - -class SelectorNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return array( - array(new SelectorNode(new ElementNode()), 'Selector[Element[*]]'), - array(new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'), - ); - } - - public function getSpecificityValueTestData() - { - return array( - array(new SelectorNode(new ElementNode()), 0), - array(new SelectorNode(new ElementNode(), 'pseudo'), 1), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php b/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php deleted file mode 100644 index c34fe5f..0000000 --- a/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Node; - -use Symfony\Component\CssSelector\Node\Specificity; - -class SpecificityTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getValueTestData */ - public function testValue(Specificity $specificity, $value) - { - $this->assertEquals($value, $specificity->getValue()); - } - - /** @dataProvider getValueTestData */ - public function testPlusValue(Specificity $specificity, $value) - { - $this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue()); - } - - public function getValueTestData() - { - return array( - array(new Specificity(0, 0, 0), 0), - array(new Specificity(0, 0, 2), 2), - array(new Specificity(0, 3, 0), 30), - array(new Specificity(4, 0, 0), 400), - array(new Specificity(4, 3, 2), 432), - ); - } - - /** @dataProvider getCompareTestData */ - public function testCompareTo(Specificity $a, Specificity $b, $result) - { - $this->assertEquals($result, $a->compareTo($b)); - } - - public function getCompareTestData() - { - return array( - array(new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0), - array(new Specificity(0, 0, 1), new Specificity(0, 0, 1), 0), - array(new Specificity(0, 0, 2), new Specificity(0, 0, 1), 1), - array(new Specificity(0, 0, 2), new Specificity(0, 0, 3), -1), - array(new Specificity(0, 4, 0), new Specificity(0, 4, 0), 0), - array(new Specificity(0, 6, 0), new Specificity(0, 5, 11), 1), - array(new Specificity(0, 7, 0), new Specificity(0, 8, 0), -1), - array(new Specificity(9, 0, 0), new Specificity(9, 0, 0), 0), - array(new Specificity(11, 0, 0), new Specificity(10, 11, 0), 1), - array(new Specificity(12, 11, 0), new Specificity(13, 0, 0), -1), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php b/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php deleted file mode 100644 index a06dca0..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * @author Jean-François Simon - */ -abstract class AbstractHandlerTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getHandleValueTestData */ - public function testHandleValue($value, Token $expectedToken, $remainingContent) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertTrue($this->generateHandler()->handle($reader, $stream)); - $this->assertEquals($expectedToken, $stream->getNext()); - $this->assertRemainingContent($reader, $remainingContent); - } - - /** @dataProvider getDontHandleValueTestData */ - public function testDontHandleValue($value) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertFalse($this->generateHandler()->handle($reader, $stream)); - $this->assertStreamEmpty($stream); - $this->assertRemainingContent($reader, $value); - } - - abstract public function getHandleValueTestData(); - abstract public function getDontHandleValueTestData(); - abstract protected function generateHandler(); - - protected function assertStreamEmpty(TokenStream $stream) - { - $property = new \ReflectionProperty($stream, 'tokens'); - $property->setAccessible(true); - - $this->assertEquals(array(), $property->getValue($stream)); - } - - protected function assertRemainingContent(Reader $reader, $remainingContent) - { - if ('' === $remainingContent) { - $this->assertEquals(0, $reader->getRemainingLength()); - $this->assertTrue($reader->isEOF()); - } else { - $this->assertEquals(strlen($remainingContent), $reader->getRemainingLength()); - $this->assertEquals(0, $reader->getOffset($remainingContent)); - } - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php b/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php deleted file mode 100644 index 3961bf7..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Handler\CommentHandler; -use Symfony\Component\CssSelector\Parser\Reader; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\TokenStream; - -class CommentHandlerTest extends AbstractHandlerTest -{ - /** @dataProvider getHandleValueTestData */ - public function testHandleValue($value, Token $unusedArgument, $remainingContent) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertTrue($this->generateHandler()->handle($reader, $stream)); - // comments are ignored (not pushed as token in stream) - $this->assertStreamEmpty($stream); - $this->assertRemainingContent($reader, $remainingContent); - } - - public function getHandleValueTestData() - { - return array( - // 2nd argument only exists for inherited method compatibility - array('/* comment */', new Token(null, null, null), ''), - array('/* comment */foo', new Token(null, null, null), 'foo'), - ); - } - - public function getDontHandleValueTestData() - { - return array( - array('>'), - array('+'), - array(' '), - ); - } - - protected function generateHandler() - { - return new CommentHandler(); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Handler/HashHandlerTest.php b/vendor/symfony/css-selector/Tests/Parser/Handler/HashHandlerTest.php deleted file mode 100644 index b7fa00a..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Handler/HashHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Handler\HashHandler; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; - -class HashHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return array( - array('#id', new Token(Token::TYPE_HASH, 'id', 0), ''), - array('#123', new Token(Token::TYPE_HASH, '123', 0), ''), - - array('#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'), - array('#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'), - ); - } - - public function getDontHandleValueTestData() - { - return array( - array('id'), - array('123'), - array('<'), - array('<'), - array('#'), - ); - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new HashHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Handler/IdentifierHandlerTest.php b/vendor/symfony/css-selector/Tests/Parser/Handler/IdentifierHandlerTest.php deleted file mode 100644 index 44d3574..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Handler/IdentifierHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; - -class IdentifierHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return array( - array('foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''), - array('foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'), - array('foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'), - array('foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'), - array('foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'), - ); - } - - public function getDontHandleValueTestData() - { - return array( - array('>'), - array('+'), - array(' '), - array('*|foo'), - array('/* comment */'), - ); - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new IdentifierHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Handler/NumberHandlerTest.php b/vendor/symfony/css-selector/Tests/Parser/Handler/NumberHandlerTest.php deleted file mode 100644 index 675fd05..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Handler/NumberHandlerTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Handler\NumberHandler; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class NumberHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return array( - array('12', new Token(Token::TYPE_NUMBER, '12', 0), ''), - array('12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''), - array('+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''), - array('-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''), - - array('12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'), - array('12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'), - ); - } - - public function getDontHandleValueTestData() - { - return array( - array('hello'), - array('>'), - array('+'), - array(' '), - array('/* comment */'), - ); - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new NumberHandler($patterns); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php b/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php deleted file mode 100644 index 89eff8b..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Handler\StringHandler; -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; -use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; - -class StringHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return array( - array('"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''), - array('"1"', new Token(Token::TYPE_STRING, '1', 1), ''), - array('" "', new Token(Token::TYPE_STRING, ' ', 1), ''), - array('""', new Token(Token::TYPE_STRING, '', 1), ''), - array("'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''), - - array("'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'), - ); - } - - public function getDontHandleValueTestData() - { - return array( - array('hello'), - array('>'), - array('1'), - array(' '), - ); - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new StringHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Handler/WhitespaceHandlerTest.php b/vendor/symfony/css-selector/Tests/Parser/Handler/WhitespaceHandlerTest.php deleted file mode 100644 index f5f9e71..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Handler/WhitespaceHandlerTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Handler; - -use Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler; -use Symfony\Component\CssSelector\Parser\Token; - -class WhitespaceHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return array( - array(' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''), - array("\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''), - array("\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''), - - array(' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'), - array(' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'), - ); - } - - public function getDontHandleValueTestData() - { - return array( - array('>'), - array('1'), - array('a'), - ); - } - - protected function generateHandler() - { - return new WhitespaceHandler(); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/ParserTest.php b/vendor/symfony/css-selector/Tests/Parser/ParserTest.php deleted file mode 100644 index 0454d9f..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/ParserTest.php +++ /dev/null @@ -1,248 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser; - -use Symfony\Component\CssSelector\Exception\SyntaxErrorException; -use Symfony\Component\CssSelector\Node\FunctionNode; -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\Parser; -use Symfony\Component\CssSelector\Parser\Token; - -class ParserTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getParserTestData */ - public function testParser($source, $representation) - { - $parser = new Parser(); - - $this->assertEquals($representation, array_map(function (SelectorNode $node) { - return (string) $node->getTree(); - }, $parser->parse($source))); - } - - /** @dataProvider getParserExceptionTestData */ - public function testParserException($source, $message) - { - $parser = new Parser(); - - try { - $parser->parse($source); - $this->fail('Parser should throw a SyntaxErrorException.'); - } catch (SyntaxErrorException $e) { - $this->assertEquals($message, $e->getMessage()); - } - } - - /** @dataProvider getPseudoElementsTestData */ - public function testPseudoElements($source, $element, $pseudo) - { - $parser = new Parser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($element, (string) $selector->getTree()); - $this->assertEquals($pseudo, (string) $selector->getPseudoElement()); - } - - /** @dataProvider getSpecificityTestData */ - public function testSpecificity($source, $value) - { - $parser = new Parser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($value, $selector->getSpecificity()->getValue()); - } - - /** @dataProvider getParseSeriesTestData */ - public function testParseSeries($series, $a, $b) - { - $parser = new Parser(); - $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); - $this->assertCount(1, $selectors); - - /** @var FunctionNode $function */ - $function = $selectors[0]->getTree(); - $this->assertEquals(array($a, $b), Parser::parseSeries($function->getArguments())); - } - - /** @dataProvider getParseSeriesExceptionTestData */ - public function testParseSeriesException($series) - { - $parser = new Parser(); - $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); - $this->assertCount(1, $selectors); - - /** @var FunctionNode $function */ - $function = $selectors[0]->getTree(); - $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - Parser::parseSeries($function->getArguments()); - } - - public function getParserTestData() - { - return array( - array('*', array('Element[*]')), - array('*|*', array('Element[*]')), - array('*|foo', array('Element[foo]')), - array('foo|*', array('Element[foo|*]')), - array('foo|bar', array('Element[foo|bar]')), - array('#foo#bar', array('Hash[Hash[Element[*]#foo]#bar]')), - array('div>.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('div> .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('div >.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('div > .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array("div \n> \t \t .foo", array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('div, td.foo, div.bar span', array('Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] Element[span]]')), - array('div > p', array('CombinedSelector[Element[div] > Element[p]]')), - array('td:first', array('Pseudo[Element[td]:first]')), - array('td :first', array('CombinedSelector[Element[td] Pseudo[Element[*]:first]]')), - array('a[name]', array('Attribute[Element[a][name]]')), - array("a[ name\t]", array('Attribute[Element[a][name]]')), - array('a [name]', array('CombinedSelector[Element[a] Attribute[Element[*][name]]]')), - array('a[rel="include"]', array("Attribute[Element[a][rel = 'include']]")), - array('a[rel = include]', array("Attribute[Element[a][rel = 'include']]")), - array("a[hreflang |= 'en']", array("Attribute[Element[a][hreflang |= 'en']]")), - array('a[hreflang|=en]', array("Attribute[Element[a][hreflang |= 'en']]")), - array('div:nth-child(10)', array("Function[Element[div]:nth-child(['10'])]")), - array(':nth-child(2n+2)', array("Function[Element[*]:nth-child(['2', 'n', '+2'])]")), - array('div:nth-of-type(10)', array("Function[Element[div]:nth-of-type(['10'])]")), - array('div div:nth-of-type(10) .aclass', array("CombinedSelector[CombinedSelector[Element[div] Function[Element[div]:nth-of-type(['10'])]] Class[Element[*].aclass]]")), - array('label:only', array('Pseudo[Element[label]:only]')), - array('a:lang(fr)', array("Function[Element[a]:lang(['fr'])]")), - array('div:contains("foo")', array("Function[Element[div]:contains(['foo'])]")), - array('div#foobar', array('Hash[Element[div]#foobar]')), - array('div:not(div.foo)', array('Negation[Element[div]:not(Class[Element[div].foo])]')), - array('td ~ th', array('CombinedSelector[Element[td] ~ Element[th]]')), - array('.foo[data-bar][data-baz=0]', array("Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]")), - ); - } - - public function getParserExceptionTestData() - { - return array( - array('attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()), - array('attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()), - array('html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()), - array(' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()), - array('div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()), - array(' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()), - array('p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()), - array('div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()), - array(' > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()), - array('foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()), - array('#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()), - array('.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()), - array(':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()), - array('[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()), - array('[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()), - array('[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()), - array('[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()), - array(':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()), - array('[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()), - array('[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()), - array('[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()), - array(':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()), - array(':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()), - array('foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()), - ); - } - - public function getPseudoElementsTestData() - { - return array( - array('foo', 'Element[foo]', ''), - array('*', 'Element[*]', ''), - array(':empty', 'Pseudo[Element[*]:empty]', ''), - array(':BEfore', 'Element[*]', 'before'), - array(':aftER', 'Element[*]', 'after'), - array(':First-Line', 'Element[*]', 'first-line'), - array(':First-Letter', 'Element[*]', 'first-letter'), - array('::befoRE', 'Element[*]', 'before'), - array('::AFter', 'Element[*]', 'after'), - array('::firsT-linE', 'Element[*]', 'first-line'), - array('::firsT-letteR', 'Element[*]', 'first-letter'), - array('::Selection', 'Element[*]', 'selection'), - array('foo:after', 'Element[foo]', 'after'), - array('foo::selection', 'Element[foo]', 'selection'), - array('lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'), - ); - } - - public function getSpecificityTestData() - { - return array( - array('*', 0), - array(' foo', 1), - array(':empty ', 10), - array(':before', 1), - array('*:before', 1), - array(':nth-child(2)', 10), - array('.bar', 10), - array('[baz]', 10), - array('[baz="4"]', 10), - array('[baz^="4"]', 10), - array('#lipsum', 100), - array(':not(*)', 0), - array(':not(foo)', 1), - array(':not(.foo)', 10), - array(':not([foo])', 10), - array(':not(:empty)', 10), - array(':not(#foo)', 100), - array('foo:empty', 11), - array('foo:before', 2), - array('foo::before', 2), - array('foo:empty::before', 12), - array('#lorem + foo#ipsum:first-child > bar:first-line', 213), - ); - } - - public function getParseSeriesTestData() - { - return array( - array('1n+3', 1, 3), - array('1n +3', 1, 3), - array('1n + 3', 1, 3), - array('1n+ 3', 1, 3), - array('1n-3', 1, -3), - array('1n -3', 1, -3), - array('1n - 3', 1, -3), - array('1n- 3', 1, -3), - array('n-5', 1, -5), - array('odd', 2, 1), - array('even', 2, 0), - array('3n', 3, 0), - array('n', 1, 0), - array('+n', 1, 0), - array('-n', -1, 0), - array('5', 0, 5), - ); - } - - public function getParseSeriesExceptionTestData() - { - return array( - array('foo'), - array('n+'), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php b/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php deleted file mode 100644 index 03c054e..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser; - -use Symfony\Component\CssSelector\Parser\Reader; - -class ReaderTest extends \PHPUnit_Framework_TestCase -{ - public function testIsEOF() - { - $reader = new Reader(''); - $this->assertTrue($reader->isEOF()); - - $reader = new Reader('hello'); - $this->assertFalse($reader->isEOF()); - - $this->assignPosition($reader, 2); - $this->assertFalse($reader->isEOF()); - - $this->assignPosition($reader, 5); - $this->assertTrue($reader->isEOF()); - } - - public function testGetRemainingLength() - { - $reader = new Reader('hello'); - $this->assertEquals(5, $reader->getRemainingLength()); - - $this->assignPosition($reader, 2); - $this->assertEquals(3, $reader->getRemainingLength()); - - $this->assignPosition($reader, 5); - $this->assertEquals(0, $reader->getRemainingLength()); - } - - public function testGetSubstring() - { - $reader = new Reader('hello'); - $this->assertEquals('he', $reader->getSubstring(2)); - $this->assertEquals('el', $reader->getSubstring(2, 1)); - - $this->assignPosition($reader, 2); - $this->assertEquals('ll', $reader->getSubstring(2)); - $this->assertEquals('lo', $reader->getSubstring(2, 1)); - } - - public function testGetOffset() - { - $reader = new Reader('hello'); - $this->assertEquals(2, $reader->getOffset('ll')); - $this->assertFalse($reader->getOffset('w')); - - $this->assignPosition($reader, 2); - $this->assertEquals(0, $reader->getOffset('ll')); - $this->assertFalse($reader->getOffset('he')); - } - - public function testFindPattern() - { - $reader = new Reader('hello'); - - $this->assertFalse($reader->findPattern('/world/')); - $this->assertEquals(array('hello', 'h'), $reader->findPattern('/^([a-z]).*/')); - - $this->assignPosition($reader, 2); - $this->assertFalse($reader->findPattern('/^h.*/')); - $this->assertEquals(array('llo'), $reader->findPattern('/^llo$/')); - } - - public function testMoveForward() - { - $reader = new Reader('hello'); - $this->assertEquals(0, $reader->getPosition()); - - $reader->moveForward(2); - $this->assertEquals(2, $reader->getPosition()); - } - - public function testToEnd() - { - $reader = new Reader('hello'); - $reader->moveToEnd(); - $this->assertTrue($reader->isEOF()); - } - - private function assignPosition(Reader $reader, $value) - { - $position = new \ReflectionProperty($reader, 'position'); - $position->setAccessible(true); - $position->setValue($reader, $value); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php b/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php deleted file mode 100644 index 6efdd67..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser; - -/** - * @author Jean-François Simon - */ -class ClassParserTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new ClassParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return array( - array('.testclass', 'Class[Element[*].testclass]'), - array('testel.testclass', 'Class[Element[testel].testclass]'), - array('testns|.testclass', 'Class[Element[testns|*].testclass]'), - array('testns|*.testclass', 'Class[Element[testns|*].testclass]'), - array('testns|testel.testclass', 'Class[Element[testns|testel].testclass]'), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php b/vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php deleted file mode 100644 index b30b5ee..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser; - -/** - * @author Jean-François Simon - */ -class ElementParserTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new ElementParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return array( - array('*', 'Element[*]'), - array('testel', 'Element[testel]'), - array('testns|*', 'Element[testns|*]'), - array('testns|testel', 'Element[testns|testel]'), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php b/vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php deleted file mode 100644 index b7c3539..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; - -/** - * @author Jean-François Simon - */ -class EmptyStringParserTest extends \PHPUnit_Framework_TestCase -{ - public function testParse() - { - $parser = new EmptyStringParser(); - $selectors = $parser->parse(''); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals('Element[*]', (string) $selector->getTree()); - - $selectors = $parser->parse('this will produce an empty array'); - $this->assertCount(0, $selectors); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php b/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php deleted file mode 100644 index d2ce891..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use Symfony\Component\CssSelector\Node\SelectorNode; -use Symfony\Component\CssSelector\Parser\Shortcut\HashParser; - -/** - * @author Jean-François Simon - */ -class HashParserTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new HashParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return array( - array('#testid', 'Hash[Element[*]#testid]'), - array('testel#testid', 'Hash[Element[testel]#testid]'), - array('testns|#testid', 'Hash[Element[testns|*]#testid]'), - array('testns|*#testid', 'Hash[Element[testns|*]#testid]'), - array('testns|testel#testid', 'Hash[Element[testns|testel]#testid]'), - ); - } -} diff --git a/vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php b/vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php deleted file mode 100644 index 8f3253a..0000000 --- a/vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\Parser; - -use Symfony\Component\CssSelector\Parser\Token; -use Symfony\Component\CssSelector\Parser\TokenStream; - -class TokenStreamTest extends \PHPUnit_Framework_TestCase -{ - public function testGetNext() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); - - $this->assertSame($t1, $stream->getNext()); - $this->assertSame($t2, $stream->getNext()); - $this->assertSame($t3, $stream->getNext()); - } - - public function testGetPeek() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); - - $this->assertSame($t1, $stream->getPeek()); - $this->assertSame($t1, $stream->getNext()); - $this->assertSame($t2, $stream->getPeek()); - $this->assertSame($t2, $stream->getPeek()); - $this->assertSame($t2, $stream->getNext()); - } - - public function testGetNextIdentifier() - { - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - - $this->assertEquals('h1', $stream->getNextIdentifier()); - } - - public function testFailToGetNextIdentifier() - { - $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->getNextIdentifier(); - } - - public function testGetNextIdentifierOrStar() - { - $stream = new TokenStream(); - - $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $this->assertEquals('h1', $stream->getNextIdentifierOrStar()); - - $stream->push(new Token(Token::TYPE_DELIMITER, '*', 0)); - $this->assertNull($stream->getNextIdentifierOrStar()); - } - - public function testFailToGetNextIdentifierOrStar() - { - $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->getNextIdentifierOrStar(); - } - - public function testSkipWhitespace() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_WHITESPACE, ' ', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'h1', 3)); - - $stream->skipWhitespace(); - $this->assertSame($t1, $stream->getNext()); - - $stream->skipWhitespace(); - $this->assertSame($t3, $stream->getNext()); - } -} diff --git a/vendor/symfony/css-selector/Tests/XPath/Fixtures/ids.html b/vendor/symfony/css-selector/Tests/XPath/Fixtures/ids.html deleted file mode 100644 index 5799fad..0000000 --- a/vendor/symfony/css-selector/Tests/XPath/Fixtures/ids.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - -
- - - - link -
    -
  1. content
  2. -
  3. -
    -
    -
  4. -
  5. -
  6. -
  7. -
  8. -
  9. -
-

- hi there - guy - - - - - - - -

- - -
-

-
    -
- - - - -
-
- diff --git a/vendor/symfony/css-selector/Tests/XPath/Fixtures/lang.xml b/vendor/symfony/css-selector/Tests/XPath/Fixtures/lang.xml deleted file mode 100644 index 14f8dbe..0000000 --- a/vendor/symfony/css-selector/Tests/XPath/Fixtures/lang.xml +++ /dev/null @@ -1,11 +0,0 @@ - - a - b - c - d - e - f - - - - diff --git a/vendor/symfony/css-selector/Tests/XPath/Fixtures/shakespear.html b/vendor/symfony/css-selector/Tests/XPath/Fixtures/shakespear.html deleted file mode 100644 index 15d1ad3..0000000 --- a/vendor/symfony/css-selector/Tests/XPath/Fixtures/shakespear.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - -
-
-

As You Like It

-
- by William Shakespeare -
-
-

ACT I, SCENE III. A room in the palace.

-
-
Enter CELIA and ROSALIND
-
-
CELIA
-
-
Why, cousin! why, Rosalind! Cupid have mercy! not a word?
-
-
ROSALIND
-
-
Not one to throw at a dog.
-
-
CELIA
-
-
No, thy words are too precious to be cast away upon
-
curs; throw some of them at me; come, lame me with reasons.
-
-
ROSALIND
-
CELIA
-
-
But is all this for your father?
-
-
-
Then there were two cousins laid up; when the one
-
should be lamed with reasons and the other mad
-
without any.
-
-
ROSALIND
-
-
No, some of it is for my child's father. O, how
-
full of briers is this working-day world!
-
-
CELIA
-
-
They are but burs, cousin, thrown upon thee in
-
holiday foolery: if we walk not in the trodden
-
paths our very petticoats will catch them.
-
-
ROSALIND
-
-
I could shake them off my coat: these burs are in my heart.
-
-
CELIA
-
-
Hem them away.
-
-
ROSALIND
-
-
I would try, if I could cry 'hem' and have him.
-
-
CELIA
-
-
Come, come, wrestle with thy affections.
-
-
ROSALIND
-
-
O, they take the part of a better wrestler than myself!
-
-
CELIA
-
-
O, a good wish upon you! you will try in time, in
-
despite of a fall. But, turning these jests out of
-
service, let us talk in good earnest: is it
-
possible, on such a sudden, you should fall into so
-
strong a liking with old Sir Rowland's youngest son?
-
-
ROSALIND
-
-
The duke my father loved his father dearly.
-
-
CELIA
-
-
Doth it therefore ensue that you should love his son
-
dearly? By this kind of chase, I should hate him,
-
for my father hated his father dearly; yet I hate
-
not Orlando.
-
-
ROSALIND
-
-
No, faith, hate him not, for my sake.
-
-
CELIA
-
-
Why should I not? doth he not deserve well?
-
-
ROSALIND
-
-
Let me love him for that, and do you love him
-
because I do. Look, here comes the duke.
-
-
CELIA
-
-
With his eyes full of anger.
-
Enter DUKE FREDERICK, with Lords
-
-
DUKE FREDERICK
-
-
Mistress, dispatch you with your safest haste
-
And get you from our court.
-
-
ROSALIND
-
-
Me, uncle?
-
-
DUKE FREDERICK
-
-
You, cousin
-
Within these ten days if that thou be'st found
-
So near our public court as twenty miles,
-
Thou diest for it.
-
-
ROSALIND
-
-
I do beseech your grace,
-
Let me the knowledge of my fault bear with me:
-
If with myself I hold intelligence
-
Or have acquaintance with mine own desires,
-
If that I do not dream or be not frantic,--
-
As I do trust I am not--then, dear uncle,
-
Never so much as in a thought unborn
-
Did I offend your highness.
-
-
DUKE FREDERICK
-
-
Thus do all traitors:
-
If their purgation did consist in words,
-
They are as innocent as grace itself:
-
Let it suffice thee that I trust thee not.
-
-
ROSALIND
-
-
Yet your mistrust cannot make me a traitor:
-
Tell me whereon the likelihood depends.
-
-
DUKE FREDERICK
-
-
Thou art thy father's daughter; there's enough.
-
-
ROSALIND
-
-
So was I when your highness took his dukedom;
-
So was I when your highness banish'd him:
-
Treason is not inherited, my lord;
-
Or, if we did derive it from our friends,
-
What's that to me? my father was no traitor:
-
Then, good my liege, mistake me not so much
-
To think my poverty is treacherous.
-
-
CELIA
-
-
Dear sovereign, hear me speak.
-
-
DUKE FREDERICK
-
-
Ay, Celia; we stay'd her for your sake,
-
Else had she with her father ranged along.
-
-
CELIA
-
-
I did not then entreat to have her stay;
-
It was your pleasure and your own remorse:
-
I was too young that time to value her;
-
But now I know her: if she be a traitor,
-
Why so am I; we still have slept together,
-
Rose at an instant, learn'd, play'd, eat together,
-
And wheresoever we went, like Juno's swans,
-
Still we went coupled and inseparable.
-
-
DUKE FREDERICK
-
-
She is too subtle for thee; and her smoothness,
-
Her very silence and her patience
-
Speak to the people, and they pity her.
-
Thou art a fool: she robs thee of thy name;
-
And thou wilt show more bright and seem more virtuous
-
When she is gone. Then open not thy lips:
-
Firm and irrevocable is my doom
-
Which I have pass'd upon her; she is banish'd.
-
-
CELIA
-
-
Pronounce that sentence then on me, my liege:
-
I cannot live out of her company.
-
-
DUKE FREDERICK
-
-
You are a fool. You, niece, provide yourself:
-
If you outstay the time, upon mine honour,
-
And in the greatness of my word, you die.
-
Exeunt DUKE FREDERICK and Lords
-
-
CELIA
-
-
O my poor Rosalind, whither wilt thou go?
-
Wilt thou change fathers? I will give thee mine.
-
I charge thee, be not thou more grieved than I am.
-
-
ROSALIND
-
-
I have more cause.
-
-
CELIA
-
-
Thou hast not, cousin;
-
Prithee be cheerful: know'st thou not, the duke
-
Hath banish'd me, his daughter?
-
-
ROSALIND
-
-
That he hath not.
-
-
CELIA
-
-
No, hath not? Rosalind lacks then the love
-
Which teacheth thee that thou and I am one:
-
Shall we be sunder'd? shall we part, sweet girl?
-
No: let my father seek another heir.
-
Therefore devise with me how we may fly,
-
Whither to go and what to bear with us;
-
And do not seek to take your change upon you,
-
To bear your griefs yourself and leave me out;
-
For, by this heaven, now at our sorrows pale,
-
Say what thou canst, I'll go along with thee.
-
-
ROSALIND
-
-
Why, whither shall we go?
-
-
CELIA
-
-
To seek my uncle in the forest of Arden.
-
-
ROSALIND
-
-
Alas, what danger will it be to us,
-
Maids as we are, to travel forth so far!
-
Beauty provoketh thieves sooner than gold.
-
-
CELIA
-
-
I'll put myself in poor and mean attire
-
And with a kind of umber smirch my face;
-
The like do you: so shall we pass along
-
And never stir assailants.
-
-
ROSALIND
-
-
Were it not better,
-
Because that I am more than common tall,
-
That I did suit me all points like a man?
-
A gallant curtle-axe upon my thigh,
-
A boar-spear in my hand; and--in my heart
-
Lie there what hidden woman's fear there will--
-
We'll have a swashing and a martial outside,
-
As many other mannish cowards have
-
That do outface it with their semblances.
-
-
CELIA
-
-
What shall I call thee when thou art a man?
-
-
ROSALIND
-
-
I'll have no worse a name than Jove's own page;
-
And therefore look you call me Ganymede.
-
But what will you be call'd?
-
-
CELIA
-
-
Something that hath a reference to my state
-
No longer Celia, but Aliena.
-
-
ROSALIND
-
-
But, cousin, what if we assay'd to steal
-
The clownish fool out of your father's court?
-
Would he not be a comfort to our travel?
-
-
CELIA
-
-
He'll go along o'er the wide world with me;
-
Leave me alone to woo him. Let's away,
-
And get our jewels and our wealth together,
-
Devise the fittest time and safest way
-
To hide us from pursuit that will be made
-
After my flight. Now go we in content
-
To liberty and not to banishment.
-
Exeunt
-
-
-
-
- - diff --git a/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php b/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php deleted file mode 100644 index 143328f..0000000 --- a/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php +++ /dev/null @@ -1,324 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests\XPath; - -use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; -use Symfony\Component\CssSelector\XPath\Translator; - -class TranslatorTest extends \PHPUnit_Framework_TestCase -{ - /** @dataProvider getXpathLiteralTestData */ - public function testXpathLiteral($value, $literal) - { - $this->assertEquals($literal, Translator::getXpathLiteral($value)); - } - - /** @dataProvider getCssToXPathTestData */ - public function testCssToXPath($css, $xpath) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $this->assertEquals($xpath, $translator->cssToXPath($css, '')); - } - - /** @dataProvider getXmlLangTestData */ - public function testXmlLang($css, array $elementsId) - { - $translator = new Translator(); - $document = new \SimpleXMLElement(file_get_contents(__DIR__.'/Fixtures/lang.xml')); - $elements = $document->xpath($translator->cssToXPath($css)); - $this->assertEquals(count($elementsId), count($elements)); - foreach ($elements as $element) { - $this->assertTrue(in_array($element->attributes()->id, $elementsId)); - } - } - - /** @dataProvider getHtmlIdsTestData */ - public function testHtmlIds($css, array $elementsId) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->strictErrorChecking = false; - $internalErrors = libxml_use_internal_errors(true); - $document->loadHTMLFile(__DIR__.'/Fixtures/ids.html'); - $document = simplexml_import_dom($document); - $elements = $document->xpath($translator->cssToXPath($css)); - $this->assertCount(count($elementsId), $elementsId); - foreach ($elements as $element) { - if (null !== $element->attributes()->id) { - $this->assertTrue(in_array($element->attributes()->id, $elementsId)); - } - } - libxml_clear_errors(); - libxml_use_internal_errors($internalErrors); - } - - /** @dataProvider getHtmlShakespearTestData */ - public function testHtmlShakespear($css, $count) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->strictErrorChecking = false; - $document->loadHTMLFile(__DIR__.'/Fixtures/shakespear.html'); - $document = simplexml_import_dom($document); - $bodies = $document->xpath('//body'); - $elements = $bodies[0]->xpath($translator->cssToXPath($css)); - $this->assertEquals($count, count($elements)); - } - - public function getXpathLiteralTestData() - { - return array( - array('foo', "'foo'"), - array("foo's bar", '"foo\'s bar"'), - array("foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'), - array("foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'), - ); - } - - public function getCssToXPathTestData() - { - return array( - array('*', '*'), - array('e', 'e'), - array('*|e', 'e'), - array('e|f', 'e:f'), - array('e[foo]', 'e[@foo]'), - array('e[foo|bar]', 'e[@foo:bar]'), - array('e[foo="bar"]', "e[@foo = 'bar']"), - array('e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"), - array('e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"), - array('e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"), - array('e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"), - array('e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"), - array('e:nth-child(1)', "*/*[name() = 'e' and (position() = 1)]"), - array('e:nth-last-child(1)', "*/*[name() = 'e' and (position() = last() - 0)]"), - array('e:nth-last-child(2n+2)', "*/*[name() = 'e' and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"), - array('e:nth-of-type(1)', '*/e[position() = 1]'), - array('e:nth-last-of-type(1)', '*/e[position() = last() - 0]'), - array('div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"), - array('e:first-child', "*/*[name() = 'e' and (position() = 1)]"), - array('e:last-child', "*/*[name() = 'e' and (position() = last())]"), - array('e:first-of-type', '*/e[position() = 1]'), - array('e:last-of-type', '*/e[position() = last()]'), - array('e:only-child', "*/*[name() = 'e' and (last() = 1)]"), - array('e:only-of-type', 'e[last() = 1]'), - array('e:empty', 'e[not(*) and not(string-length())]'), - array('e:EmPTY', 'e[not(*) and not(string-length())]'), - array('e:root', 'e[not(parent::*)]'), - array('e:hover', 'e[0]'), - array('e:contains("foo")', "e[contains(string(.), 'foo')]"), - array('e:ConTains(foo)', "e[contains(string(.), 'foo')]"), - array('e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"), - array('e#myid', "e[@id = 'myid']"), - array('e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'), - array('e:nOT(*)', 'e[0]'), - array('e f', 'e/descendant-or-self::*/f'), - array('e > f', 'e/f'), - array('e + f', "e/following-sibling::*[name() = 'f' and (position() = 1)]"), - array('e ~ f', 'e/following-sibling::f'), - array('div#container p', "div[@id = 'container']/descendant-or-self::*/p"), - ); - } - - public function getXmlLangTestData() - { - return array( - array(':lang("EN")', array('first', 'second', 'third', 'fourth')), - array(':lang("en-us")', array('second', 'fourth')), - array(':lang(en-nz)', array('third')), - array(':lang(fr)', array('fifth')), - array(':lang(ru)', array('sixth')), - array(":lang('ZH')", array('eighth')), - array(':lang(de) :lang(zh)', array('eighth')), - array(':lang(en), :lang(zh)', array('first', 'second', 'third', 'fourth', 'eighth')), - array(':lang(es)', array()), - ); - } - - public function getHtmlIdsTestData() - { - return array( - array('div', array('outer-div', 'li-div', 'foobar-div')), - array('DIV', array('outer-div', 'li-div', 'foobar-div')), // case-insensitive in HTML - array('div div', array('li-div')), - array('div, div div', array('outer-div', 'li-div', 'foobar-div')), - array('a[name]', array('name-anchor')), - array('a[NAme]', array('name-anchor')), // case-insensitive in HTML: - array('a[rel]', array('tag-anchor', 'nofollow-anchor')), - array('a[rel="tag"]', array('tag-anchor')), - array('a[href*="localhost"]', array('tag-anchor')), - array('a[href*=""]', array()), - array('a[href^="http"]', array('tag-anchor', 'nofollow-anchor')), - array('a[href^="http:"]', array('tag-anchor')), - array('a[href^=""]', array()), - array('a[href$="org"]', array('nofollow-anchor')), - array('a[href$=""]', array()), - array('div[foobar~="bc"]', array('foobar-div')), - array('div[foobar~="cde"]', array('foobar-div')), - array('[foobar~="ab bc"]', array('foobar-div')), - array('[foobar~=""]', array()), - array('[foobar~=" \t"]', array()), - array('div[foobar~="cd"]', array()), - array('*[lang|="En"]', array('second-li')), - array('[lang|="En-us"]', array('second-li')), - // Attribute values are case sensitive - array('*[lang|="en"]', array()), - array('[lang|="en-US"]', array()), - array('*[lang|="e"]', array()), - // ... :lang() is not. - array(':lang("EN")', array('second-li', 'li-div')), - array('*:lang(en-US)', array('second-li', 'li-div')), - array(':lang("e")', array()), - array('li:nth-child(3)', array('third-li')), - array('li:nth-child(10)', array()), - array('li:nth-child(2n)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-child(even)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-child(2n+0)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-child(+2n+1)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')), - array('li:nth-child(odd)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')), - array('li:nth-child(2n+4)', array('fourth-li', 'sixth-li')), - array('li:nth-child(3n+1)', array('first-li', 'fourth-li', 'seventh-li')), - array('li:nth-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(n+3)', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(-n)', array()), - array('li:nth-child(-n-1)', array()), - array('li:nth-child(-n+1)', array('first-li')), - array('li:nth-child(-n+3)', array('first-li', 'second-li', 'third-li')), - array('li:nth-last-child(0)', array()), - array('li:nth-last-child(2n)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-last-child(even)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-last-child(2n+2)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-last-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n-3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n+3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li')), - array('li:nth-last-child(-n)', array()), - array('li:nth-last-child(-n-1)', array()), - array('li:nth-last-child(-n+1)', array('seventh-li')), - array('li:nth-last-child(-n+3)', array('fifth-li', 'sixth-li', 'seventh-li')), - array('ol:first-of-type', array('first-ol')), - array('ol:nth-child(1)', array('first-ol')), - array('ol:nth-of-type(2)', array('second-ol')), - array('ol:nth-last-of-type(1)', array('second-ol')), - array('span:only-child', array('foobar-span')), - array('li div:only-child', array('li-div')), - array('div *:only-child', array('li-div', 'foobar-span')), - array('p:only-of-type', array('paragraph')), - array('a:empty', array('name-anchor')), - array('a:EMpty', array('name-anchor')), - array('li:empty', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li')), - array(':root', array('html')), - array('html:root', array('html')), - array('li:root', array()), - array('* :root', array()), - array('*:contains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')), - array(':CONtains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')), - array('*:contains("LInk")', array()), // case sensitive - array('*:contains("e")', array('html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em')), - array('*:contains("E")', array()), // case-sensitive - array('.a', array('first-ol')), - array('.b', array('first-ol')), - array('*.a', array('first-ol')), - array('ol.a', array('first-ol')), - array('.c', array('first-ol', 'third-li', 'fourth-li')), - array('*.c', array('first-ol', 'third-li', 'fourth-li')), - array('ol *.c', array('third-li', 'fourth-li')), - array('ol li.c', array('third-li', 'fourth-li')), - array('li ~ li.c', array('third-li', 'fourth-li')), - array('ol > li.c', array('third-li', 'fourth-li')), - array('#first-li', array('first-li')), - array('li#first-li', array('first-li')), - array('*#first-li', array('first-li')), - array('li div', array('li-div')), - array('li > div', array('li-div')), - array('div div', array('li-div')), - array('div > div', array()), - array('div>.c', array('first-ol')), - array('div > .c', array('first-ol')), - array('div + div', array('foobar-div')), - array('a ~ a', array('tag-anchor', 'nofollow-anchor')), - array('a[rel="tag"] ~ a', array('nofollow-anchor')), - array('ol#first-ol li:last-child', array('seventh-li')), - array('ol#first-ol *:last-child', array('li-div', 'seventh-li')), - array('#outer-div:first-child', array('outer-div')), - array('#outer-div :first-child', array('name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href')), - array('a[href]', array('tag-anchor', 'nofollow-anchor')), - array(':not(*)', array()), - array('a:not([href])', array('name-anchor')), - array('ol :Not(li[class])', array('first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li')), - // HTML-specific - array(':link', array('link-href', 'tag-anchor', 'nofollow-anchor', 'area-href')), - array(':visited', array()), - array(':enabled', array('link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href')), - array(':disabled', array('checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled')), - array(':checked', array('checkbox-checked', 'checkbox-disabled-checked')), - ); - } - - public function getHtmlShakespearTestData() - { - return array( - array('*', 246), - array('div:contains(CELIA)', 26), - array('div:only-child', 22), // ? - array('div:nth-child(even)', 106), - array('div:nth-child(2n)', 106), - array('div:nth-child(odd)', 137), - array('div:nth-child(2n+1)', 137), - array('div:nth-child(n)', 243), - array('div:last-child', 53), - array('div:first-child', 51), - array('div > div', 242), - array('div + div', 190), - array('div ~ div', 190), - array('body', 1), - array('body div', 243), - array('div', 243), - array('div div', 242), - array('div div div', 241), - array('div, div, div', 243), - array('div, a, span', 243), - array('.dialog', 51), - array('div.dialog', 51), - array('div .dialog', 51), - array('div.character, div.dialog', 99), - array('div.direction.dialog', 0), - array('div.dialog.direction', 0), - array('div.dialog.scene', 1), - array('div.scene.scene', 1), - array('div.scene .scene', 0), - array('div.direction .dialog ', 0), - array('div .dialog .direction', 4), - array('div.dialog .dialog .direction', 4), - array('#speech5', 1), - array('div#speech5', 1), - array('div #speech5', 1), - array('div.scene div.dialog', 49), - array('div#scene1 div.dialog div', 142), - array('#scene1 #speech1', 1), - array('div[class]', 103), - array('div[class=dialog]', 50), - array('div[class^=dia]', 51), - array('div[class$=log]', 50), - array('div[class*=sce]', 1), - array('div[class|=dialog]', 50), // ? Seems right - array('div[class!=madeup]', 243), // ? Seems right - array('div[class~=dialog]', 51), // ? Seems right - ); - } -} diff --git a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php b/vendor/symfony/debug/Tests/DebugClassLoaderTest.php deleted file mode 100644 index 1516dbe..0000000 --- a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php +++ /dev/null @@ -1,296 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests; - -use Symfony\Component\Debug\DebugClassLoader; -use Symfony\Component\Debug\ErrorHandler; -use Symfony\Component\Debug\Exception\ContextErrorException; - -class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var int Error reporting level before running tests. - */ - private $errorReporting; - - private $loader; - - protected function setUp() - { - $this->errorReporting = error_reporting(E_ALL | E_STRICT); - $this->loader = new ClassLoader(); - spl_autoload_register(array($this->loader, 'loadClass'), true, true); - DebugClassLoader::enable(); - } - - protected function tearDown() - { - DebugClassLoader::disable(); - spl_autoload_unregister(array($this->loader, 'loadClass')); - error_reporting($this->errorReporting); - } - - public function testIdempotence() - { - DebugClassLoader::enable(); - - $functions = spl_autoload_functions(); - foreach ($functions as $function) { - if (is_array($function) && $function[0] instanceof DebugClassLoader) { - $reflClass = new \ReflectionClass($function[0]); - $reflProp = $reflClass->getProperty('classLoader'); - $reflProp->setAccessible(true); - - $this->assertNotInstanceOf('Symfony\Component\Debug\DebugClassLoader', $reflProp->getValue($function[0])); - - return; - } - } - - $this->fail('DebugClassLoader did not register'); - } - - public function testUnsilencing() - { - if (PHP_VERSION_ID >= 70000) { - $this->markTestSkipped('PHP7 throws exceptions, unsilencing is not required anymore.'); - } - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('HHVM is not handled in this test case.'); - } - - ob_start(); - - $this->iniSet('log_errors', 0); - $this->iniSet('display_errors', 1); - - // See below: this will fail with parse error - // but this should not be @-silenced. - @class_exists(__NAMESPACE__.'\TestingUnsilencing', true); - - $output = ob_get_clean(); - - $this->assertStringMatchesFormat('%aParse error%a', $output); - } - - public function testStacking() - { - // the ContextErrorException must not be loaded to test the workaround - // for https://bugs.php.net/65322. - if (class_exists('Symfony\Component\Debug\Exception\ContextErrorException', false)) { - $this->markTestSkipped('The ContextErrorException class is already loaded.'); - } - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('HHVM is not handled in this test case.'); - } - - ErrorHandler::register(); - - try { - // Trigger autoloading + E_STRICT at compile time - // which in turn triggers $errorHandler->handle() - // that again triggers autoloading for ContextErrorException. - // Error stacking works around the bug above and everything is fine. - - eval(' - namespace '.__NAMESPACE__.'; - class ChildTestingStacking extends TestingStacking { function foo($bar) {} } - '); - $this->fail('ContextErrorException expected'); - } catch (\ErrorException $exception) { - // if an exception is thrown, the test passed - restore_error_handler(); - restore_exception_handler(); - $this->assertStringStartsWith(__FILE__, $exception->getFile()); - if (PHP_VERSION_ID < 70000) { - $this->assertRegExp('/^Runtime Notice: Declaration/', $exception->getMessage()); - $this->assertEquals(E_STRICT, $exception->getSeverity()); - } else { - $this->assertRegExp('/^Warning: Declaration/', $exception->getMessage()); - $this->assertEquals(E_WARNING, $exception->getSeverity()); - } - } catch (\Exception $exception) { - restore_error_handler(); - restore_exception_handler(); - - throw $exception; - } - } - - /** - * @expectedException \RuntimeException - */ - public function testNameCaseMismatch() - { - class_exists(__NAMESPACE__.'\TestingCaseMismatch', true); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Case mismatch between class and real file names - */ - public function testFileCaseMismatch() - { - if (!file_exists(__DIR__.'/Fixtures/CaseMismatch.php')) { - $this->markTestSkipped('Can only be run on case insensitive filesystems'); - } - - class_exists(__NAMESPACE__.'\Fixtures\CaseMismatch', true); - } - - /** - * @expectedException \RuntimeException - */ - public function testPsr4CaseMismatch() - { - class_exists(__NAMESPACE__.'\Fixtures\Psr4CaseMismatch', true); - } - - public function testNotPsr0() - { - $this->assertTrue(class_exists(__NAMESPACE__.'\Fixtures\NotPSR0', true)); - } - - public function testNotPsr0Bis() - { - $this->assertTrue(class_exists(__NAMESPACE__.'\Fixtures\NotPSR0bis', true)); - } - - public function testClassAlias() - { - $this->assertTrue(class_exists(__NAMESPACE__.'\Fixtures\ClassAlias', true)); - } - - /** - * @dataProvider provideDeprecatedSuper - */ - public function testDeprecatedSuper($class, $super, $type) - { - set_error_handler('var_dump', 0); - $e = error_reporting(0); - trigger_error('', E_USER_DEPRECATED); - - class_exists('Test\\'.__NAMESPACE__.'\\'.$class, true); - - error_reporting($e); - restore_error_handler(); - - $lastError = error_get_last(); - unset($lastError['file'], $lastError['line']); - - $xError = array( - 'type' => E_USER_DEPRECATED, - 'message' => 'The Test\Symfony\Component\Debug\Tests\\'.$class.' class '.$type.' Symfony\Component\Debug\Tests\Fixtures\\'.$super.' that is deprecated but this is a test deprecation notice.', - ); - - $this->assertSame($xError, $lastError); - } - - public function provideDeprecatedSuper() - { - return array( - array('DeprecatedInterfaceClass', 'DeprecatedInterface', 'implements'), - array('DeprecatedParentClass', 'DeprecatedClass', 'extends'), - ); - } - - public function testDeprecatedSuperInSameNamespace() - { - set_error_handler('var_dump', 0); - $e = error_reporting(0); - trigger_error('', E_USER_NOTICE); - - class_exists('Symfony\Bridge\Debug\Tests\Fixtures\ExtendsDeprecatedParent', true); - - error_reporting($e); - restore_error_handler(); - - $lastError = error_get_last(); - unset($lastError['file'], $lastError['line']); - - $xError = array( - 'type' => E_USER_NOTICE, - 'message' => '', - ); - - $this->assertSame($xError, $lastError); - } - - public function testReservedForPhp7() - { - if (PHP_VERSION_ID >= 70000) { - $this->markTestSkipped('PHP7 already prevents using reserved names.'); - } - - set_error_handler('var_dump', 0); - $e = error_reporting(0); - trigger_error('', E_USER_NOTICE); - - class_exists('Test\\'.__NAMESPACE__.'\\Float', true); - - error_reporting($e); - restore_error_handler(); - - $lastError = error_get_last(); - unset($lastError['file'], $lastError['line']); - - $xError = array( - 'type' => E_USER_DEPRECATED, - 'message' => 'Test\Symfony\Component\Debug\Tests\Float uses a reserved class name (Float) that will break on PHP 7 and higher', - ); - - $this->assertSame($xError, $lastError); - } -} - -class ClassLoader -{ - public function loadClass($class) - { - } - - public function getClassMap() - { - return array(__NAMESPACE__.'\Fixtures\NotPSR0bis' => __DIR__.'/Fixtures/notPsr0Bis.php'); - } - - public function findFile($class) - { - $fixtureDir = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR; - - if (__NAMESPACE__.'\TestingUnsilencing' === $class) { - eval('-- parse error --'); - } elseif (__NAMESPACE__.'\TestingStacking' === $class) { - eval('namespace '.__NAMESPACE__.'; class TestingStacking { function foo() {} }'); - } elseif (__NAMESPACE__.'\TestingCaseMismatch' === $class) { - eval('namespace '.__NAMESPACE__.'; class TestingCaseMisMatch {}'); - } elseif (__NAMESPACE__.'\Fixtures\CaseMismatch' === $class) { - return $fixtureDir.'CaseMismatch.php'; - } elseif (__NAMESPACE__.'\Fixtures\Psr4CaseMismatch' === $class) { - return $fixtureDir.'psr4'.DIRECTORY_SEPARATOR.'Psr4CaseMismatch.php'; - } elseif (__NAMESPACE__.'\Fixtures\NotPSR0' === $class) { - return $fixtureDir.'reallyNotPsr0.php'; - } elseif (__NAMESPACE__.'\Fixtures\NotPSR0bis' === $class) { - return $fixtureDir.'notPsr0Bis.php'; - } elseif (__NAMESPACE__.'\Fixtures\DeprecatedInterface' === $class) { - return $fixtureDir.'DeprecatedInterface.php'; - } elseif ('Symfony\Bridge\Debug\Tests\Fixtures\ExtendsDeprecatedParent' === $class) { - eval('namespace Symfony\Bridge\Debug\Tests\Fixtures; class ExtendsDeprecatedParent extends \\'.__NAMESPACE__.'\Fixtures\DeprecatedClass {}'); - } elseif ('Test\\'.__NAMESPACE__.'\DeprecatedParentClass' === $class) { - eval('namespace Test\\'.__NAMESPACE__.'; class DeprecatedParentClass extends \\'.__NAMESPACE__.'\Fixtures\DeprecatedClass {}'); - } elseif ('Test\\'.__NAMESPACE__.'\DeprecatedInterfaceClass' === $class) { - eval('namespace Test\\'.__NAMESPACE__.'; class DeprecatedInterfaceClass implements \\'.__NAMESPACE__.'\Fixtures\DeprecatedInterface {}'); - } elseif ('Test\\'.__NAMESPACE__.'\Float' === $class) { - eval('namespace Test\\'.__NAMESPACE__.'; class Float {}'); - } - } -} diff --git a/vendor/symfony/debug/Tests/ErrorHandlerTest.php b/vendor/symfony/debug/Tests/ErrorHandlerTest.php deleted file mode 100644 index c107c0c..0000000 --- a/vendor/symfony/debug/Tests/ErrorHandlerTest.php +++ /dev/null @@ -1,503 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests; - -use Psr\Log\LogLevel; -use Symfony\Component\Debug\ErrorHandler; -use Symfony\Component\Debug\Exception\ContextErrorException; - -/** - * ErrorHandlerTest. - * - * @author Robert Schönthal - * @author Nicolas Grekas - */ -class ErrorHandlerTest extends \PHPUnit_Framework_TestCase -{ - public function testRegister() - { - $handler = ErrorHandler::register(); - - try { - $this->assertInstanceOf('Symfony\Component\Debug\ErrorHandler', $handler); - $this->assertSame($handler, ErrorHandler::register()); - - $newHandler = new ErrorHandler(); - - $this->assertSame($newHandler, ErrorHandler::register($newHandler, false)); - $h = set_error_handler('var_dump'); - restore_error_handler(); - $this->assertSame(array($handler, 'handleError'), $h); - - try { - $this->assertSame($newHandler, ErrorHandler::register($newHandler, true)); - $h = set_error_handler('var_dump'); - restore_error_handler(); - $this->assertSame(array($newHandler, 'handleError'), $h); - } catch (\Exception $e) { - } - - restore_error_handler(); - restore_exception_handler(); - - if (isset($e)) { - throw $e; - } - } catch (\Exception $e) { - } - - restore_error_handler(); - restore_exception_handler(); - - if (isset($e)) { - throw $e; - } - } - - public function testNotice() - { - ErrorHandler::register(); - - try { - self::triggerNotice($this); - $this->fail('ContextErrorException expected'); - } catch (ContextErrorException $exception) { - // if an exception is thrown, the test passed - restore_error_handler(); - restore_exception_handler(); - - $this->assertEquals(E_NOTICE, $exception->getSeverity()); - $this->assertEquals(__FILE__, $exception->getFile()); - $this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage()); - $this->assertArrayHasKey('foobar', $exception->getContext()); - - $trace = $exception->getTrace(); - $this->assertEquals(__FILE__, $trace[0]['file']); - $this->assertEquals('Symfony\Component\Debug\ErrorHandler', $trace[0]['class']); - $this->assertEquals('handleError', $trace[0]['function']); - $this->assertEquals('->', $trace[0]['type']); - - $this->assertEquals(__FILE__, $trace[1]['file']); - $this->assertEquals(__CLASS__, $trace[1]['class']); - $this->assertEquals('triggerNotice', $trace[1]['function']); - $this->assertEquals('::', $trace[1]['type']); - - $this->assertEquals(__FILE__, $trace[1]['file']); - $this->assertEquals(__CLASS__, $trace[2]['class']); - $this->assertEquals(__FUNCTION__, $trace[2]['function']); - $this->assertEquals('->', $trace[2]['type']); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - // dummy function to test trace in error handler. - private static function triggerNotice($that) - { - // dummy variable to check for in error handler. - $foobar = 123; - $that->assertSame('', $foo.$foo.$bar); - } - - public function testConstruct() - { - try { - $handler = ErrorHandler::register(); - $handler->throwAt(3, true); - $this->assertEquals(3 | E_RECOVERABLE_ERROR | E_USER_ERROR, $handler->throwAt(0)); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - public function testDefaultLogger() - { - try { - $handler = ErrorHandler::register(); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - - $handler->setDefaultLogger($logger, E_NOTICE); - $handler->setDefaultLogger($logger, array(E_USER_NOTICE => LogLevel::CRITICAL)); - - $loggers = array( - E_DEPRECATED => array(null, LogLevel::INFO), - E_USER_DEPRECATED => array(null, LogLevel::INFO), - E_NOTICE => array($logger, LogLevel::WARNING), - E_USER_NOTICE => array($logger, LogLevel::CRITICAL), - E_STRICT => array(null, LogLevel::WARNING), - E_WARNING => array(null, LogLevel::WARNING), - E_USER_WARNING => array(null, LogLevel::WARNING), - E_COMPILE_WARNING => array(null, LogLevel::WARNING), - E_CORE_WARNING => array(null, LogLevel::WARNING), - E_USER_ERROR => array(null, LogLevel::CRITICAL), - E_RECOVERABLE_ERROR => array(null, LogLevel::CRITICAL), - E_COMPILE_ERROR => array(null, LogLevel::CRITICAL), - E_PARSE => array(null, LogLevel::CRITICAL), - E_ERROR => array(null, LogLevel::CRITICAL), - E_CORE_ERROR => array(null, LogLevel::CRITICAL), - ); - $this->assertSame($loggers, $handler->setLoggers(array())); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - public function testHandleError() - { - try { - $handler = ErrorHandler::register(); - $handler->throwAt(0, true); - $this->assertFalse($handler->handleError(0, 'foo', 'foo.php', 12, array())); - - restore_error_handler(); - restore_exception_handler(); - - $handler = ErrorHandler::register(); - $handler->throwAt(3, true); - $this->assertFalse($handler->handleError(4, 'foo', 'foo.php', 12, array())); - - restore_error_handler(); - restore_exception_handler(); - - $handler = ErrorHandler::register(); - $handler->throwAt(3, true); - try { - $handler->handleError(4, 'foo', 'foo.php', 12, array()); - } catch (\ErrorException $e) { - $this->assertSame('Parse Error: foo', $e->getMessage()); - $this->assertSame(4, $e->getSeverity()); - $this->assertSame('foo.php', $e->getFile()); - $this->assertSame(12, $e->getLine()); - } - - restore_error_handler(); - restore_exception_handler(); - - $handler = ErrorHandler::register(); - $handler->throwAt(E_USER_DEPRECATED, true); - $this->assertFalse($handler->handleError(E_USER_DEPRECATED, 'foo', 'foo.php', 12, array())); - - restore_error_handler(); - restore_exception_handler(); - - $handler = ErrorHandler::register(); - $handler->throwAt(E_DEPRECATED, true); - $this->assertFalse($handler->handleError(E_DEPRECATED, 'foo', 'foo.php', 12, array())); - - restore_error_handler(); - restore_exception_handler(); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - - $that = $this; - $warnArgCheck = function ($logLevel, $message, $context) use ($that) { - $that->assertEquals('info', $logLevel); - $that->assertEquals('foo', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_USER_DEPRECATED); - $that->assertArrayHasKey('stack', $context); - $that->assertInternalType('array', $context['stack']); - }; - - $logger - ->expects($this->once()) - ->method('log') - ->will($this->returnCallback($warnArgCheck)) - ; - - $handler = ErrorHandler::register(); - $handler->setDefaultLogger($logger, E_USER_DEPRECATED); - $this->assertTrue($handler->handleError(E_USER_DEPRECATED, 'foo', 'foo.php', 12, array())); - - restore_error_handler(); - restore_exception_handler(); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Undefined variable: undefVar', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_NOTICE); - }; - - $logger - ->expects($this->once()) - ->method('log') - ->will($this->returnCallback($logArgCheck)) - ; - - $handler = ErrorHandler::register(); - $handler->setDefaultLogger($logger, E_NOTICE); - $handler->screamAt(E_NOTICE); - unset($undefVar); - @$undefVar++; - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - public function testHandleDeprecation() - { - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals(LogLevel::INFO, $level); - $that->assertArrayHasKey('level', $context); - $that->assertEquals(E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED, $context['level']); - $that->assertArrayHasKey('stack', $context); - }; - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - $logger - ->expects($this->once()) - ->method('log') - ->will($this->returnCallback($logArgCheck)) - ; - - $handler = new ErrorHandler(); - $handler->setDefaultLogger($logger); - @$handler->handleError(E_USER_DEPRECATED, 'Foo deprecation', __FILE__, __LINE__, array()); - } - - public function testHandleException() - { - try { - $handler = ErrorHandler::register(); - - $exception = new \Exception('foo'); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Uncaught Exception: foo', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_ERROR); - }; - - $logger - ->expects($this->exactly(2)) - ->method('log') - ->will($this->returnCallback($logArgCheck)) - ; - - $handler->setDefaultLogger($logger, E_ERROR); - - try { - $handler->handleException($exception); - $this->fail('Exception expected'); - } catch (\Exception $e) { - $this->assertSame($exception, $e); - } - - $that = $this; - $handler->setExceptionHandler(function ($e) use ($exception, $that) { - $that->assertSame($exception, $e); - }); - - $handler->handleException($exception); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - public function testErrorStacking() - { - try { - $handler = ErrorHandler::register(); - $handler->screamAt(E_USER_WARNING); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - - $logger - ->expects($this->exactly(2)) - ->method('log') - ->withConsecutive( - array($this->equalTo(LogLevel::WARNING), $this->equalTo('Dummy log')), - array($this->equalTo(LogLevel::DEBUG), $this->equalTo('Silenced warning')) - ) - ; - - $handler->setDefaultLogger($logger, array(E_USER_WARNING => LogLevel::WARNING)); - - ErrorHandler::stackErrors(); - @trigger_error('Silenced warning', E_USER_WARNING); - $logger->log(LogLevel::WARNING, 'Dummy log'); - ErrorHandler::unstackErrors(); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - public function testHandleFatalError() - { - try { - $handler = ErrorHandler::register(); - - $error = array( - 'type' => E_PARSE, - 'message' => 'foo', - 'file' => 'bar', - 'line' => 123, - ); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Fatal Parse Error: foo', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_PARSE); - }; - - $logger - ->expects($this->once()) - ->method('log') - ->will($this->returnCallback($logArgCheck)) - ; - - $handler->setDefaultLogger($logger, E_PARSE); - - $handler->handleFatalError($error); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - public function testHandleFatalErrorOnHHVM() - { - try { - $handler = ErrorHandler::register(); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - $logger - ->expects($this->once()) - ->method('log') - ->with( - $this->equalTo(LogLevel::CRITICAL), - $this->equalTo('Fatal Error: foo'), - $this->equalTo(array( - 'type' => 1, - 'file' => 'bar', - 'line' => 123, - 'level' => -1, - 'stack' => array(456), - )) - ) - ; - - $handler->setDefaultLogger($logger, E_ERROR); - - $error = array( - 'type' => E_ERROR + 0x1000000, // This error level is used by HHVM for fatal errors - 'message' => 'foo', - 'file' => 'bar', - 'line' => 123, - 'context' => array(123), - 'backtrace' => array(456), - ); - - call_user_func_array(array($handler, 'handleError'), $error); - $handler->handleFatalError($error); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - /** - * @group legacy - */ - public function testLegacyInterface() - { - try { - $handler = ErrorHandler::register(0); - $this->assertFalse($handler->handle(0, 'foo', 'foo.php', 12, array())); - - restore_error_handler(); - restore_exception_handler(); - - $logger = $this->getMock('Psr\Log\LoggerInterface'); - - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Undefined variable: undefVar', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_NOTICE); - }; - - $logger - ->expects($this->once()) - ->method('log') - ->will($this->returnCallback($logArgCheck)) - ; - - $handler = ErrorHandler::register(E_NOTICE); - @$handler->setLogger($logger, 'scream'); - unset($undefVar); - @$undefVar++; - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } -} diff --git a/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php b/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php deleted file mode 100644 index 99eaf49..0000000 --- a/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php +++ /dev/null @@ -1,256 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests\Exception; - -use Symfony\Component\Debug\Exception\FlattenException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; -use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; -use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; -use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException; -use Symfony\Component\HttpKernel\Exception\ConflictHttpException; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Symfony\Component\HttpKernel\Exception\GoneHttpException; -use Symfony\Component\HttpKernel\Exception\LengthRequiredHttpException; -use Symfony\Component\HttpKernel\Exception\PreconditionFailedHttpException; -use Symfony\Component\HttpKernel\Exception\PreconditionRequiredHttpException; -use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; -use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException; -use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; - -class FlattenExceptionTest extends \PHPUnit_Framework_TestCase -{ - public function testStatusCode() - { - $flattened = FlattenException::create(new \RuntimeException(), 403); - $this->assertEquals('403', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new \RuntimeException()); - $this->assertEquals('500', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new NotFoundHttpException()); - $this->assertEquals('404', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new UnauthorizedHttpException('Basic realm="My Realm"')); - $this->assertEquals('401', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new BadRequestHttpException()); - $this->assertEquals('400', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new NotAcceptableHttpException()); - $this->assertEquals('406', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new ConflictHttpException()); - $this->assertEquals('409', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new MethodNotAllowedHttpException(array('POST'))); - $this->assertEquals('405', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new AccessDeniedHttpException()); - $this->assertEquals('403', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new GoneHttpException()); - $this->assertEquals('410', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new LengthRequiredHttpException()); - $this->assertEquals('411', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new PreconditionFailedHttpException()); - $this->assertEquals('412', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new PreconditionRequiredHttpException()); - $this->assertEquals('428', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new ServiceUnavailableHttpException()); - $this->assertEquals('503', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new TooManyRequestsHttpException()); - $this->assertEquals('429', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new UnsupportedMediaTypeHttpException()); - $this->assertEquals('415', $flattened->getStatusCode()); - } - - public function testHeadersForHttpException() - { - $flattened = FlattenException::create(new MethodNotAllowedHttpException(array('POST'))); - $this->assertEquals(array('Allow' => 'POST'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new UnauthorizedHttpException('Basic realm="My Realm"')); - $this->assertEquals(array('WWW-Authenticate' => 'Basic realm="My Realm"'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new ServiceUnavailableHttpException('Fri, 31 Dec 1999 23:59:59 GMT')); - $this->assertEquals(array('Retry-After' => 'Fri, 31 Dec 1999 23:59:59 GMT'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new ServiceUnavailableHttpException(120)); - $this->assertEquals(array('Retry-After' => 120), $flattened->getHeaders()); - - $flattened = FlattenException::create(new TooManyRequestsHttpException('Fri, 31 Dec 1999 23:59:59 GMT')); - $this->assertEquals(array('Retry-After' => 'Fri, 31 Dec 1999 23:59:59 GMT'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new TooManyRequestsHttpException(120)); - $this->assertEquals(array('Retry-After' => 120), $flattened->getHeaders()); - } - - /** - * @dataProvider flattenDataProvider - */ - public function testFlattenHttpException(\Exception $exception, $statusCode) - { - $flattened = FlattenException::create($exception); - $flattened2 = FlattenException::create($exception); - - $flattened->setPrevious($flattened2); - - $this->assertEquals($exception->getMessage(), $flattened->getMessage(), 'The message is copied from the original exception.'); - $this->assertEquals($exception->getCode(), $flattened->getCode(), 'The code is copied from the original exception.'); - $this->assertInstanceOf($flattened->getClass(), $exception, 'The class is set to the class of the original exception'); - } - - /** - * @dataProvider flattenDataProvider - */ - public function testPrevious(\Exception $exception, $statusCode) - { - $flattened = FlattenException::create($exception); - $flattened2 = FlattenException::create($exception); - - $flattened->setPrevious($flattened2); - - $this->assertSame($flattened2, $flattened->getPrevious()); - - $this->assertSame(array($flattened2), $flattened->getAllPrevious()); - } - - /** - * @dataProvider flattenDataProvider - */ - public function testLine(\Exception $exception) - { - $flattened = FlattenException::create($exception); - $this->assertSame($exception->getLine(), $flattened->getLine()); - } - - /** - * @dataProvider flattenDataProvider - */ - public function testFile(\Exception $exception) - { - $flattened = FlattenException::create($exception); - $this->assertSame($exception->getFile(), $flattened->getFile()); - } - - /** - * @dataProvider flattenDataProvider - */ - public function testToArray(\Exception $exception, $statusCode) - { - $flattened = FlattenException::create($exception); - $flattened->setTrace(array(), 'foo.php', 123); - - $this->assertEquals(array( - array( - 'message' => 'test', - 'class' => 'Exception', - 'trace' => array(array( - 'namespace' => '', 'short_class' => '', 'class' => '', 'type' => '', 'function' => '', 'file' => 'foo.php', 'line' => 123, - 'args' => array(), - )), - ), - ), $flattened->toArray()); - } - - public function flattenDataProvider() - { - return array( - array(new \Exception('test', 123), 500), - ); - } - - public function testRecursionInArguments() - { - $a = array('foo', array(2, &$a)); - $exception = $this->createException($a); - - $flattened = FlattenException::create($exception); - $trace = $flattened->getTrace(); - $this->assertContains('*DEEP NESTED ARRAY*', serialize($trace)); - } - - public function testTooBigArray() - { - $a = array(); - for ($i = 0; $i < 20; ++$i) { - for ($j = 0; $j < 50; ++$j) { - for ($k = 0; $k < 10; ++$k) { - $a[$i][$j][$k] = 'value'; - } - } - } - $a[20] = 'value'; - $a[21] = 'value1'; - $exception = $this->createException($a); - - $flattened = FlattenException::create($exception); - $trace = $flattened->getTrace(); - $serializeTrace = serialize($trace); - - $this->assertContains('*SKIPPED over 10000 entries*', $serializeTrace); - $this->assertNotContains('*value1*', $serializeTrace); - } - - private function createException($foo) - { - return new \Exception(); - } - - public function testSetTraceIncompleteClass() - { - $flattened = FlattenException::create(new \Exception('test', 123)); - $flattened->setTrace( - array( - array( - 'file' => __FILE__, - 'line' => 123, - 'function' => 'test', - 'args' => array( - unserialize('O:14:"BogusTestClass":0:{}'), - ), - ), - ), - 'foo.php', 123 - ); - - $this->assertEquals(array( - array( - 'message' => 'test', - 'class' => 'Exception', - 'trace' => array( - array( - 'namespace' => '', 'short_class' => '', 'class' => '', 'type' => '', 'function' => '', - 'file' => 'foo.php', 'line' => 123, - 'args' => array(), - ), - array( - 'namespace' => '', 'short_class' => '', 'class' => '', 'type' => '', 'function' => 'test', - 'file' => __FILE__, 'line' => 123, - 'args' => array( - array( - 'incomplete-object', 'BogusTestClass', - ), - ), - ), - ), - ), - ), $flattened->toArray()); - } -} diff --git a/vendor/symfony/debug/Tests/ExceptionHandlerTest.php b/vendor/symfony/debug/Tests/ExceptionHandlerTest.php deleted file mode 100644 index d4b93c0..0000000 --- a/vendor/symfony/debug/Tests/ExceptionHandlerTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests; - -use Symfony\Component\Debug\ExceptionHandler; -use Symfony\Component\Debug\Exception\OutOfMemoryException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; - -require_once __DIR__.'/HeaderMock.php'; - -class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - testHeader(); - } - - protected function tearDown() - { - testHeader(); - } - - public function testDebug() - { - $handler = new ExceptionHandler(false); - - ob_start(); - $handler->sendPhpResponse(new \RuntimeException('Foo')); - $response = ob_get_clean(); - - $this->assertContains('

Whoops, looks like something went wrong.

', $response); - $this->assertNotContains('

', $response); - - $handler = new ExceptionHandler(true); - - ob_start(); - $handler->sendPhpResponse(new \RuntimeException('Foo')); - $response = ob_get_clean(); - - $this->assertContains('

Whoops, looks like something went wrong.

', $response); - $this->assertContains('

', $response); - } - - public function testStatusCode() - { - $handler = new ExceptionHandler(false, 'iso8859-1'); - - ob_start(); - $handler->sendPhpResponse(new NotFoundHttpException('Foo')); - $response = ob_get_clean(); - - $this->assertContains('Sorry, the page you are looking for could not be found.', $response); - - $expectedHeaders = array( - array('HTTP/1.0 404', true, null), - array('Content-Type: text/html; charset=iso8859-1', true, null), - ); - - $this->assertSame($expectedHeaders, testHeader()); - } - - public function testHeaders() - { - $handler = new ExceptionHandler(false, 'iso8859-1'); - - ob_start(); - $handler->sendPhpResponse(new MethodNotAllowedHttpException(array('POST'))); - $response = ob_get_clean(); - - $expectedHeaders = array( - array('HTTP/1.0 405', true, null), - array('Allow: POST', false, null), - array('Content-Type: text/html; charset=iso8859-1', true, null), - ); - - $this->assertSame($expectedHeaders, testHeader()); - } - - public function testNestedExceptions() - { - $handler = new ExceptionHandler(true); - ob_start(); - $handler->sendPhpResponse(new \RuntimeException('Foo', 0, new \RuntimeException('Bar'))); - $response = ob_get_clean(); - - $this->assertStringMatchesFormat('%AFoo%ABar%A', $response); - } - - public function testHandle() - { - $exception = new \Exception('foo'); - - $handler = $this->getMock('Symfony\Component\Debug\ExceptionHandler', array('sendPhpResponse')); - $handler - ->expects($this->exactly(2)) - ->method('sendPhpResponse'); - - $handler->handle($exception); - - $that = $this; - $handler->setHandler(function ($e) use ($exception, $that) { - $that->assertSame($exception, $e); - }); - - $handler->handle($exception); - } - - public function testHandleOutOfMemoryException() - { - $exception = new OutOfMemoryException('foo', 0, E_ERROR, __FILE__, __LINE__); - - $handler = $this->getMock('Symfony\Component\Debug\ExceptionHandler', array('sendPhpResponse')); - $handler - ->expects($this->once()) - ->method('sendPhpResponse'); - - $that = $this; - $handler->setHandler(function ($e) use ($that) { - $that->fail('OutOfMemoryException should bypass the handler'); - }); - - $handler->handle($exception); - } -} diff --git a/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php deleted file mode 100644 index c939837..0000000 --- a/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php +++ /dev/null @@ -1,200 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests\FatalErrorHandler; - -use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader; -use Symfony\Component\ClassLoader\UniversalClassLoader as SymfonyUniversalClassLoader; -use Symfony\Component\Debug\Exception\FatalErrorException; -use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler; -use Symfony\Component\Debug\DebugClassLoader; -use Composer\Autoload\ClassLoader as ComposerClassLoader; - -class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase -{ - public static function setUpBeforeClass() - { - foreach (spl_autoload_functions() as $function) { - if (!is_array($function)) { - continue; - } - - // get class loaders wrapped by DebugClassLoader - if ($function[0] instanceof DebugClassLoader) { - $function = $function[0]->getClassLoader(); - } - - if ($function[0] instanceof ComposerClassLoader) { - $function[0]->add('Symfony_Component_Debug_Tests_Fixtures', dirname(dirname(dirname(dirname(dirname(__DIR__)))))); - break; - } - } - } - - /** - * @dataProvider provideClassNotFoundData - */ - public function testHandleClassNotFound($error, $translatedMessage, $autoloader = null) - { - if ($autoloader) { - // Unregister all autoloaders to ensure the custom provided - // autoloader is the only one to be used during the test run. - $autoloaders = spl_autoload_functions(); - array_map('spl_autoload_unregister', $autoloaders); - spl_autoload_register($autoloader); - } - - $handler = new ClassNotFoundFatalErrorHandler(); - - $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); - - if ($autoloader) { - spl_autoload_unregister($autoloader); - array_map('spl_autoload_register', $autoloaders); - } - - $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); - $this->assertSame($translatedMessage, $exception->getMessage()); - $this->assertSame($error['type'], $exception->getSeverity()); - $this->assertSame($error['file'], $exception->getFile()); - $this->assertSame($error['line'], $exception->getLine()); - } - - /** - * @group legacy - */ - public function testLegacyHandleClassNotFound() - { - $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception')); - $symfonyUniversalClassLoader = new SymfonyUniversalClassLoader(); - $symfonyUniversalClassLoader->registerPrefixes($prefixes); - - $this->testHandleClassNotFound( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', - ), - "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", - array($symfonyUniversalClassLoader, 'loadClass') - ); - } - - public function provideClassNotFoundData() - { - $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception')); - - $symfonyAutoloader = new SymfonyClassLoader(); - $symfonyAutoloader->addPrefixes($prefixes); - - $debugClassLoader = new DebugClassLoader(array($symfonyAutoloader, 'loadClass')); - - return array( - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'WhizBangFactory\' not found', - ), - "Attempted to load class \"WhizBangFactory\" from the global namespace.\nDid you forget a \"use\" statement?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\WhizBangFactory\' not found', - ), - "Attempted to load class \"WhizBangFactory\" from namespace \"Foo\\Bar\".\nDid you forget a \"use\" statement for another namespace?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'UndefinedFunctionException\' not found', - ), - "Attempted to load class \"UndefinedFunctionException\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'PEARClass\' not found', - ), - "Attempted to load class \"PEARClass\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony_Component_Debug_Tests_Fixtures_PEARClass\"?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', - ), - "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', - ), - "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", - array($symfonyAutoloader, 'loadClass'), - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', - ), - "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", - array($debugClassLoader, 'loadClass'), - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', - ), - "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\\Bar\".\nDid you forget a \"use\" statement for another namespace?", - function ($className) { /* do nothing here */ }, - ), - ); - } - - public function testCannotRedeclareClass() - { - if (!file_exists(__DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP')) { - $this->markTestSkipped('Can only be run on case insensitive filesystems'); - } - - require_once __DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP'; - - $error = array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\RequiredTwice\' not found', - ); - - $handler = new ClassNotFoundFatalErrorHandler(); - $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); - - $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); - } -} diff --git a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php b/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php deleted file mode 100644 index 795b747..0000000 --- a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests\FatalErrorHandler; - -use Symfony\Component\Debug\Exception\FatalErrorException; -use Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler; - -class UndefinedFunctionFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider provideUndefinedFunctionData - */ - public function testUndefinedFunction($error, $translatedMessage) - { - $handler = new UndefinedFunctionFatalErrorHandler(); - $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); - - $this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception); - // class names are case insensitive and PHP/HHVM do not return the same - $this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage())); - $this->assertSame($error['type'], $exception->getSeverity()); - $this->assertSame($error['file'], $exception->getFile()); - $this->assertSame($error['line'], $exception->getLine()); - } - - public function provideUndefinedFunctionData() - { - return array( - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Call to undefined function test_namespaced_function()', - ), - "Attempted to call function \"test_namespaced_function\" from the global namespace.\nDid you mean to call \"\\symfony\\component\\debug\\tests\\fatalerrorhandler\\test_namespaced_function\"?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Call to undefined function Foo\\Bar\\Baz\\test_namespaced_function()', - ), - "Attempted to call function \"test_namespaced_function\" from namespace \"Foo\\Bar\\Baz\".\nDid you mean to call \"\\symfony\\component\\debug\\tests\\fatalerrorhandler\\test_namespaced_function\"?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Call to undefined function foo()', - ), - 'Attempted to call function "foo" from the global namespace.', - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Call to undefined function Foo\\Bar\\Baz\\foo()', - ), - 'Attempted to call function "foo" from namespace "Foo\Bar\Baz".', - ), - ); - } -} - -function test_namespaced_function() -{ -} diff --git a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php b/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php deleted file mode 100644 index de7b21c..0000000 --- a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests\FatalErrorHandler; - -use Symfony\Component\Debug\Exception\FatalErrorException; -use Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler; - -class UndefinedMethodFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider provideUndefinedMethodData - */ - public function testUndefinedMethod($error, $translatedMessage) - { - $handler = new UndefinedMethodFatalErrorHandler(); - $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); - - $this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedMethodException', $exception); - $this->assertSame($translatedMessage, $exception->getMessage()); - $this->assertSame($error['type'], $exception->getSeverity()); - $this->assertSame($error['file'], $exception->getFile()); - $this->assertSame($error['line'], $exception->getLine()); - } - - public function provideUndefinedMethodData() - { - return array( - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Call to undefined method SplObjectStorage::what()', - ), - 'Attempted to call an undefined method named "what" of class "SplObjectStorage".', - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Call to undefined method SplObjectStorage::walid()', - ), - "Attempted to call an undefined method named \"walid\" of class \"SplObjectStorage\".\nDid you mean to call \"valid\"?", - ), - array( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Call to undefined method SplObjectStorage::offsetFet()', - ), - "Attempted to call an undefined method named \"offsetFet\" of class \"SplObjectStorage\".\nDid you mean to call e.g. \"offsetGet\", \"offsetSet\" or \"offsetUnset\"?", - ), - ); - } -} diff --git a/vendor/symfony/debug/Tests/Fixtures/ClassAlias.php b/vendor/symfony/debug/Tests/Fixtures/ClassAlias.php deleted file mode 100644 index 9d6dbaa..0000000 --- a/vendor/symfony/debug/Tests/Fixtures/ClassAlias.php +++ /dev/null @@ -1,3 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug; - -function headers_sent() -{ - return false; -} - -function header($str, $replace = true, $status = null) -{ - Tests\testHeader($str, $replace, $status); -} - -namespace Symfony\Component\Debug\Tests; - -function testHeader() -{ - static $headers = array(); - - if (!$h = func_get_args()) { - $h = $headers; - $headers = array(); - - return $h; - } - - $headers[] = func_get_args(); -} diff --git a/vendor/symfony/debug/Tests/MockExceptionHandler.php b/vendor/symfony/debug/Tests/MockExceptionHandler.php deleted file mode 100644 index a85d2d1..0000000 --- a/vendor/symfony/debug/Tests/MockExceptionHandler.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Tests; - -use Symfony\Component\Debug\ExceptionHandler; - -class MockExceptionHandler extends Exceptionhandler -{ - public $e; - - public function handle(\Exception $e) - { - $this->e = $e; - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php deleted file mode 100644 index 04fe7c2..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class AnalyzeServiceReferencesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - - $a = $container - ->register('a') - ->addArgument($ref1 = new Reference('b')) - ; - - $b = $container - ->register('b') - ->addMethodCall('setA', array($ref2 = new Reference('a'))) - ; - - $c = $container - ->register('c') - ->addArgument($ref3 = new Reference('a')) - ->addArgument($ref4 = new Reference('b')) - ; - - $d = $container - ->register('d') - ->setProperty('foo', $ref5 = new Reference('b')) - ; - - $e = $container - ->register('e') - ->setConfigurator(array($ref6 = new Reference('b'), 'methodName')) - ; - - $graph = $this->process($container); - - $this->assertCount(4, $edges = $graph->getNode('b')->getInEdges()); - - $this->assertSame($ref1, $edges[0]->getValue()); - $this->assertSame($ref4, $edges[1]->getValue()); - $this->assertSame($ref5, $edges[2]->getValue()); - $this->assertSame($ref6, $edges[3]->getValue()); - } - - public function testProcessDetectsReferencesFromInlinedDefinitions() - { - $container = new ContainerBuilder(); - - $container - ->register('a') - ; - - $container - ->register('b') - ->addArgument(new Definition(null, array($ref = new Reference('a')))) - ; - - $graph = $this->process($container); - - $this->assertCount(1, $refs = $graph->getNode('a')->getInEdges()); - $this->assertSame($ref, $refs[0]->getValue()); - } - - public function testProcessDetectsReferencesFromInlinedFactoryDefinitions() - { - $container = new ContainerBuilder(); - - $container - ->register('a') - ; - - $factory = new Definition(); - $factory->setFactory(array(new Reference('a'), 'a')); - - $container - ->register('b') - ->addArgument($factory) - ; - - $graph = $this->process($container); - - $this->assertTrue($graph->hasNode('a')); - $this->assertCount(1, $refs = $graph->getNode('a')->getInEdges()); - } - - public function testProcessDoesNotSaveDuplicateReferences() - { - $container = new ContainerBuilder(); - - $container - ->register('a') - ; - $container - ->register('b') - ->addArgument(new Definition(null, array($ref1 = new Reference('a')))) - ->addArgument(new Definition(null, array($ref2 = new Reference('a')))) - ; - - $graph = $this->process($container); - - $this->assertCount(2, $graph->getNode('a')->getInEdges()); - } - - public function testProcessDetectsFactoryReferences() - { - $container = new ContainerBuilder(); - - $container - ->register('foo', 'stdClass') - ->setFactory(array('stdClass', 'getInstance')); - - $container - ->register('bar', 'stdClass') - ->setFactory(array(new Reference('foo'), 'getInstance')); - - $graph = $this->process($container); - - $this->assertTrue($graph->hasNode('foo')); - $this->assertCount(1, $graph->getNode('foo')->getInEdges()); - } - - protected function process(ContainerBuilder $container) - { - $pass = new RepeatedPass(array(new AnalyzeServiceReferencesPass())); - $pass->process($container); - - return $container->getCompiler()->getServiceReferenceGraph(); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/AutoAliasServicePassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/AutoAliasServicePassTest.php deleted file mode 100644 index e3aba6d..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/AutoAliasServicePassTest.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class AutoAliasServicePassTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException - */ - public function testProcessWithMissingParameter() - { - $container = new ContainerBuilder(); - - $container->register('example') - ->addTag('auto_alias', array('format' => '%non_existing%.example')); - - $pass = new AutoAliasServicePass(); - $pass->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - */ - public function testProcessWithMissingFormat() - { - $container = new ContainerBuilder(); - - $container->register('example') - ->addTag('auto_alias', array()); - $container->setParameter('existing', 'mysql'); - - $pass = new AutoAliasServicePass(); - $pass->process($container); - } - - public function testProcessWithNonExistingAlias() - { - $container = new ContainerBuilder(); - - $container->register('example', 'Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassDefault') - ->addTag('auto_alias', array('format' => '%existing%.example')); - $container->setParameter('existing', 'mysql'); - - $pass = new AutoAliasServicePass(); - $pass->process($container); - - $this->assertEquals('Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassDefault', $container->getDefinition('example')->getClass()); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassDefault', $container->get('example')); - } - - public function testProcessWithExistingAlias() - { - $container = new ContainerBuilder(); - - $container->register('example', 'Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassDefault') - ->addTag('auto_alias', array('format' => '%existing%.example')); - - $container->register('mysql.example', 'Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassMysql'); - $container->setParameter('existing', 'mysql'); - - $pass = new AutoAliasServicePass(); - $pass->process($container); - - $this->assertTrue($container->hasAlias('example')); - $this->assertEquals('mysql.example', $container->getAlias('example')); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassMysql', $container->get('example')); - } - - public function testProcessWithManualAlias() - { - $container = new ContainerBuilder(); - - $container->register('example', 'Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassDefault') - ->addTag('auto_alias', array('format' => '%existing%.example')); - - $container->register('mysql.example', 'Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassMysql'); - $container->register('mariadb.example', 'Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassMariadb'); - $container->setAlias('example', 'mariadb.example'); - $container->setParameter('existing', 'mysql'); - - $pass = new AutoAliasServicePass(); - $pass->process($container); - - $this->assertTrue($container->hasAlias('example')); - $this->assertEquals('mariadb.example', $container->getAlias('example')); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Tests\Compiler\ServiceClassMariaDb', $container->get('example')); - } -} - -class ServiceClassDefault -{ -} - -class ServiceClassMysql extends ServiceClassDefault -{ -} - -class ServiceClassMariaDb extends ServiceClassMysql -{ -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/CheckCircularReferencesPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/CheckCircularReferencesPassTest.php deleted file mode 100644 index 55351e5..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/CheckCircularReferencesPassTest.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\Compiler; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->addArgument(new Reference('a')); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testProcessWithAliases() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->setAlias('b', 'c'); - $container->setAlias('c', 'a'); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testProcessWithFactory() - { - $container = new ContainerBuilder(); - - $container - ->register('a', 'stdClass') - ->setFactory(array(new Reference('b'), 'getInstance')); - - $container - ->register('b', 'stdClass') - ->setFactory(array(new Reference('a'), 'getInstance')); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testProcessDetectsIndirectCircularReference() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->addArgument(new Reference('c')); - $container->register('c')->addArgument(new Reference('a')); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testProcessDetectsIndirectCircularReferenceWithFactory() - { - $container = new ContainerBuilder(); - - $container->register('a')->addArgument(new Reference('b')); - - $container - ->register('b', 'stdClass') - ->setFactory(array(new Reference('c'), 'getInstance')); - - $container->register('c')->addArgument(new Reference('a')); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testDeepCircularReference() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->addArgument(new Reference('c')); - $container->register('c')->addArgument(new Reference('b')); - - $this->process($container); - } - - public function testProcessIgnoresMethodCalls() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->addMethodCall('setA', array(new Reference('a'))); - - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $compiler = new Compiler(); - $passConfig = $compiler->getPassConfig(); - $passConfig->setOptimizationPasses(array( - new AnalyzeServiceReferencesPass(true), - new CheckCircularReferencesPass(), - )); - $passConfig->setRemovingPasses(array()); - - $compiler->compile($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/CheckDefinitionValidityPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/CheckDefinitionValidityPassTest.php deleted file mode 100644 index 4e8efdc..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/CheckDefinitionValidityPassTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\CheckDefinitionValidityPass; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckDefinitionValidityPassTest extends \PHPUnit_Framework_TestCase -{ - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException - */ - public function testProcessDetectsSyntheticNonPublicDefinitions() - { - $container = new ContainerBuilder(); - $container->register('a')->setSynthetic(true)->setPublic(false); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException - */ - public function testProcessDetectsSyntheticPrototypeDefinitions() - { - $container = new ContainerBuilder(); - $container->register('a')->setSynthetic(true)->setScope(ContainerInterface::SCOPE_PROTOTYPE); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException - */ - public function testProcessDetectsNonSyntheticNonAbstractDefinitionWithoutClass() - { - $container = new ContainerBuilder(); - $container->register('a')->setSynthetic(false)->setAbstract(false); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException - * @group legacy - */ - public function testLegacyProcessDetectsBothFactorySyntaxesUsed() - { - $container = new ContainerBuilder(); - $container->register('a')->setFactory(array('a', 'b'))->setFactoryClass('a'); - - $this->process($container); - } - - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('a', 'class'); - $container->register('b', 'class')->setSynthetic(true)->setPublic(true); - $container->register('c', 'class')->setAbstract(true); - $container->register('d', 'class')->setSynthetic(true); - - $this->process($container); - } - - public function testValidTags() - { - $container = new ContainerBuilder(); - $container->register('a', 'class')->addTag('foo', array('bar' => 'baz')); - $container->register('b', 'class')->addTag('foo', array('bar' => null)); - $container->register('c', 'class')->addTag('foo', array('bar' => 1)); - $container->register('d', 'class')->addTag('foo', array('bar' => 1.1)); - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException - */ - public function testInvalidTags() - { - $container = new ContainerBuilder(); - $container->register('a', 'class')->addTag('foo', array('bar' => array('baz' => 'baz'))); - - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $pass = new CheckDefinitionValidityPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php deleted file mode 100644 index 18b605b..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckExceptionOnInvalidReferenceBehaviorPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - - $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ; - $container->register('b', '\stdClass'); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException - */ - public function testProcessThrowsExceptionOnInvalidReference() - { - $container = new ContainerBuilder(); - - $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ; - - $this->process($container); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException - */ - public function testProcessThrowsExceptionOnInvalidReferenceFromInlinedDefinition() - { - $container = new ContainerBuilder(); - - $def = new Definition(); - $def->addArgument(new Reference('b')); - - $container - ->register('a', '\stdClass') - ->addArgument($def) - ; - - $this->process($container); - } - - private function process(ContainerBuilder $container) - { - $pass = new CheckExceptionOnInvalidReferenceBehaviorPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/CheckReferenceValidityPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/CheckReferenceValidityPassTest.php deleted file mode 100644 index cd4448a..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/CheckReferenceValidityPassTest.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class CheckReferenceValidityPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcessIgnoresScopeWideningIfNonStrictReference() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false)); - $container->register('b')->setScope('prototype'); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsScopeWidening() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b')->setScope('prototype'); - - $this->process($container); - } - - public function testProcessIgnoresCrossScopeHierarchyReferenceIfNotStrict() - { - $container = new ContainerBuilder(); - $container->addScope(new Scope('a')); - $container->addScope(new Scope('b')); - - $container->register('a')->setScope('a')->addArgument(new Reference('b', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false)); - $container->register('b')->setScope('b'); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsCrossScopeHierarchyReference() - { - $container = new ContainerBuilder(); - $container->addScope(new Scope('a')); - $container->addScope(new Scope('b')); - - $container->register('a')->setScope('a')->addArgument(new Reference('b')); - $container->register('b')->setScope('b'); - - $this->process($container); - } - - /** - * @expectedException \RuntimeException - */ - public function testProcessDetectsReferenceToAbstractDefinition() - { - $container = new ContainerBuilder(); - - $container->register('a')->setAbstract(true); - $container->register('b')->addArgument(new Reference('a')); - - $this->process($container); - } - - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('a')->addArgument(new Reference('b')); - $container->register('b'); - - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $pass = new CheckReferenceValidityPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/DecoratorServicePassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/DecoratorServicePassTest.php deleted file mode 100644 index e17961a..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/DecoratorServicePassTest.php +++ /dev/null @@ -1,81 +0,0 @@ -register('foo') - ->setPublic(false) - ; - $fooExtendedDefinition = $container - ->register('foo.extended') - ->setPublic(true) - ->setDecoratedService('foo') - ; - $barDefinition = $container - ->register('bar') - ->setPublic(true) - ; - $barExtendedDefinition = $container - ->register('bar.extended') - ->setPublic(true) - ->setDecoratedService('bar', 'bar.yoo') - ; - - $this->process($container); - - $this->assertEquals('foo.extended', $container->getAlias('foo')); - $this->assertFalse($container->getAlias('foo')->isPublic()); - - $this->assertEquals('bar.extended', $container->getAlias('bar')); - $this->assertTrue($container->getAlias('bar')->isPublic()); - - $this->assertSame($fooDefinition, $container->getDefinition('foo.extended.inner')); - $this->assertFalse($container->getDefinition('foo.extended.inner')->isPublic()); - - $this->assertSame($barDefinition, $container->getDefinition('bar.yoo')); - $this->assertFalse($container->getDefinition('bar.yoo')->isPublic()); - - $this->assertNull($fooExtendedDefinition->getDecoratedService()); - $this->assertNull($barExtendedDefinition->getDecoratedService()); - } - - public function testProcessWithAlias() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(true) - ; - $container->setAlias('foo.alias', new Alias('foo', false)); - $fooExtendedDefinition = $container - ->register('foo.extended') - ->setPublic(true) - ->setDecoratedService('foo.alias') - ; - - $this->process($container); - - $this->assertEquals('foo.extended', $container->getAlias('foo.alias')); - $this->assertFalse($container->getAlias('foo.alias')->isPublic()); - - $this->assertEquals('foo', $container->getAlias('foo.extended.inner')); - $this->assertFalse($container->getAlias('foo.extended.inner')->isPublic()); - - $this->assertNull($fooExtendedDefinition->getDecoratedService()); - } - - protected function process(ContainerBuilder $container) - { - $repeatedPass = new DecoratorServicePass(); - $repeatedPass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/ExtensionCompilerPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/ExtensionCompilerPassTest.php deleted file mode 100644 index ef690da..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/ExtensionCompilerPassTest.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -class ExtensionCompilerPassTest extends \PHPUnit_Framework_TestCase -{ - private $container; - private $pass; - - public function setUp() - { - $this->container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $this->pass = new ExtensionCompilerPass(); - } - - public function testProcess() - { - $extension1 = $this->createExtensionMock(true); - $extension1->expects($this->once())->method('process'); - $extension2 = $this->createExtensionMock(false); - $extension3 = $this->createExtensionMock(false); - $extension4 = $this->createExtensionMock(true); - $extension4->expects($this->once())->method('process'); - - $this->container->expects($this->any()) - ->method('getExtensions') - ->will($this->returnValue(array($extension1, $extension2, $extension3, $extension4))) - ; - - $this->pass->process($this->container); - } - - private function createExtensionMock($hasInlineCompile) - { - return $this->getMock('Symfony\Component\DependencyInjection\\'.( - $hasInlineCompile - ? 'Compiler\CompilerPassInterface' - : 'Extension\ExtensionInterface' - )); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/InlineServiceDefinitionsPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/InlineServiceDefinitionsPassTest.php deleted file mode 100644 index 590ca4c..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/InlineServiceDefinitionsPassTest.php +++ /dev/null @@ -1,245 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; -use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class InlineServiceDefinitionsPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container - ->register('inlinable.service') - ->setPublic(false) - ; - - $container - ->register('service') - ->setArguments(array(new Reference('inlinable.service'))) - ; - - $this->process($container); - - $arguments = $container->getDefinition('service')->getArguments(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $arguments[0]); - $this->assertSame($container->getDefinition('inlinable.service'), $arguments[0]); - } - - public function testProcessDoesNotInlineWhenAliasedServiceIsNotOfPrototypeScope() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container->setAlias('moo', 'foo'); - - $container - ->register('service') - ->setArguments(array($ref = new Reference('foo'))) - ; - - $this->process($container); - - $arguments = $container->getDefinition('service')->getArguments(); - $this->assertSame($ref, $arguments[0]); - } - - public function testProcessDoesInlineServiceOfPrototypeScope() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setScope('prototype') - ; - $container - ->register('bar') - ->setPublic(false) - ->setScope('prototype') - ; - $container->setAlias('moo', 'bar'); - - $container - ->register('service') - ->setArguments(array(new Reference('foo'), $ref = new Reference('moo'), new Reference('bar'))) - ; - - $this->process($container); - - $arguments = $container->getDefinition('service')->getArguments(); - $this->assertEquals($container->getDefinition('foo'), $arguments[0]); - $this->assertNotSame($container->getDefinition('foo'), $arguments[0]); - $this->assertSame($ref, $arguments[1]); - $this->assertEquals($container->getDefinition('bar'), $arguments[2]); - $this->assertNotSame($container->getDefinition('bar'), $arguments[2]); - } - - public function testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition() - { - $container = new ContainerBuilder(); - - $a = $container->register('a')->setPublic(false); - $b = $container - ->register('b') - ->addArgument(new Reference('a')) - ->addArgument(new Definition(null, array(new Reference('a')))) - ; - - $this->process($container); - - $arguments = $b->getArguments(); - $this->assertSame($a, $arguments[0]); - - $inlinedArguments = $arguments[1]->getArguments(); - $this->assertSame($a, $inlinedArguments[0]); - } - - public function testProcessInlinesPrivateFactoryReference() - { - $container = new ContainerBuilder(); - - $container->register('a')->setPublic(false); - $b = $container - ->register('b') - ->setPublic(false) - ->setFactory(array(new Reference('a'), 'a')) - ; - - $container - ->register('foo') - ->setArguments(array( - $ref = new Reference('b'), - )); - - $this->process($container); - - $inlinedArguments = $container->getDefinition('foo')->getArguments(); - $this->assertSame($b, $inlinedArguments[0]); - } - - public function testProcessDoesNotInlinePrivateFactoryIfReferencedMultipleTimesWithinTheSameDefinition() - { - $container = new ContainerBuilder(); - $container - ->register('a') - ; - $container - ->register('b') - ->setPublic(false) - ->setFactory(array(new Reference('a'), 'a')) - ; - - $container - ->register('foo') - ->setArguments(array( - $ref1 = new Reference('b'), - $ref2 = new Reference('b'), - )) - ; - $this->process($container); - - $args = $container->getDefinition('foo')->getArguments(); - $this->assertSame($ref1, $args[0]); - $this->assertSame($ref2, $args[1]); - } - - public function testProcessDoesNotInlineReferenceWhenUsedByInlineFactory() - { - $container = new ContainerBuilder(); - $container - ->register('a') - ; - $container - ->register('b') - ->setPublic(false) - ->setFactory(array(new Reference('a'), 'a')) - ; - - $inlineFactory = new Definition(); - $inlineFactory->setPublic(false); - $inlineFactory->setFactory(array(new Reference('b'), 'b')); - - $container - ->register('foo') - ->setArguments(array( - $ref = new Reference('b'), - $inlineFactory, - )) - ; - $this->process($container); - - $args = $container->getDefinition('foo')->getArguments(); - $this->assertSame($ref, $args[0]); - } - - public function testProcessInlinesOnlyIfSameScope() - { - $container = new ContainerBuilder(); - - $container->addScope(new Scope('foo')); - $a = $container->register('a')->setPublic(false)->setScope('foo'); - $b = $container->register('b')->addArgument(new Reference('a')); - - $this->process($container); - $arguments = $b->getArguments(); - $this->assertEquals(new Reference('a'), $arguments[0]); - $this->assertTrue($container->hasDefinition('a')); - } - - public function testProcessDoesNotInlineWhenServiceIsPrivateButLazy() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ->setLazy(true) - ; - - $container - ->register('service') - ->setArguments(array($ref = new Reference('foo'))) - ; - - $this->process($container); - - $arguments = $container->getDefinition('service')->getArguments(); - $this->assertSame($ref, $arguments[0]); - } - - public function testProcessDoesNotInlineWhenServiceReferencesItself() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ->addMethodCall('foo', array($ref = new Reference('foo'))) - ; - - $this->process($container); - - $calls = $container->getDefinition('foo')->getMethodCalls(); - $this->assertSame($ref, $calls[0][1][0]); - } - - protected function process(ContainerBuilder $container) - { - $repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass())); - $repeatedPass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/IntegrationTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/IntegrationTest.php deleted file mode 100644 index c447940..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/IntegrationTest.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * This class tests the integration of the different compiler passes. - */ -class IntegrationTest extends \PHPUnit_Framework_TestCase -{ - /** - * This tests that dependencies are correctly processed. - * - * We're checking that: - * - * * A is public, B/C are private - * * A -> C - * * B -> C - */ - public function testProcessRemovesAndInlinesRecursively() - { - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - - $a = $container - ->register('a', '\stdClass') - ->addArgument(new Reference('c')) - ; - - $b = $container - ->register('b', '\stdClass') - ->addArgument(new Reference('c')) - ->setPublic(false) - ; - - $c = $container - ->register('c', '\stdClass') - ->setPublic(false) - ; - - $container->compile(); - - $this->assertTrue($container->hasDefinition('a')); - $arguments = $a->getArguments(); - $this->assertSame($c, $arguments[0]); - $this->assertFalse($container->hasDefinition('b')); - $this->assertFalse($container->hasDefinition('c')); - } - - public function testProcessInlinesReferencesToAliases() - { - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - - $a = $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ; - - $container->setAlias('b', new Alias('c', false)); - - $c = $container - ->register('c', '\stdClass') - ->setPublic(false) - ; - - $container->compile(); - - $this->assertTrue($container->hasDefinition('a')); - $arguments = $a->getArguments(); - $this->assertSame($c, $arguments[0]); - $this->assertFalse($container->hasAlias('b')); - $this->assertFalse($container->hasDefinition('c')); - } - - public function testProcessInlinesWhenThereAreMultipleReferencesButFromTheSameDefinition() - { - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - - $container - ->register('a', '\stdClass') - ->addArgument(new Reference('b')) - ->addMethodCall('setC', array(new Reference('c'))) - ; - - $container - ->register('b', '\stdClass') - ->addArgument(new Reference('c')) - ->setPublic(false) - ; - - $container - ->register('c', '\stdClass') - ->setPublic(false) - ; - - $container->compile(); - - $this->assertTrue($container->hasDefinition('a')); - $this->assertFalse($container->hasDefinition('b')); - $this->assertFalse($container->hasDefinition('c'), 'Service C was not inlined.'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/LegacyResolveParameterPlaceHoldersPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/LegacyResolveParameterPlaceHoldersPassTest.php deleted file mode 100644 index e730a1a..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/LegacyResolveParameterPlaceHoldersPassTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -/** - * @group legacy - */ -class LegacyResolveParameterPlaceHoldersPassTest extends \PHPUnit_Framework_TestCase -{ - public function testFactoryClassParametersShouldBeResolved() - { - $compilerPass = new ResolveParameterPlaceHoldersPass(); - - $container = new ContainerBuilder(); - $container->setParameter('foo.factory.class', 'FooFactory'); - $fooDefinition = $container->register('foo', '%foo.factory.class%'); - $fooDefinition->setFactoryClass('%foo.factory.class%'); - $compilerPass->process($container); - $fooDefinition = $container->getDefinition('foo'); - - $this->assertSame('FooFactory', $fooDefinition->getFactoryClass()); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/MergeExtensionConfigurationPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/MergeExtensionConfigurationPassTest.php deleted file mode 100644 index 6e112bb..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/MergeExtensionConfigurationPassTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; - -class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase -{ - public function testExpressionLanguageProviderForwarding() - { - if (true !== class_exists('Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage')) { - $this->markTestSkipped('The ExpressionLanguage component isn\'t available!'); - } - - $tmpProviders = array(); - - $extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface'); - $extension->expects($this->any()) - ->method('getXsdValidationBasePath') - ->will($this->returnValue(false)); - $extension->expects($this->any()) - ->method('getNamespace') - ->will($this->returnValue('http://example.org/schema/dic/foo')); - $extension->expects($this->any()) - ->method('getAlias') - ->will($this->returnValue('foo')); - $extension->expects($this->once()) - ->method('load') - ->will($this->returnCallback(function (array $config, ContainerBuilder $container) use (&$tmpProviders) { - $tmpProviders = $container->getExpressionLanguageProviders(); - })); - - $provider = $this->getMock('Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface'); - $container = new ContainerBuilder(new ParameterBag()); - $container->registerExtension($extension); - $container->prependExtensionConfig('foo', array('bar' => true)); - $container->addExpressionLanguageProvider($provider); - - $pass = new MergeExtensionConfigurationPass(); - $pass->process($container); - - $this->assertEquals(array($provider), $tmpProviders); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php deleted file mode 100644 index 82149eb..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; -use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; -use Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class RemoveUnusedDefinitionsPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container - ->register('bar') - ->setPublic(false) - ; - $container - ->register('moo') - ->setArguments(array(new Reference('bar'))) - ; - - $this->process($container); - - $this->assertFalse($container->hasDefinition('foo')); - $this->assertTrue($container->hasDefinition('bar')); - $this->assertTrue($container->hasDefinition('moo')); - } - - public function testProcessRemovesUnusedDefinitionsRecursively() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container - ->register('bar') - ->setArguments(array(new Reference('foo'))) - ->setPublic(false) - ; - - $this->process($container); - - $this->assertFalse($container->hasDefinition('foo')); - $this->assertFalse($container->hasDefinition('bar')); - } - - public function testProcessWorksWithInlinedDefinitions() - { - $container = new ContainerBuilder(); - $container - ->register('foo') - ->setPublic(false) - ; - $container - ->register('bar') - ->setArguments(array(new Definition(null, array(new Reference('foo'))))) - ; - - $this->process($container); - - $this->assertTrue($container->hasDefinition('foo')); - $this->assertTrue($container->hasDefinition('bar')); - } - - public function testProcessWontRemovePrivateFactory() - { - $container = new ContainerBuilder(); - - $container - ->register('foo', 'stdClass') - ->setFactory(array('stdClass', 'getInstance')) - ->setPublic(false); - - $container - ->register('bar', 'stdClass') - ->setFactory(array(new Reference('foo'), 'getInstance')) - ->setPublic(false); - - $container - ->register('foobar') - ->addArgument(new Reference('bar')); - - $this->process($container); - - $this->assertTrue($container->hasDefinition('foo')); - $this->assertTrue($container->hasDefinition('bar')); - $this->assertTrue($container->hasDefinition('foobar')); - } - - protected function process(ContainerBuilder $container) - { - $repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new RemoveUnusedDefinitionsPass())); - $repeatedPass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php deleted file mode 100644 index e4d2240..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; - -class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - - $container->register('a', '\stdClass'); - - $bDefinition = new Definition('\stdClass'); - $bDefinition->setPublic(false); - $container->setDefinition('b', $bDefinition); - - $container->setAlias('a_alias', 'a'); - $container->setAlias('b_alias', 'b'); - - $this->process($container); - - $this->assertTrue($container->has('a'), '->process() does nothing to public definitions.'); - $this->assertTrue($container->hasAlias('a_alias')); - $this->assertFalse($container->has('b'), '->process() removes non-public definitions.'); - $this->assertTrue( - $container->has('b_alias') && !$container->hasAlias('b_alias'), - '->process() replaces alias to actual.' - ); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testProcessWithInvalidAlias() - { - $container = new ContainerBuilder(); - $container->setAlias('a_alias', 'a'); - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ReplaceAliasByActualDefinitionPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php deleted file mode 100644 index 845edd2..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php +++ /dev/null @@ -1,215 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class ResolveDefinitionTemplatesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container->register('parent', 'foo')->setArguments(array('moo', 'b'))->setProperty('foo', 'moo'); - $container->setDefinition('child', new DefinitionDecorator('parent')) - ->replaceArgument(0, 'a') - ->setProperty('foo', 'bar') - ->setClass('bar') - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertNotInstanceOf('Symfony\Component\DependencyInjection\DefinitionDecorator', $def); - $this->assertEquals('bar', $def->getClass()); - $this->assertEquals(array('a', 'b'), $def->getArguments()); - $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); - } - - public function testProcessAppendsMethodCallsAlways() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->addMethodCall('foo', array('bar')) - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ->addMethodCall('bar', array('foo')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertEquals(array( - array('foo', array('bar')), - array('bar', array('foo')), - ), $def->getMethodCalls()); - } - - public function testProcessDoesNotCopyAbstract() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->setAbstract(true) - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertFalse($def->isAbstract()); - } - - public function testProcessDoesNotCopyScope() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->setScope('foo') - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertEquals(ContainerInterface::SCOPE_CONTAINER, $def->getScope()); - } - - public function testProcessDoesNotCopyTags() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->addTag('foo') - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertEquals(array(), $def->getTags()); - } - - public function testProcessDoesNotCopyDecoratedService() - { - $container = new ContainerBuilder(); - - $container - ->register('parent') - ->setDecoratedService('foo') - ; - - $container - ->setDefinition('child', new DefinitionDecorator('parent')) - ; - - $this->process($container); - - $def = $container->getDefinition('child'); - $this->assertNull($def->getDecoratedService()); - } - - public function testProcessHandlesMultipleInheritance() - { - $container = new ContainerBuilder(); - - $container - ->register('parent', 'foo') - ->setArguments(array('foo', 'bar', 'c')) - ; - - $container - ->setDefinition('child2', new DefinitionDecorator('child1')) - ->replaceArgument(1, 'b') - ; - - $container - ->setDefinition('child1', new DefinitionDecorator('parent')) - ->replaceArgument(0, 'a') - ; - - $this->process($container); - - $def = $container->getDefinition('child2'); - $this->assertEquals(array('a', 'b', 'c'), $def->getArguments()); - $this->assertEquals('foo', $def->getClass()); - } - - public function testSetLazyOnServiceHasParent() - { - $container = new ContainerBuilder(); - - $container->register('parent', 'stdClass'); - - $container->setDefinition('child1', new DefinitionDecorator('parent')) - ->setLazy(true) - ; - - $this->process($container); - - $this->assertTrue($container->getDefinition('child1')->isLazy()); - } - - public function testSetLazyOnServiceIsParent() - { - $container = new ContainerBuilder(); - - $container->register('parent', 'stdClass') - ->setLazy(true) - ; - - $container->setDefinition('child1', new DefinitionDecorator('parent')); - - $this->process($container); - - $this->assertTrue($container->getDefinition('child1')->isLazy()); - } - - public function testSetDecoratedServiceOnServiceHasParent() - { - $container = new ContainerBuilder(); - - $container->register('parent', 'stdClass'); - - $container->setDefinition('child1', new DefinitionDecorator('parent')) - ->setDecoratedService('foo', 'foo_inner') - ; - - $this->process($container); - - $this->assertEquals(array('foo', 'foo_inner'), $container->getDefinition('child1')->getDecoratedService()); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ResolveDefinitionTemplatesPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveInvalidReferencesPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/ResolveInvalidReferencesPassTest.php deleted file mode 100644 index 7205886..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveInvalidReferencesPassTest.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class ResolveInvalidReferencesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $def = $container - ->register('foo') - ->setArguments(array(new Reference('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE))) - ->addMethodCall('foo', array(new Reference('moo', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertNull($arguments[0]); - $this->assertCount(0, $def->getMethodCalls()); - } - - public function testProcessIgnoreNonExistentServices() - { - $container = new ContainerBuilder(); - $def = $container - ->register('foo') - ->setArguments(array(new Reference('bar'))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertEquals('bar', (string) $arguments[0]); - } - - public function testProcessRemovesPropertiesOnInvalid() - { - $container = new ContainerBuilder(); - $def = $container - ->register('foo') - ->setProperty('foo', new Reference('bar', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)) - ; - - $this->process($container); - - $this->assertEquals(array(), $def->getProperties()); - } - - public function testStrictFlagIsPreserved() - { - $container = new ContainerBuilder(); - $container->register('bar'); - $def = $container - ->register('foo') - ->addArgument(new Reference('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE, false)) - ; - - $this->process($container); - - $this->assertFalse($def->getArgument(0)->isStrict()); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ResolveInvalidReferencesPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveParameterPlaceHoldersPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/ResolveParameterPlaceHoldersPassTest.php deleted file mode 100644 index 1f604c2..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveParameterPlaceHoldersPassTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class ResolveParameterPlaceHoldersPassTest extends \PHPUnit_Framework_TestCase -{ - private $compilerPass; - private $container; - private $fooDefinition; - - protected function setUp() - { - $this->compilerPass = new ResolveParameterPlaceHoldersPass(); - $this->container = $this->createContainerBuilder(); - $this->compilerPass->process($this->container); - $this->fooDefinition = $this->container->getDefinition('foo'); - } - - public function testClassParametersShouldBeResolved() - { - $this->assertSame('Foo', $this->fooDefinition->getClass()); - } - - public function testFactoryParametersShouldBeResolved() - { - $this->assertSame(array('FooFactory', 'getFoo'), $this->fooDefinition->getFactory()); - } - - public function testArgumentParametersShouldBeResolved() - { - $this->assertSame(array('bar', 'baz'), $this->fooDefinition->getArguments()); - } - - public function testMethodCallParametersShouldBeResolved() - { - $this->assertSame(array(array('foobar', array('bar', 'baz'))), $this->fooDefinition->getMethodCalls()); - } - - public function testPropertyParametersShouldBeResolved() - { - $this->assertSame(array('bar' => 'baz'), $this->fooDefinition->getProperties()); - } - - public function testFileParametersShouldBeResolved() - { - $this->assertSame('foo.php', $this->fooDefinition->getFile()); - } - - public function testAliasParametersShouldBeResolved() - { - $this->assertSame('foo', $this->container->getAlias('bar')->__toString()); - } - - private function createContainerBuilder() - { - $containerBuilder = new ContainerBuilder(); - - $containerBuilder->setParameter('foo.class', 'Foo'); - $containerBuilder->setParameter('foo.factory.class', 'FooFactory'); - $containerBuilder->setParameter('foo.arg1', 'bar'); - $containerBuilder->setParameter('foo.arg2', 'baz'); - $containerBuilder->setParameter('foo.method', 'foobar'); - $containerBuilder->setParameter('foo.property.name', 'bar'); - $containerBuilder->setParameter('foo.property.value', 'baz'); - $containerBuilder->setParameter('foo.file', 'foo.php'); - $containerBuilder->setParameter('alias.id', 'bar'); - - $fooDefinition = $containerBuilder->register('foo', '%foo.class%'); - $fooDefinition->setFactory(array('%foo.factory.class%', 'getFoo')); - $fooDefinition->setArguments(array('%foo.arg1%', '%foo.arg2%')); - $fooDefinition->addMethodCall('%foo.method%', array('%foo.arg1%', '%foo.arg2%')); - $fooDefinition->setProperty('%foo.property.name%', '%foo.property.value%'); - $fooDefinition->setFile('%foo.file%'); - - $containerBuilder->setAlias('%alias.id%', 'foo'); - - return $containerBuilder; - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php b/vendor/symfony/dependency-injection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php deleted file mode 100644 index 6fdc233..0000000 --- a/vendor/symfony/dependency-injection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; - -class ResolveReferencesToAliasesPassTest extends \PHPUnit_Framework_TestCase -{ - public function testProcess() - { - $container = new ContainerBuilder(); - $container->setAlias('bar', 'foo'); - $def = $container - ->register('moo') - ->setArguments(array(new Reference('bar'))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertEquals('foo', (string) $arguments[0]); - } - - public function testProcessRecursively() - { - $container = new ContainerBuilder(); - $container->setAlias('bar', 'foo'); - $container->setAlias('moo', 'bar'); - $def = $container - ->register('foobar') - ->setArguments(array(new Reference('moo'))) - ; - - $this->process($container); - - $arguments = $def->getArguments(); - $this->assertEquals('foo', (string) $arguments[0]); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testAliasCircularReference() - { - $container = new ContainerBuilder(); - $container->setAlias('bar', 'foo'); - $container->setAlias('foo', 'bar'); - $this->process($container); - } - - protected function process(ContainerBuilder $container) - { - $pass = new ResolveReferencesToAliasesPass(); - $pass->process($container); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php b/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php deleted file mode 100644 index 8155e0b..0000000 --- a/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php +++ /dev/null @@ -1,858 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -require_once __DIR__.'/Fixtures/includes/classes.php'; -require_once __DIR__.'/Fixtures/includes/ProjectExtension.php'; - -use Symfony\Component\Config\Resource\ResourceInterface; -use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; -use Symfony\Component\DependencyInjection\Loader\ClosureLoader; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\ExpressionLanguage\Expression; - -class ContainerBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinitions - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinitions - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinition - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinition - */ - public function testDefinitions() - { - $builder = new ContainerBuilder(); - $definitions = array( - 'foo' => new Definition('Bar\FooClass'), - 'bar' => new Definition('BarClass'), - ); - $builder->setDefinitions($definitions); - $this->assertEquals($definitions, $builder->getDefinitions(), '->setDefinitions() sets the service definitions'); - $this->assertTrue($builder->hasDefinition('foo'), '->hasDefinition() returns true if a service definition exists'); - $this->assertFalse($builder->hasDefinition('foobar'), '->hasDefinition() returns false if a service definition does not exist'); - - $builder->setDefinition('foobar', $foo = new Definition('FooBarClass')); - $this->assertEquals($foo, $builder->getDefinition('foobar'), '->getDefinition() returns a service definition if defined'); - $this->assertTrue($builder->setDefinition('foobar', $foo = new Definition('FooBarClass')) === $foo, '->setDefinition() implements a fluid interface by returning the service reference'); - - $builder->addDefinitions($defs = array('foobar' => new Definition('FooBarClass'))); - $this->assertEquals(array_merge($definitions, $defs), $builder->getDefinitions(), '->addDefinitions() adds the service definitions'); - - try { - $builder->getDefinition('baz'); - $this->fail('->getDefinition() throws an InvalidArgumentException if the service definition does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The service definition "baz" does not exist.', $e->getMessage(), '->getDefinition() throws an InvalidArgumentException if the service definition does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::register - */ - public function testRegister() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'Bar\FooClass'); - $this->assertTrue($builder->hasDefinition('foo'), '->register() registers a new service definition'); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $builder->getDefinition('foo'), '->register() returns the newly created Definition instance'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::has - */ - public function testHas() - { - $builder = new ContainerBuilder(); - $this->assertFalse($builder->has('foo'), '->has() returns false if the service does not exist'); - $builder->register('foo', 'Bar\FooClass'); - $this->assertTrue($builder->has('foo'), '->has() returns true if a service definition exists'); - $builder->set('bar', new \stdClass()); - $this->assertTrue($builder->has('bar'), '->has() returns true if a service exists'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get - */ - public function testGet() - { - $builder = new ContainerBuilder(); - try { - $builder->get('foo'); - $this->fail('->get() throws an InvalidArgumentException if the service does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The service definition "foo" does not exist.', $e->getMessage(), '->get() throws an InvalidArgumentException if the service does not exist'); - } - - $this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE), '->get() returns null if the service does not exist and NULL_ON_INVALID_REFERENCE is passed as a second argument'); - - $builder->register('foo', 'stdClass'); - $this->assertInternalType('object', $builder->get('foo'), '->get() returns the service definition associated with the id'); - $builder->set('bar', $bar = new \stdClass()); - $this->assertEquals($bar, $builder->get('bar'), '->get() returns the service associated with the id'); - $builder->register('bar', 'stdClass'); - $this->assertEquals($bar, $builder->get('bar'), '->get() returns the service associated with the id even if a definition has been defined'); - - $builder->register('baz', 'stdClass')->setArguments(array(new Reference('baz'))); - try { - @$builder->get('baz'); - $this->fail('->get() throws a ServiceCircularReferenceException if the service has a circular reference to itself'); - } catch (\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException $e) { - $this->assertEquals('Circular reference detected for service "baz", path: "baz".', $e->getMessage(), '->get() throws a LogicException if the service has a circular reference to itself'); - } - - $builder->register('foobar', 'stdClass')->setScope('container'); - $this->assertTrue($builder->get('bar') === $builder->get('bar'), '->get() always returns the same instance if the service is shared'); - } - - /** - * @covers \Symfony\Component\DependencyInjection\ContainerBuilder::get - * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException - * @expectedExceptionMessage You have requested a synthetic service ("foo"). The DIC does not know how to construct this service. - */ - public function testGetUnsetLoadingServiceWhenCreateServiceThrowsAnException() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'stdClass')->setSynthetic(true); - - // we expect a RuntimeException here as foo is synthetic - try { - $builder->get('foo'); - } catch (RuntimeException $e) { - } - - // we must also have the same RuntimeException here - $builder->get('foo'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get - */ - public function testGetReturnsNullOnInactiveScope() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'stdClass')->setScope('request'); - - $this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get - */ - public function testGetReturnsNullOnInactiveScopeWhenServiceIsCreatedByAMethod() - { - $builder = new ProjectContainer(); - - $this->assertNull($builder->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds - */ - public function testGetServiceIds() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'stdClass'); - $builder->bar = $bar = new \stdClass(); - $builder->register('bar', 'stdClass'); - $this->assertEquals(array('foo', 'bar', 'service_container'), $builder->getServiceIds(), '->getServiceIds() returns all defined service ids'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAlias - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::hasAlias - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAlias - */ - public function testAliases() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'stdClass'); - $builder->setAlias('bar', 'foo'); - $this->assertTrue($builder->hasAlias('bar'), '->hasAlias() returns true if the alias exists'); - $this->assertFalse($builder->hasAlias('foobar'), '->hasAlias() returns false if the alias does not exist'); - $this->assertEquals('foo', (string) $builder->getAlias('bar'), '->getAlias() returns the aliased service'); - $this->assertTrue($builder->has('bar'), '->setAlias() defines a new service'); - $this->assertTrue($builder->get('bar') === $builder->get('foo'), '->setAlias() creates a service that is an alias to another one'); - - try { - $builder->setAlias('foobar', 'foobar'); - $this->fail('->setAlias() throws an InvalidArgumentException if the alias references itself'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('An alias can not reference itself, got a circular reference on "foobar".', $e->getMessage(), '->setAlias() throws an InvalidArgumentException if the alias references itself'); - } - - try { - $builder->getAlias('foobar'); - $this->fail('->getAlias() throws an InvalidArgumentException if the alias does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The service alias "foobar" does not exist.', $e->getMessage(), '->getAlias() throws an InvalidArgumentException if the alias does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAliases - */ - public function testGetAliases() - { - $builder = new ContainerBuilder(); - $builder->setAlias('bar', 'foo'); - $builder->setAlias('foobar', 'foo'); - $builder->setAlias('moo', new Alias('foo', false)); - - $aliases = $builder->getAliases(); - $this->assertEquals('foo', (string) $aliases['bar']); - $this->assertTrue($aliases['bar']->isPublic()); - $this->assertEquals('foo', (string) $aliases['foobar']); - $this->assertEquals('foo', (string) $aliases['moo']); - $this->assertFalse($aliases['moo']->isPublic()); - - $builder->register('bar', 'stdClass'); - $this->assertFalse($builder->hasAlias('bar')); - - $builder->set('foobar', 'stdClass'); - $builder->set('moo', 'stdClass'); - $this->assertCount(0, $builder->getAliases(), '->getAliases() does not return aliased services that have been overridden'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAliases - */ - public function testSetAliases() - { - $builder = new ContainerBuilder(); - $builder->setAliases(array('bar' => 'foo', 'foobar' => 'foo')); - - $aliases = $builder->getAliases(); - $this->assertTrue(isset($aliases['bar'])); - $this->assertTrue(isset($aliases['foobar'])); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addAliases - */ - public function testAddAliases() - { - $builder = new ContainerBuilder(); - $builder->setAliases(array('bar' => 'foo')); - $builder->addAliases(array('foobar' => 'foo')); - - $aliases = $builder->getAliases(); - $this->assertTrue(isset($aliases['bar'])); - $this->assertTrue(isset($aliases['foobar'])); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig - */ - public function testAddGetCompilerPass() - { - $builder = new ContainerBuilder(); - $builder->setResourceTracking(false); - $builderCompilerPasses = $builder->getCompiler()->getPassConfig()->getPasses(); - $builder->addCompilerPass($this->getMock('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface')); - - $this->assertCount(count($builder->getCompiler()->getPassConfig()->getPasses()) - 1, $builderCompilerPasses); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateService() - { - $builder = new ContainerBuilder(); - $builder->register('foo1', 'Bar\FooClass')->setFile(__DIR__.'/Fixtures/includes/foo.php'); - $this->assertInstanceOf('\Bar\FooClass', $builder->get('foo1'), '->createService() requires the file defined by the service definition'); - $builder->register('foo2', 'Bar\FooClass')->setFile(__DIR__.'/Fixtures/includes/%file%.php'); - $builder->setParameter('file', 'foo'); - $this->assertInstanceOf('\Bar\FooClass', $builder->get('foo2'), '->createService() replaces parameters in the file provided by the service definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateProxyWithRealServiceInstantiator() - { - $builder = new ContainerBuilder(); - - $builder->register('foo1', 'Bar\FooClass')->setFile(__DIR__.'/Fixtures/includes/foo.php'); - $builder->getDefinition('foo1')->setLazy(true); - - $foo1 = $builder->get('foo1'); - - $this->assertSame($foo1, $builder->get('foo1'), 'The same proxy is retrieved on multiple subsequent calls'); - $this->assertSame('Bar\FooClass', get_class($foo1)); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceClass() - { - $builder = new ContainerBuilder(); - $builder->register('foo1', '%class%'); - $builder->setParameter('class', 'stdClass'); - $this->assertInstanceOf('\stdClass', $builder->get('foo1'), '->createService() replaces parameters in the class provided by the service definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceArguments() - { - $builder = new ContainerBuilder(); - $builder->register('bar', 'stdClass'); - $builder->register('foo1', 'Bar\FooClass')->addArgument(array('foo' => '%value%', '%value%' => 'foo', new Reference('bar'), '%%unescape_it%%')); - $builder->setParameter('value', 'bar'); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar'), '%unescape_it%'), $builder->get('foo1')->arguments, '->createService() replaces parameters and service references in the arguments provided by the service definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceFactory() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'Bar\FooClass')->setFactory('Bar\FooClass::getInstance'); - $builder->register('qux', 'Bar\FooClass')->setFactory(array('Bar\FooClass', 'getInstance')); - $builder->register('bar', 'Bar\FooClass')->setFactory(array(new Definition('Bar\FooClass'), 'getInstance')); - $builder->register('baz', 'Bar\FooClass')->setFactory(array(new Reference('bar'), 'getInstance')); - - $this->assertTrue($builder->get('foo')->called, '->createService() calls the factory method to create the service instance'); - $this->assertTrue($builder->get('qux')->called, '->createService() calls the factory method to create the service instance'); - $this->assertTrue($builder->get('bar')->called, '->createService() uses anonymous service as factory'); - $this->assertTrue($builder->get('baz')->called, '->createService() uses another service as factory'); - } - - public function testLegacyCreateServiceFactory() - { - $builder = new ContainerBuilder(); - $builder->register('bar', 'Bar\FooClass'); - $builder - ->register('foo1', 'Bar\FooClass') - ->setFactoryClass('%foo_class%') - ->setFactoryMethod('getInstance') - ->addArgument(array('foo' => '%value%', '%value%' => 'foo', new Reference('bar'))) - ; - $builder->setParameter('value', 'bar'); - $builder->setParameter('foo_class', 'Bar\FooClass'); - $this->assertTrue($builder->get('foo1')->called, '->createService() calls the factory method to create the service instance'); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar')), $builder->get('foo1')->arguments, '->createService() passes the arguments to the factory method'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testLegacyCreateServiceFactoryService() - { - $builder = new ContainerBuilder(); - $builder->register('foo_service', 'Bar\FooClass'); - $builder - ->register('foo', 'Bar\FooClass') - ->setFactoryService('%foo_service%') - ->setFactoryMethod('getInstance') - ; - $builder->setParameter('foo_service', 'foo_service'); - $this->assertTrue($builder->get('foo')->called, '->createService() calls the factory method to create the service instance'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceMethodCalls() - { - $builder = new ContainerBuilder(); - $builder->register('bar', 'stdClass'); - $builder->register('foo1', 'Bar\FooClass')->addMethodCall('setBar', array(array('%value%', new Reference('bar')))); - $builder->setParameter('value', 'bar'); - $this->assertEquals(array('bar', $builder->get('bar')), $builder->get('foo1')->bar, '->createService() replaces the values in the method calls arguments'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceConfigurator() - { - $builder = new ContainerBuilder(); - $builder->register('foo1', 'Bar\FooClass')->setConfigurator('sc_configure'); - $this->assertTrue($builder->get('foo1')->configured, '->createService() calls the configurator'); - - $builder->register('foo2', 'Bar\FooClass')->setConfigurator(array('%class%', 'configureStatic')); - $builder->setParameter('class', 'BazClass'); - $this->assertTrue($builder->get('foo2')->configured, '->createService() calls the configurator'); - - $builder->register('baz', 'BazClass'); - $builder->register('foo3', 'Bar\FooClass')->setConfigurator(array(new Reference('baz'), 'configure')); - $this->assertTrue($builder->get('foo3')->configured, '->createService() calls the configurator'); - - $builder->register('foo4', 'Bar\FooClass')->setConfigurator(array($builder->getDefinition('baz'), 'configure')); - $this->assertTrue($builder->get('foo4')->configured, '->createService() calls the configurator'); - - $builder->register('foo5', 'Bar\FooClass')->setConfigurator('foo'); - try { - $builder->get('foo5'); - $this->fail('->createService() throws an InvalidArgumentException if the configure callable is not a valid callable'); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('The configure callable for class "Bar\FooClass" is not a callable.', $e->getMessage(), '->createService() throws an InvalidArgumentException if the configure callable is not a valid callable'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - * @expectedException \RuntimeException - */ - public function testCreateSyntheticService() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'Bar\FooClass')->setSynthetic(true); - $builder->get('foo'); - } - - public function testCreateServiceWithExpression() - { - $builder = new ContainerBuilder(); - $builder->setParameter('bar', 'bar'); - $builder->register('bar', 'BarClass'); - $builder->register('foo', 'Bar\FooClass')->addArgument(array('foo' => new Expression('service("bar").foo ~ parameter("bar")'))); - $this->assertEquals('foobar', $builder->get('foo')->arguments['foo']); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices - */ - public function testResolveServices() - { - $builder = new ContainerBuilder(); - $builder->register('foo', 'Bar\FooClass'); - $this->assertEquals($builder->get('foo'), $builder->resolveServices(new Reference('foo')), '->resolveServices() resolves service references to service instances'); - $this->assertEquals(array('foo' => array('foo', $builder->get('foo'))), $builder->resolveServices(array('foo' => array('foo', new Reference('foo')))), '->resolveServices() resolves service references to service instances in nested arrays'); - $this->assertEquals($builder->get('foo'), $builder->resolveServices(new Expression('service("foo")')), '->resolveServices() resolves expressions'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge - */ - public function testMerge() - { - $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); - $container->setResourceTracking(false); - $config = new ContainerBuilder(new ParameterBag(array('foo' => 'bar'))); - $container->merge($config); - $this->assertEquals(array('bar' => 'foo', 'foo' => 'bar'), $container->getParameterBag()->all(), '->merge() merges current parameters with the loaded ones'); - - $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); - $container->setResourceTracking(false); - $config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%'))); - $container->merge($config); - $container->compile(); - $this->assertEquals(array('bar' => 'foo', 'foo' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones'); - - $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); - $container->setResourceTracking(false); - $config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%', 'baz' => '%foo%'))); - $container->merge($config); - $container->compile(); - $this->assertEquals(array('bar' => 'foo', 'foo' => 'foo', 'baz' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones'); - - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->register('foo', 'Bar\FooClass'); - $container->register('bar', 'BarClass'); - $config = new ContainerBuilder(); - $config->setDefinition('baz', new Definition('BazClass')); - $config->setAlias('alias_for_foo', 'foo'); - $container->merge($config); - $this->assertEquals(array('foo', 'bar', 'baz'), array_keys($container->getDefinitions()), '->merge() merges definitions already defined ones'); - - $aliases = $container->getAliases(); - $this->assertTrue(isset($aliases['alias_for_foo'])); - $this->assertEquals('foo', (string) $aliases['alias_for_foo']); - - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->register('foo', 'Bar\FooClass'); - $config->setDefinition('foo', new Definition('BazClass')); - $container->merge($config); - $this->assertEquals('BazClass', $container->getDefinition('foo')->getClass(), '->merge() overrides already defined services'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge - * @expectedException \LogicException - */ - public function testMergeLogicException() - { - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->compile(); - $container->merge(new ContainerBuilder()); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds - */ - public function testfindTaggedServiceIds() - { - $builder = new ContainerBuilder(); - $builder - ->register('foo', 'Bar\FooClass') - ->addTag('foo', array('foo' => 'foo')) - ->addTag('bar', array('bar' => 'bar')) - ->addTag('foo', array('foofoo' => 'foofoo')) - ; - $this->assertEquals($builder->findTaggedServiceIds('foo'), array( - 'foo' => array( - array('foo' => 'foo'), - array('foofoo' => 'foofoo'), - ), - ), '->findTaggedServiceIds() returns an array of service ids and its tag attributes'); - $this->assertEquals(array(), $builder->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition - */ - public function testFindDefinition() - { - $container = new ContainerBuilder(); - $container->setDefinition('foo', $definition = new Definition('Bar\FooClass')); - $container->setAlias('bar', 'foo'); - $container->setAlias('foobar', 'bar'); - $this->assertEquals($definition, $container->findDefinition('foobar'), '->findDefinition() returns a Definition'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addObjectResource - */ - public function testAddObjectResource() - { - $container = new ContainerBuilder(); - - $container->setResourceTracking(false); - $container->addObjectResource(new \BarClass()); - - $this->assertEmpty($container->getResources(), 'No resources get registered without resource tracking'); - - $container->setResourceTracking(true); - $container->addObjectResource(new \BarClass()); - - $resources = $container->getResources(); - - $this->assertCount(1, $resources, '1 resource was registered'); - - /* @var $resource \Symfony\Component\Config\Resource\FileResource */ - $resource = end($resources); - - $this->assertInstanceOf('Symfony\Component\Config\Resource\FileResource', $resource); - $this->assertSame(realpath(__DIR__.'/Fixtures/includes/classes.php'), realpath($resource->getResource())); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addClassResource - */ - public function testAddClassResource() - { - $container = new ContainerBuilder(); - - $container->setResourceTracking(false); - $container->addClassResource(new \ReflectionClass('BarClass')); - - $this->assertEmpty($container->getResources(), 'No resources get registered without resource tracking'); - - $container->setResourceTracking(true); - $container->addClassResource(new \ReflectionClass('BarClass')); - - $resources = $container->getResources(); - - $this->assertCount(1, $resources, '1 resource was registered'); - - /* @var $resource \Symfony\Component\Config\Resource\FileResource */ - $resource = end($resources); - - $this->assertInstanceOf('Symfony\Component\Config\Resource\FileResource', $resource); - $this->assertSame(realpath(__DIR__.'/Fixtures/includes/classes.php'), realpath($resource->getResource())); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::compile - */ - public function testCompilesClassDefinitionsOfLazyServices() - { - $container = new ContainerBuilder(); - - $this->assertEmpty($container->getResources(), 'No resources get registered without resource tracking'); - - $container->register('foo', 'BarClass'); - $container->getDefinition('foo')->setLazy(true); - - $container->compile(); - - $classesPath = realpath(__DIR__.'/Fixtures/includes/classes.php'); - $matchingResources = array_filter( - $container->getResources(), - function (ResourceInterface $resource) use ($classesPath) { - return $resource instanceof FileResource && $classesPath === realpath($resource->getResource()); - } - ); - - $this->assertNotEmpty($matchingResources); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getResources - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addResource - */ - public function testResources() - { - $container = new ContainerBuilder(); - $container->addResource($a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml')); - $container->addResource($b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml')); - $resources = array(); - foreach ($container->getResources() as $resource) { - if (false === strpos($resource, '.php')) { - $resources[] = $resource; - } - } - $this->assertEquals(array($a, $b), $resources, '->getResources() returns an array of resources read for the current configuration'); - $this->assertSame($container, $container->setResources(array())); - $this->assertEquals(array(), $container->getResources()); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::registerExtension - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtension - */ - public function testExtension() - { - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - - $container->registerExtension($extension = new \ProjectExtension()); - $this->assertTrue($container->getExtension('project') === $extension, '->registerExtension() registers an extension'); - - $this->setExpectedException('LogicException'); - $container->getExtension('no_registered'); - } - - public function testRegisteredButNotLoadedExtension() - { - $extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface'); - $extension->expects($this->once())->method('getAlias')->will($this->returnValue('project')); - $extension->expects($this->never())->method('load'); - - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->registerExtension($extension); - $container->compile(); - } - - public function testRegisteredAndLoadedExtension() - { - $extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface'); - $extension->expects($this->exactly(2))->method('getAlias')->will($this->returnValue('project')); - $extension->expects($this->once())->method('load')->with(array(array('foo' => 'bar'))); - - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->registerExtension($extension); - $container->loadFromExtension('project', array('foo' => 'bar')); - $container->compile(); - } - - public function testPrivateServiceUser() - { - $fooDefinition = new Definition('BarClass'); - $fooUserDefinition = new Definition('BarUserClass', array(new Reference('bar'))); - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - - $fooDefinition->setPublic(false); - - $container->addDefinitions(array( - 'bar' => $fooDefinition, - 'bar_user' => $fooUserDefinition, - )); - - $container->compile(); - $this->assertInstanceOf('BarClass', $container->get('bar_user')->bar); - } - - /** - * @expectedException \BadMethodCallException - */ - public function testThrowsExceptionWhenSetServiceOnAFrozenContainer() - { - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->setDefinition('a', new Definition('stdClass')); - $container->compile(); - $container->set('a', new \stdClass()); - } - - /** - * @expectedException \BadMethodCallException - */ - public function testThrowsExceptionWhenAddServiceOnAFrozenContainer() - { - $container = new ContainerBuilder(); - $container->compile(); - $container->set('a', new \stdClass()); - } - - public function testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer() - { - $container = new ContainerBuilder(); - $def = new Definition('stdClass'); - $def->setSynthetic(true); - $container->setDefinition('a', $def); - $container->compile(); - $container->set('a', $a = new \stdClass()); - $this->assertEquals($a, $container->get('a')); - } - - /** - * @group legacy - */ - public function testLegacySetOnSynchronizedService() - { - $container = new ContainerBuilder(); - $container->register('baz', 'BazClass') - ->setSynchronized(true) - ; - $container->register('bar', 'BarClass') - ->addMethodCall('setBaz', array(new Reference('baz'))) - ; - - $container->set('baz', $baz = new \BazClass()); - $this->assertSame($baz, $container->get('bar')->getBaz()); - - $container->set('baz', $baz = new \BazClass()); - $this->assertSame($baz, $container->get('bar')->getBaz()); - } - - /** - * @group legacy - */ - public function testLegacySynchronizedServiceWithScopes() - { - $container = new ContainerBuilder(); - $container->addScope(new Scope('foo')); - $container->register('baz', 'BazClass') - ->setSynthetic(true) - ->setSynchronized(true) - ->setScope('foo') - ; - $container->register('bar', 'BarClass') - ->addMethodCall('setBaz', array(new Reference('baz', ContainerInterface::NULL_ON_INVALID_REFERENCE, false))) - ; - $container->compile(); - - $container->enterScope('foo'); - $container->set('baz', $outerBaz = new \BazClass(), 'foo'); - $this->assertSame($outerBaz, $container->get('bar')->getBaz()); - - $container->enterScope('foo'); - $container->set('baz', $innerBaz = new \BazClass(), 'foo'); - $this->assertSame($innerBaz, $container->get('bar')->getBaz()); - $container->leaveScope('foo'); - - $this->assertNotSame($innerBaz, $container->get('bar')->getBaz()); - $this->assertSame($outerBaz, $container->get('bar')->getBaz()); - - $container->leaveScope('foo'); - } - - /** - * @expectedException \BadMethodCallException - */ - public function testThrowsExceptionWhenSetDefinitionOnAFrozenContainer() - { - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->compile(); - $container->setDefinition('a', new Definition()); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtensionConfig - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig - */ - public function testExtensionConfig() - { - $container = new ContainerBuilder(); - - $configs = $container->getExtensionConfig('foo'); - $this->assertEmpty($configs); - - $first = array('foo' => 'bar'); - $container->prependExtensionConfig('foo', $first); - $configs = $container->getExtensionConfig('foo'); - $this->assertEquals(array($first), $configs); - - $second = array('ding' => 'dong'); - $container->prependExtensionConfig('foo', $second); - $configs = $container->getExtensionConfig('foo'); - $this->assertEquals(array($second, $first), $configs); - } - - public function testLazyLoadedService() - { - $loader = new ClosureLoader($container = new ContainerBuilder()); - $loader->load(function (ContainerBuilder $container) { - $container->set('a', new \BazClass()); - $definition = new Definition('BazClass'); - $definition->setLazy(true); - $container->setDefinition('a', $definition); - } - ); - - $container->setResourceTracking(true); - - $container->compile(); - - $class = new \BazClass(); - $reflectionClass = new \ReflectionClass($class); - - $r = new \ReflectionProperty($container, 'resources'); - $r->setAccessible(true); - $resources = $r->getValue($container); - - $classInList = false; - foreach ($resources as $resource) { - if ($resource->getResource() === $reflectionClass->getFileName()) { - $classInList = true; - break; - } - } - - $this->assertTrue($classInList); - } -} - -class FooClass -{ -} - -class ProjectContainer extends ContainerBuilder -{ - public function getFoobazService() - { - throw new InactiveScopeException('foo', 'request'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/ContainerTest.php b/vendor/symfony/dependency-injection/Tests/ContainerTest.php deleted file mode 100644 index 472bd1f..0000000 --- a/vendor/symfony/dependency-injection/Tests/ContainerTest.php +++ /dev/null @@ -1,713 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Scope; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; - -class ContainerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Container::__construct - */ - public function testConstructor() - { - $sc = new Container(); - $this->assertSame($sc, $sc->get('service_container'), '__construct() automatically registers itself as a service'); - - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $this->assertEquals(array('foo' => 'bar'), $sc->getParameterBag()->all(), '__construct() takes an array of parameters as its first argument'); - } - - /** - * @dataProvider dataForTestCamelize - */ - public function testCamelize($id, $expected) - { - $this->assertEquals($expected, Container::camelize($id), sprintf('Container::camelize("%s")', $id)); - } - - public function dataForTestCamelize() - { - return array( - array('foo_bar', 'FooBar'), - array('foo.bar', 'Foo_Bar'), - array('foo.bar_baz', 'Foo_BarBaz'), - array('foo._bar', 'Foo_Bar'), - array('foo_.bar', 'Foo_Bar'), - array('_foo', 'Foo'), - array('.foo', '_Foo'), - array('foo_', 'Foo'), - array('foo.', 'Foo_'), - array('foo\bar', 'Foo_Bar'), - ); - } - - /** - * @dataProvider dataForTestUnderscore - */ - public function testUnderscore($id, $expected) - { - $this->assertEquals($expected, Container::underscore($id), sprintf('Container::underscore("%s")', $id)); - } - - public function dataForTestUnderscore() - { - return array( - array('FooBar', 'foo_bar'), - array('Foo_Bar', 'foo.bar'), - array('Foo_BarBaz', 'foo.bar_baz'), - array('FooBar_BazQux', 'foo_bar.baz_qux'), - array('_Foo', '.foo'), - array('Foo_', 'foo.'), - ); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::compile - */ - public function testCompile() - { - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $this->assertFalse($sc->getParameterBag()->isResolved(), '->compile() resolves the parameter bag'); - $sc->compile(); - $this->assertTrue($sc->getParameterBag()->isResolved(), '->compile() resolves the parameter bag'); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag', $sc->getParameterBag(), '->compile() changes the parameter bag to a FrozenParameterBag instance'); - $this->assertEquals(array('foo' => 'bar'), $sc->getParameterBag()->all(), '->compile() copies the current parameters to the new parameter bag'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::isFrozen - */ - public function testIsFrozen() - { - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $this->assertFalse($sc->isFrozen(), '->isFrozen() returns false if the parameters are not frozen'); - $sc->compile(); - $this->assertTrue($sc->isFrozen(), '->isFrozen() returns true if the parameters are frozen'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::getParameterBag - */ - public function testGetParameterBag() - { - $sc = new Container(); - $this->assertEquals(array(), $sc->getParameterBag()->all(), '->getParameterBag() returns an empty array if no parameter has been defined'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::setParameter - * @covers Symfony\Component\DependencyInjection\Container::getParameter - */ - public function testGetSetParameter() - { - $sc = new Container(new ParameterBag(array('foo' => 'bar'))); - $sc->setParameter('bar', 'foo'); - $this->assertEquals('foo', $sc->getParameter('bar'), '->setParameter() sets the value of a new parameter'); - - $sc->setParameter('foo', 'baz'); - $this->assertEquals('baz', $sc->getParameter('foo'), '->setParameter() overrides previously set parameter'); - - $sc->setParameter('Foo', 'baz1'); - $this->assertEquals('baz1', $sc->getParameter('foo'), '->setParameter() converts the key to lowercase'); - $this->assertEquals('baz1', $sc->getParameter('FOO'), '->getParameter() converts the key to lowercase'); - - try { - $sc->getParameter('baba'); - $this->fail('->getParameter() thrown an \InvalidArgumentException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); - $this->assertEquals('You have requested a non-existent parameter "baba".', $e->getMessage(), '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::getServiceIds - */ - public function testGetServiceIds() - { - $sc = new Container(); - $sc->set('foo', $obj = new \stdClass()); - $sc->set('bar', $obj = new \stdClass()); - $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids'); - - $sc = new ProjectServiceContainer(); - $sc->set('foo', $obj = new \stdClass()); - $this->assertEquals(array('scoped', 'scoped_foo', 'scoped_synchronized_foo', 'inactive', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'service_container', 'foo'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods, followed by service ids defined by set()'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::set - */ - public function testSet() - { - $sc = new Container(); - $sc->set('foo', $foo = new \stdClass()); - $this->assertEquals($foo, $sc->get('foo'), '->set() sets a service'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::set - */ - public function testSetWithNullResetTheService() - { - $sc = new Container(); - $sc->set('foo', null); - $this->assertFalse($sc->has('foo'), '->set() with null service resets the service'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSetDoesNotAllowPrototypeScope() - { - $c = new Container(); - $c->set('foo', new \stdClass(), Container::SCOPE_PROTOTYPE); - } - - /** - * @expectedException \RuntimeException - */ - public function testSetDoesNotAllowInactiveScope() - { - $c = new Container(); - $c->addScope(new Scope('foo')); - $c->set('foo', new \stdClass(), 'foo'); - } - - public function testSetAlsoSetsScopedService() - { - $c = new Container(); - $c->addScope(new Scope('foo')); - $c->enterScope('foo'); - $c->set('foo', $foo = new \stdClass(), 'foo'); - - $scoped = $this->getField($c, 'scopedServices'); - $this->assertTrue(isset($scoped['foo']['foo']), '->set() sets a scoped service'); - $this->assertSame($foo, $scoped['foo']['foo'], '->set() sets a scoped service'); - } - - public function testSetAlsoCallsSynchronizeService() - { - $c = new ProjectServiceContainer(); - $c->addScope(new Scope('foo')); - $c->enterScope('foo'); - $c->set('scoped_synchronized_foo', $bar = new \stdClass(), 'foo'); - $this->assertTrue($c->synchronized, '->set() calls synchronize*Service() if it is defined for the service'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::get - */ - public function testGet() - { - $sc = new ProjectServiceContainer(); - $sc->set('foo', $foo = new \stdClass()); - $this->assertEquals($foo, $sc->get('foo'), '->get() returns the service for the given id'); - $this->assertEquals($foo, $sc->get('Foo'), '->get() returns the service for the given id, and converts id to lowercase'); - $this->assertEquals($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id'); - $this->assertEquals($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined'); - $this->assertEquals($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined'); - $this->assertEquals($sc->__foo_baz, $sc->get('foo\\baz'), '->get() returns the service if a get*Method() is defined'); - - $sc->set('bar', $bar = new \stdClass()); - $this->assertEquals($bar, $sc->get('bar'), '->get() prefers to return a service defined with set() than one defined with a getXXXMethod()'); - - try { - $sc->get(''); - $this->fail('->get() throws a \InvalidArgumentException exception if the service is empty'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException', $e, '->get() throws a ServiceNotFoundException exception if the service is empty'); - } - $this->assertNull($sc->get('', ContainerInterface::NULL_ON_INVALID_REFERENCE), '->get() returns null if the service is empty'); - } - - public function testGetThrowServiceNotFoundException() - { - $sc = new ProjectServiceContainer(); - $sc->set('foo', $foo = new \stdClass()); - $sc->set('bar', $foo = new \stdClass()); - $sc->set('baz', $foo = new \stdClass()); - - try { - $sc->get('foo1'); - $this->fail('->get() throws an Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException', $e, '->get() throws an Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException if the key does not exist'); - $this->assertEquals('You have requested a non-existent service "foo1". Did you mean this: "foo"?', $e->getMessage(), '->get() throws an Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException with some advices'); - } - - try { - $sc->get('bag'); - $this->fail('->get() throws an Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException', $e, '->get() throws an Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException if the key does not exist'); - $this->assertEquals('You have requested a non-existent service "bag". Did you mean one of these: "bar", "baz"?', $e->getMessage(), '->get() throws an Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException with some advices'); - } - } - - public function testGetCircularReference() - { - $sc = new ProjectServiceContainer(); - try { - $sc->get('circular'); - $this->fail('->get() throws a ServiceCircularReferenceException if it contains circular reference'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException', $e, '->get() throws a ServiceCircularReferenceException if it contains circular reference'); - $this->assertStringStartsWith('Circular reference detected for service "circular"', $e->getMessage(), '->get() throws a \LogicException if it contains circular reference'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::get - */ - public function testGetReturnsNullOnInactiveScope() - { - $sc = new ProjectServiceContainer(); - $this->assertNull($sc->get('inactive', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::has - */ - public function testHas() - { - $sc = new ProjectServiceContainer(); - $sc->set('foo', new \stdClass()); - $this->assertFalse($sc->has('foo1'), '->has() returns false if the service does not exist'); - $this->assertTrue($sc->has('foo'), '->has() returns true if the service exists'); - $this->assertTrue($sc->has('bar'), '->has() returns true if a get*Method() is defined'); - $this->assertTrue($sc->has('foo_bar'), '->has() returns true if a get*Method() is defined'); - $this->assertTrue($sc->has('foo.baz'), '->has() returns true if a get*Method() is defined'); - $this->assertTrue($sc->has('foo\\baz'), '->has() returns true if a get*Method() is defined'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Container::initialized - */ - public function testInitialized() - { - $sc = new ProjectServiceContainer(); - $sc->set('foo', new \stdClass()); - $this->assertTrue($sc->initialized('foo'), '->initialized() returns true if service is loaded'); - $this->assertFalse($sc->initialized('foo1'), '->initialized() returns false if service is not loaded'); - $this->assertFalse($sc->initialized('bar'), '->initialized() returns false if a service is defined, but not currently loaded'); - $this->assertFalse($sc->initialized('alias'), '->initialized() returns false if an aliased service is not initialized'); - - $sc->set('bar', new \stdClass()); - $this->assertTrue($sc->initialized('alias'), '->initialized() returns true for alias if aliased service is initialized'); - } - - public function testEnterLeaveCurrentScope() - { - $container = new ProjectServiceContainer(); - $container->addScope(new Scope('foo')); - - $container->enterScope('foo'); - $scoped1 = $container->get('scoped'); - $scopedFoo1 = $container->get('scoped_foo'); - - $container->enterScope('foo'); - $scoped2 = $container->get('scoped'); - $scoped3 = $container->get('SCOPED'); - $scopedFoo2 = $container->get('scoped_foo'); - - $container->leaveScope('foo'); - $scoped4 = $container->get('scoped'); - $scopedFoo3 = $container->get('scoped_foo'); - - $this->assertNotSame($scoped1, $scoped2); - $this->assertSame($scoped2, $scoped3); - $this->assertSame($scoped1, $scoped4); - $this->assertNotSame($scopedFoo1, $scopedFoo2); - $this->assertSame($scopedFoo1, $scopedFoo3); - } - - public function testEnterLeaveScopeWithChildScopes() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - $container->addScope(new Scope('bar', 'foo')); - - $this->assertFalse($container->isScopeActive('foo')); - - $container->enterScope('foo'); - $container->enterScope('bar'); - - $this->assertTrue($container->isScopeActive('foo')); - $this->assertFalse($container->has('a')); - - $a = new \stdClass(); - $container->set('a', $a, 'bar'); - - $scoped = $this->getField($container, 'scopedServices'); - $this->assertTrue(isset($scoped['bar']['a'])); - $this->assertSame($a, $scoped['bar']['a']); - $this->assertTrue($container->has('a')); - - $container->leaveScope('foo'); - - $scoped = $this->getField($container, 'scopedServices'); - $this->assertFalse(isset($scoped['bar'])); - $this->assertFalse($container->isScopeActive('foo')); - $this->assertFalse($container->has('a')); - } - - public function testEnterScopeRecursivelyWithInactiveChildScopes() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - $container->addScope(new Scope('bar', 'foo')); - - $this->assertFalse($container->isScopeActive('foo')); - - $container->enterScope('foo'); - - $this->assertTrue($container->isScopeActive('foo')); - $this->assertFalse($container->isScopeActive('bar')); - $this->assertFalse($container->has('a')); - - $a = new \stdClass(); - $container->set('a', $a, 'foo'); - - $scoped = $this->getField($container, 'scopedServices'); - $this->assertTrue(isset($scoped['foo']['a'])); - $this->assertSame($a, $scoped['foo']['a']); - $this->assertTrue($container->has('a')); - - $container->enterScope('foo'); - - $scoped = $this->getField($container, 'scopedServices'); - $this->assertFalse(isset($scoped['a'])); - $this->assertTrue($container->isScopeActive('foo')); - $this->assertFalse($container->isScopeActive('bar')); - $this->assertFalse($container->has('a')); - - $container->enterScope('bar'); - - $this->assertTrue($container->isScopeActive('bar')); - - $container->leaveScope('foo'); - - $this->assertTrue($container->isScopeActive('foo')); - $this->assertFalse($container->isScopeActive('bar')); - $this->assertTrue($container->has('a')); - } - - public function testEnterChildScopeRecursively() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - $container->addScope(new Scope('bar', 'foo')); - - $container->enterScope('foo'); - $container->enterScope('bar'); - - $this->assertTrue($container->isScopeActive('bar')); - $this->assertFalse($container->has('a')); - - $a = new \stdClass(); - $container->set('a', $a, 'bar'); - - $scoped = $this->getField($container, 'scopedServices'); - $this->assertTrue(isset($scoped['bar']['a'])); - $this->assertSame($a, $scoped['bar']['a']); - $this->assertTrue($container->has('a')); - - $container->enterScope('bar'); - - $scoped = $this->getField($container, 'scopedServices'); - $this->assertFalse(isset($scoped['a'])); - $this->assertTrue($container->isScopeActive('foo')); - $this->assertTrue($container->isScopeActive('bar')); - $this->assertFalse($container->has('a')); - - $container->leaveScope('bar'); - - $this->assertTrue($container->isScopeActive('foo')); - $this->assertTrue($container->isScopeActive('bar')); - $this->assertTrue($container->has('a')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnterScopeNotAdded() - { - $container = new Container(); - $container->enterScope('foo'); - } - - /** - * @expectedException \RuntimeException - */ - public function testEnterScopeDoesNotAllowInactiveParentScope() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - $container->addScope(new Scope('bar', 'foo')); - $container->enterScope('bar'); - } - - public function testLeaveScopeNotActive() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - - try { - $container->leaveScope('foo'); - $this->fail('->leaveScope() throws a \LogicException if the scope is not active yet'); - } catch (\Exception $e) { - $this->assertInstanceOf('\LogicException', $e, '->leaveScope() throws a \LogicException if the scope is not active yet'); - $this->assertEquals('The scope "foo" is not active.', $e->getMessage(), '->leaveScope() throws a \LogicException if the scope is not active yet'); - } - - try { - $container->leaveScope('bar'); - $this->fail('->leaveScope() throws a \LogicException if the scope does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\LogicException', $e, '->leaveScope() throws a \LogicException if the scope does not exist'); - $this->assertEquals('The scope "bar" is not active.', $e->getMessage(), '->leaveScope() throws a \LogicException if the scope does not exist'); - } - } - - /** - * @expectedException \InvalidArgumentException - * @dataProvider getBuiltInScopes - */ - public function testAddScopeDoesNotAllowBuiltInScopes($scope) - { - $container = new Container(); - $container->addScope(new Scope($scope)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testAddScopeDoesNotAllowExistingScope() - { - $container = new Container(); - $container->addScope(new Scope('foo')); - $container->addScope(new Scope('foo')); - } - - /** - * @expectedException \InvalidArgumentException - * @dataProvider getInvalidParentScopes - */ - public function testAddScopeDoesNotAllowInvalidParentScope($scope) - { - $c = new Container(); - $c->addScope(new Scope('foo', $scope)); - } - - public function testAddScope() - { - $c = new Container(); - $c->addScope(new Scope('foo')); - $c->addScope(new Scope('bar', 'foo')); - - $this->assertSame(array('foo' => 'container', 'bar' => 'foo'), $this->getField($c, 'scopes')); - $this->assertSame(array('foo' => array('bar'), 'bar' => array()), $this->getField($c, 'scopeChildren')); - - $c->addScope(new Scope('baz', 'bar')); - - $this->assertSame(array('foo' => 'container', 'bar' => 'foo', 'baz' => 'bar'), $this->getField($c, 'scopes')); - $this->assertSame(array('foo' => array('bar', 'baz'), 'bar' => array('baz'), 'baz' => array()), $this->getField($c, 'scopeChildren')); - } - - public function testHasScope() - { - $c = new Container(); - - $this->assertFalse($c->hasScope('foo')); - $c->addScope(new Scope('foo')); - $this->assertTrue($c->hasScope('foo')); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Something went terribly wrong! - */ - public function testGetThrowsException() - { - $c = new ProjectServiceContainer(); - - try { - $c->get('throw_exception'); - } catch (\Exception $e) { - // Do nothing. - } - - // Retry, to make sure that get*Service() will be called. - $c->get('throw_exception'); - } - - public function testGetThrowsExceptionOnServiceConfiguration() - { - $c = new ProjectServiceContainer(); - - try { - $c->get('throws_exception_on_service_configuration'); - } catch (\Exception $e) { - // Do nothing. - } - - $this->assertFalse($c->initialized('throws_exception_on_service_configuration')); - - // Retry, to make sure that get*Service() will be called. - try { - $c->get('throws_exception_on_service_configuration'); - } catch (\Exception $e) { - // Do nothing. - } - $this->assertFalse($c->initialized('throws_exception_on_service_configuration')); - } - - public function testIsScopeActive() - { - $c = new Container(); - - $this->assertFalse($c->isScopeActive('foo')); - $c->addScope(new Scope('foo')); - - $this->assertFalse($c->isScopeActive('foo')); - $c->enterScope('foo'); - - $this->assertTrue($c->isScopeActive('foo')); - $c->leaveScope('foo'); - - $this->assertFalse($c->isScopeActive('foo')); - } - - public function getInvalidParentScopes() - { - return array( - array(ContainerInterface::SCOPE_PROTOTYPE), - array('bar'), - ); - } - - public function getBuiltInScopes() - { - return array( - array(ContainerInterface::SCOPE_CONTAINER), - array(ContainerInterface::SCOPE_PROTOTYPE), - ); - } - - protected function getField($obj, $field) - { - $reflection = new \ReflectionProperty($obj, $field); - $reflection->setAccessible(true); - - return $reflection->getValue($obj); - } - - public function testAlias() - { - $c = new ProjectServiceContainer(); - - $this->assertTrue($c->has('alias')); - $this->assertSame($c->get('alias'), $c->get('bar')); - } -} - -class ProjectServiceContainer extends Container -{ - public $__bar, $__foo_bar, $__foo_baz; - public $synchronized; - - public function __construct() - { - parent::__construct(); - - $this->__bar = new \stdClass(); - $this->__foo_bar = new \stdClass(); - $this->__foo_baz = new \stdClass(); - $this->synchronized = false; - $this->aliases = array('alias' => 'bar'); - } - - protected function getScopedService() - { - if (!$this->isScopeActive('foo')) { - throw new \RuntimeException('Invalid call'); - } - - return $this->services['scoped'] = $this->scopedServices['foo']['scoped'] = new \stdClass(); - } - - protected function getScopedFooService() - { - if (!$this->isScopeActive('foo')) { - throw new \RuntimeException('invalid call'); - } - - return $this->services['scoped_foo'] = $this->scopedServices['foo']['scoped_foo'] = new \stdClass(); - } - - protected function getScopedSynchronizedFooService() - { - if (!$this->isScopeActive('foo')) { - throw new \RuntimeException('invalid call'); - } - - return $this->services['scoped_bar'] = $this->scopedServices['foo']['scoped_bar'] = new \stdClass(); - } - - protected function synchronizeScopedSynchronizedFooService() - { - $this->synchronized = true; - } - - protected function getInactiveService() - { - throw new InactiveScopeException('request', 'request'); - } - - protected function getBarService() - { - return $this->__bar; - } - - protected function getFooBarService() - { - return $this->__foo_bar; - } - - protected function getFoo_BazService() - { - return $this->__foo_baz; - } - - protected function getCircularService() - { - return $this->get('circular'); - } - - protected function getThrowExceptionService() - { - throw new \Exception('Something went terribly wrong!'); - } - - protected function getThrowsExceptionOnServiceConfigurationService() - { - $this->services['throws_exception_on_service_configuration'] = $instance = new \stdClass(); - - throw new \Exception('Something was terribly wrong while trying to configure the service!'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/CrossCheckTest.php b/vendor/symfony/dependency-injection/Tests/CrossCheckTest.php deleted file mode 100644 index 692d73d..0000000 --- a/vendor/symfony/dependency-injection/Tests/CrossCheckTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; - -class CrossCheckTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = __DIR__.'/Fixtures/'; - - require_once self::$fixturesPath.'/includes/classes.php'; - require_once self::$fixturesPath.'/includes/foo.php'; - } - - /** - * @dataProvider crossCheckLoadersDumpers - */ - public function testCrossCheck($fixture, $type) - { - $loaderClass = 'Symfony\\Component\\DependencyInjection\\Loader\\'.ucfirst($type).'FileLoader'; - $dumperClass = 'Symfony\\Component\\DependencyInjection\\Dumper\\'.ucfirst($type).'Dumper'; - - $tmp = tempnam('sf_service_container', 'sf'); - - file_put_contents($tmp, file_get_contents(self::$fixturesPath.'/'.$type.'/'.$fixture)); - - $container1 = new ContainerBuilder(); - $loader1 = new $loaderClass($container1, new FileLocator()); - $loader1->load($tmp); - - $dumper = new $dumperClass($container1); - file_put_contents($tmp, $dumper->dump()); - - $container2 = new ContainerBuilder(); - $loader2 = new $loaderClass($container2, new FileLocator()); - $loader2->load($tmp); - - unlink($tmp); - - $this->assertEquals($container2->getAliases(), $container1->getAliases(), 'loading a dump from a previously loaded container returns the same container'); - $this->assertEquals($container2->getDefinitions(), $container1->getDefinitions(), 'loading a dump from a previously loaded container returns the same container'); - $this->assertEquals($container2->getParameterBag()->all(), $container1->getParameterBag()->all(), '->getParameterBag() returns the same value for both containers'); - - $this->assertEquals(serialize($container2), serialize($container1), 'loading a dump from a previously loaded container returns the same container'); - - $services1 = array(); - foreach ($container1 as $id => $service) { - $services1[$id] = serialize($service); - } - $services2 = array(); - foreach ($container2 as $id => $service) { - $services2[$id] = serialize($service); - } - - unset($services1['service_container'], $services2['service_container']); - - $this->assertEquals($services2, $services1, 'Iterator on the containers returns the same services'); - } - - public function crossCheckLoadersDumpers() - { - $tests = array( - array('services1.xml', 'xml'), - array('services2.xml', 'xml'), - array('services6.xml', 'xml'), - array('services8.xml', 'xml'), - array('services9.xml', 'xml'), - ); - - if (class_exists('Symfony\Component\Yaml\Yaml')) { - $tests = array_merge($tests, array( - array('services1.yml', 'yaml'), - array('services2.yml', 'yaml'), - array('services6.yml', 'yaml'), - array('services8.yml', 'yaml'), - array('services9.yml', 'yaml'), - )); - } - - return $tests; - } -} diff --git a/vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php b/vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php deleted file mode 100644 index 732eead..0000000 --- a/vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\DefinitionDecorator; - -class DefinitionDecoratorTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $def = new DefinitionDecorator('foo'); - - $this->assertEquals('foo', $def->getParent()); - $this->assertEquals(array(), $def->getChanges()); - } - - /** - * @dataProvider getPropertyTests - */ - public function testSetProperty($property, $changeKey) - { - $def = new DefinitionDecorator('foo'); - - $getter = 'get'.ucfirst($property); - $setter = 'set'.ucfirst($property); - - $this->assertNull($def->$getter()); - $this->assertSame($def, $def->$setter('foo')); - $this->assertEquals('foo', $def->$getter()); - $this->assertEquals(array($changeKey => true), $def->getChanges()); - } - - public function getPropertyTests() - { - return array( - array('class', 'class'), - array('factory', 'factory'), - array('configurator', 'configurator'), - array('file', 'file'), - ); - } - - /** - * @dataProvider provideLegacyPropertyTests - * @group legacy - */ - public function testLegacySetProperty($property, $changeKey) - { - $def = new DefinitionDecorator('foo'); - - $getter = 'get'.ucfirst($property); - $setter = 'set'.ucfirst($property); - - $this->assertNull($def->$getter()); - $this->assertSame($def, $def->$setter('foo')); - $this->assertEquals('foo', $def->$getter()); - $this->assertEquals(array($changeKey => true), $def->getChanges()); - } - - public function provideLegacyPropertyTests() - { - return array( - array('factoryClass', 'factory_class'), - array('factoryMethod', 'factory_method'), - array('factoryService', 'factory_service'), - ); - } - - public function testSetPublic() - { - $def = new DefinitionDecorator('foo'); - - $this->assertTrue($def->isPublic()); - $this->assertSame($def, $def->setPublic(false)); - $this->assertFalse($def->isPublic()); - $this->assertEquals(array('public' => true), $def->getChanges()); - } - - public function testSetLazy() - { - $def = new DefinitionDecorator('foo'); - - $this->assertFalse($def->isLazy()); - $this->assertSame($def, $def->setLazy(false)); - $this->assertFalse($def->isLazy()); - $this->assertEquals(array('lazy' => true), $def->getChanges()); - } - - public function testSetArgument() - { - $def = new DefinitionDecorator('foo'); - - $this->assertEquals(array(), $def->getArguments()); - $this->assertSame($def, $def->replaceArgument(0, 'foo')); - $this->assertEquals(array('index_0' => 'foo'), $def->getArguments()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testReplaceArgumentShouldRequireIntegerIndex() - { - $def = new DefinitionDecorator('foo'); - - $def->replaceArgument('0', 'foo'); - } - - public function testReplaceArgument() - { - $def = new DefinitionDecorator('foo'); - - $def->setArguments(array(0 => 'foo', 1 => 'bar')); - $this->assertEquals('foo', $def->getArgument(0)); - $this->assertEquals('bar', $def->getArgument(1)); - - $this->assertSame($def, $def->replaceArgument(1, 'baz')); - $this->assertEquals('foo', $def->getArgument(0)); - $this->assertEquals('baz', $def->getArgument(1)); - - $this->assertEquals(array(0 => 'foo', 1 => 'bar', 'index_1' => 'baz'), $def->getArguments()); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testGetArgumentShouldCheckBounds() - { - $def = new DefinitionDecorator('foo'); - - $def->setArguments(array(0 => 'foo')); - $def->replaceArgument(0, 'foo'); - - $def->getArgument(1); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/DefinitionTest.php b/vendor/symfony/dependency-injection/Tests/DefinitionTest.php deleted file mode 100644 index b501f11..0000000 --- a/vendor/symfony/dependency-injection/Tests/DefinitionTest.php +++ /dev/null @@ -1,328 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Definition; - -class DefinitionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Definition::__construct - */ - public function testConstructor() - { - $def = new Definition('stdClass'); - $this->assertEquals('stdClass', $def->getClass(), '__construct() takes the class name as its first argument'); - - $def = new Definition('stdClass', array('foo')); - $this->assertEquals(array('foo'), $def->getArguments(), '__construct() takes an optional array of arguments as its second argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setFactory - * @covers Symfony\Component\DependencyInjection\Definition::getFactory - */ - public function testSetGetFactory() - { - $def = new Definition('stdClass'); - - $this->assertSame($def, $def->setFactory('foo'), '->setFactory() implements a fluent interface'); - $this->assertEquals('foo', $def->getFactory(), '->getFactory() returns the factory'); - - $def->setFactory('Foo::bar'); - $this->assertEquals(array('Foo', 'bar'), $def->getFactory(), '->setFactory() converts string static method call to the array'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setClass - * @covers Symfony\Component\DependencyInjection\Definition::getClass - */ - public function testSetGetClass() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setClass('foo'), '->setClass() implements a fluent interface'); - $this->assertEquals('foo', $def->getClass(), '->getClass() returns the class name'); - } - - public function testSetGetDecoratedService() - { - $def = new Definition('stdClass'); - $this->assertNull($def->getDecoratedService()); - $def->setDecoratedService('foo', 'foo.renamed'); - $this->assertEquals(array('foo', 'foo.renamed'), $def->getDecoratedService()); - $def->setDecoratedService(null); - $this->assertNull($def->getDecoratedService()); - - $def = new Definition('stdClass'); - $def->setDecoratedService('foo'); - $this->assertEquals(array('foo', null), $def->getDecoratedService()); - $def->setDecoratedService(null); - $this->assertNull($def->getDecoratedService()); - - $def = new Definition('stdClass'); - $this->setExpectedException('InvalidArgumentException', 'The decorated service inner name for "foo" must be different than the service name itself.'); - $def->setDecoratedService('foo', 'foo'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setArguments - * @covers Symfony\Component\DependencyInjection\Definition::getArguments - * @covers Symfony\Component\DependencyInjection\Definition::addArgument - */ - public function testArguments() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setArguments(array('foo')), '->setArguments() implements a fluent interface'); - $this->assertEquals(array('foo'), $def->getArguments(), '->getArguments() returns the arguments'); - $this->assertSame($def, $def->addArgument('bar'), '->addArgument() implements a fluent interface'); - $this->assertEquals(array('foo', 'bar'), $def->getArguments(), '->addArgument() adds an argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setMethodCalls - * @covers Symfony\Component\DependencyInjection\Definition::addMethodCall - * @covers Symfony\Component\DependencyInjection\Definition::hasMethodCall - * @covers Symfony\Component\DependencyInjection\Definition::removeMethodCall - */ - public function testMethodCalls() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setMethodCalls(array(array('foo', array('foo')))), '->setMethodCalls() implements a fluent interface'); - $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->getMethodCalls() returns the methods to call'); - $this->assertSame($def, $def->addMethodCall('bar', array('bar')), '->addMethodCall() implements a fluent interface'); - $this->assertEquals(array(array('foo', array('foo')), array('bar', array('bar'))), $def->getMethodCalls(), '->addMethodCall() adds a method to call'); - $this->assertTrue($def->hasMethodCall('bar'), '->hasMethodCall() returns true if first argument is a method to call registered'); - $this->assertFalse($def->hasMethodCall('no_registered'), '->hasMethodCall() returns false if first argument is not a method to call registered'); - $this->assertSame($def, $def->removeMethodCall('bar'), '->removeMethodCall() implements a fluent interface'); - $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->removeMethodCall() removes a method to call'); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage Method name cannot be empty. - */ - public function testExceptionOnEmptyMethodCall() - { - $def = new Definition('stdClass'); - $def->addMethodCall(''); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setFile - * @covers Symfony\Component\DependencyInjection\Definition::getFile - */ - public function testSetGetFile() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setFile('foo'), '->setFile() implements a fluent interface'); - $this->assertEquals('foo', $def->getFile(), '->getFile() returns the file to include'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setScope - * @covers Symfony\Component\DependencyInjection\Definition::getScope - */ - public function testSetGetScope() - { - $def = new Definition('stdClass'); - $this->assertEquals('container', $def->getScope()); - $this->assertSame($def, $def->setScope('foo')); - $this->assertEquals('foo', $def->getScope()); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setPublic - * @covers Symfony\Component\DependencyInjection\Definition::isPublic - */ - public function testSetIsPublic() - { - $def = new Definition('stdClass'); - $this->assertTrue($def->isPublic(), '->isPublic() returns true by default'); - $this->assertSame($def, $def->setPublic(false), '->setPublic() implements a fluent interface'); - $this->assertFalse($def->isPublic(), '->isPublic() returns false if the instance must not be public.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setSynthetic - * @covers Symfony\Component\DependencyInjection\Definition::isSynthetic - */ - public function testSetIsSynthetic() - { - $def = new Definition('stdClass'); - $this->assertFalse($def->isSynthetic(), '->isSynthetic() returns false by default'); - $this->assertSame($def, $def->setSynthetic(true), '->setSynthetic() implements a fluent interface'); - $this->assertTrue($def->isSynthetic(), '->isSynthetic() returns true if the service is synthetic.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setSynchronized - * @covers Symfony\Component\DependencyInjection\Definition::isSynchronized - * @group legacy - */ - public function testLegacySetIsSynchronized() - { - $def = new Definition('stdClass'); - $this->assertFalse($def->isSynchronized(), '->isSynchronized() returns false by default'); - $this->assertSame($def, $def->setSynchronized(true), '->setSynchronized() implements a fluent interface'); - $this->assertTrue($def->isSynchronized(), '->isSynchronized() returns true if the service is synchronized.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setLazy - * @covers Symfony\Component\DependencyInjection\Definition::isLazy - */ - public function testSetIsLazy() - { - $def = new Definition('stdClass'); - $this->assertFalse($def->isLazy(), '->isLazy() returns false by default'); - $this->assertSame($def, $def->setLazy(true), '->setLazy() implements a fluent interface'); - $this->assertTrue($def->isLazy(), '->isLazy() returns true if the service is lazy.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setAbstract - * @covers Symfony\Component\DependencyInjection\Definition::isAbstract - */ - public function testSetIsAbstract() - { - $def = new Definition('stdClass'); - $this->assertFalse($def->isAbstract(), '->isAbstract() returns false by default'); - $this->assertSame($def, $def->setAbstract(true), '->setAbstract() implements a fluent interface'); - $this->assertTrue($def->isAbstract(), '->isAbstract() returns true if the instance must not be public.'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::setConfigurator - * @covers Symfony\Component\DependencyInjection\Definition::getConfigurator - */ - public function testSetGetConfigurator() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->setConfigurator('foo'), '->setConfigurator() implements a fluent interface'); - $this->assertEquals('foo', $def->getConfigurator(), '->getConfigurator() returns the configurator'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::clearTags - */ - public function testClearTags() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); - $def->addTag('foo', array('foo' => 'bar')); - $def->clearTags(); - $this->assertEquals(array(), $def->getTags(), '->clearTags() removes all current tags'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::clearTags - */ - public function testClearTag() - { - $def = new Definition('stdClass'); - $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); - $def->addTag('1foo1', array('foo1' => 'bar1')); - $def->addTag('2foo2', array('foo2' => 'bar2')); - $def->addTag('3foo3', array('foo3' => 'bar3')); - $def->clearTag('2foo2'); - $this->assertTrue($def->hasTag('1foo1')); - $this->assertFalse($def->hasTag('2foo2')); - $this->assertTrue($def->hasTag('3foo3')); - $def->clearTag('1foo1'); - $this->assertFalse($def->hasTag('1foo1')); - $this->assertTrue($def->hasTag('3foo3')); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::addTag - * @covers Symfony\Component\DependencyInjection\Definition::getTag - * @covers Symfony\Component\DependencyInjection\Definition::getTags - * @covers Symfony\Component\DependencyInjection\Definition::hasTag - */ - public function testTags() - { - $def = new Definition('stdClass'); - $this->assertEquals(array(), $def->getTag('foo'), '->getTag() returns an empty array if the tag is not defined'); - $this->assertFalse($def->hasTag('foo')); - $this->assertSame($def, $def->addTag('foo'), '->addTag() implements a fluent interface'); - $this->assertTrue($def->hasTag('foo')); - $this->assertEquals(array(array()), $def->getTag('foo'), '->getTag() returns attributes for a tag name'); - $def->addTag('foo', array('foo' => 'bar')); - $this->assertEquals(array(array(), array('foo' => 'bar')), $def->getTag('foo'), '->addTag() can adds the same tag several times'); - $def->addTag('bar', array('bar' => 'bar')); - $this->assertEquals($def->getTags(), array( - 'foo' => array(array(), array('foo' => 'bar')), - 'bar' => array(array('bar' => 'bar')), - ), '->getTags() returns all tags'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Definition::replaceArgument - */ - public function testSetArgument() - { - $def = new Definition('stdClass'); - - $def->addArgument('foo'); - $this->assertSame(array('foo'), $def->getArguments()); - - $this->assertSame($def, $def->replaceArgument(0, 'moo')); - $this->assertSame(array('moo'), $def->getArguments()); - - $def->addArgument('moo'); - $def - ->replaceArgument(0, 'foo') - ->replaceArgument(1, 'bar') - ; - $this->assertSame(array('foo', 'bar'), $def->getArguments()); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testGetArgumentShouldCheckBounds() - { - $def = new Definition('stdClass'); - - $def->addArgument('foo'); - $def->getArgument(1); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testReplaceArgumentShouldCheckBounds() - { - $def = new Definition('stdClass'); - - $def->addArgument('foo'); - $def->replaceArgument(1, 'bar'); - } - - public function testSetGetProperties() - { - $def = new Definition('stdClass'); - - $this->assertEquals(array(), $def->getProperties()); - $this->assertSame($def, $def->setProperties(array('foo' => 'bar'))); - $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); - } - - public function testSetProperty() - { - $def = new Definition('stdClass'); - - $this->assertEquals(array(), $def->getProperties()); - $this->assertSame($def, $def->setProperty('foo', 'bar')); - $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Dumper/GraphvizDumperTest.php b/vendor/symfony/dependency-injection/Tests/Dumper/GraphvizDumperTest.php deleted file mode 100644 index 5da1135..0000000 --- a/vendor/symfony/dependency-injection/Tests/Dumper/GraphvizDumperTest.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\GraphvizDumper; - -class GraphvizDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = __DIR__.'/../Fixtures/'; - } - - /** - * @group legacy - */ - public function testLegacyDump() - { - $container = include self::$fixturesPath.'/containers/legacy-container9.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/legacy-services9.dot')), $dumper->dump(), '->dump() dumps services'); - } - - public function testDump() - { - $dumper = new GraphvizDumper($container = new ContainerBuilder()); - - $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services1.dot', $dumper->dump(), '->dump() dumps an empty container as an empty dot file'); - - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services9.dot')), $dumper->dump(), '->dump() dumps services'); - - $container = include self::$fixturesPath.'/containers/container10.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10.dot')), $dumper->dump(), '->dump() dumps services'); - - $container = include self::$fixturesPath.'/containers/container10.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals($dumper->dump(array( - 'graph' => array('ratio' => 'normal'), - 'node' => array('fontsize' => 13, 'fontname' => 'Verdana', 'shape' => 'square'), - 'edge' => array('fontsize' => 12, 'fontname' => 'Verdana', 'color' => 'white', 'arrowhead' => 'closed', 'arrowsize' => 1), - 'node.instance' => array('fillcolor' => 'green', 'style' => 'empty'), - 'node.definition' => array('fillcolor' => 'grey'), - 'node.missing' => array('fillcolor' => 'red', 'style' => 'empty'), - )), str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10-1.dot')), '->dump() dumps services'); - } - - public function testDumpWithFrozenContainer() - { - $container = include self::$fixturesPath.'/containers/container13.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services13.dot')), $dumper->dump(), '->dump() dumps services'); - } - - public function testDumpWithFrozenCustomClassContainer() - { - $container = include self::$fixturesPath.'/containers/container14.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services14.dot')), $dumper->dump(), '->dump() dumps services'); - } - - public function testDumpWithUnresolvedParameter() - { - $container = include self::$fixturesPath.'/containers/container17.php'; - $dumper = new GraphvizDumper($container); - - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services17.dot')), $dumper->dump(), '->dump() dumps services'); - } - - public function testDumpWithScopes() - { - $container = include self::$fixturesPath.'/containers/container18.php'; - $dumper = new GraphvizDumper($container); - $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services18.dot')), $dumper->dump(), '->dump() dumps services'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php b/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php deleted file mode 100644 index 063007e..0000000 --- a/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php +++ /dev/null @@ -1,221 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\PhpDumper; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; - -class PhpDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - public function testDump() - { - $dumper = new PhpDumper($container = new ContainerBuilder()); - - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1.php', $dumper->dump(), '->dump() dumps an empty container as an empty PHP class'); - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1-1.php', $dumper->dump(array('class' => 'Container', 'base_class' => 'AbstractContainer', 'namespace' => 'Symfony\Component\DependencyInjection\Dump')), '->dump() takes a class and a base_class options'); - - $container = new ContainerBuilder(); - new PhpDumper($container); - } - - public function testDumpOptimizationString() - { - $definition = new Definition(); - $definition->setClass('stdClass'); - $definition->addArgument(array( - 'only dot' => '.', - 'concatenation as value' => '.\'\'.', - 'concatenation from the start value' => '\'\'.', - '.' => 'dot as a key', - '.\'\'.' => 'concatenation as a key', - '\'\'.' => 'concatenation from the start key', - 'optimize concatenation' => 'string1%some_string%string2', - 'optimize concatenation with empty string' => 'string1%empty_value%string2', - 'optimize concatenation from the start' => '%empty_value%start', - 'optimize concatenation at the end' => 'end%empty_value%', - )); - - $container = new ContainerBuilder(); - $container->setResourceTracking(false); - $container->setDefinition('test', $definition); - $container->setParameter('empty_value', ''); - $container->setParameter('some_string', '-'); - $container->compile(); - - $dumper = new PhpDumper($container); - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services10.php', $dumper->dump(), '->dump() dumps an empty container as an empty PHP class'); - } - - public function testDumpRelativeDir() - { - $definition = new Definition(); - $definition->setClass('stdClass'); - $definition->addArgument('%foo%'); - $definition->addArgument(array('%foo%' => '%buz%/')); - - $container = new ContainerBuilder(); - $container->setDefinition('test', $definition); - $container->setParameter('foo', 'wiz'.dirname(__DIR__)); - $container->setParameter('bar', __DIR__); - $container->setParameter('baz', '%bar%/PhpDumperTest.php'); - $container->setParameter('buz', dirname(dirname(__DIR__))); - $container->compile(); - - $dumper = new PhpDumper($container); - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services12.php', $dumper->dump(array('file' => __FILE__)), '->dump() dumps __DIR__ relative strings'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testExportParameters() - { - $dumper = new PhpDumper(new ContainerBuilder(new ParameterBag(array('foo' => new Reference('foo'))))); - $dumper->dump(); - } - - public function testAddParameters() - { - $container = include self::$fixturesPath.'/containers/container8.php'; - $dumper = new PhpDumper($container); - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services8.php', $dumper->dump(), '->dump() dumps parameters'); - } - - public function testAddService() - { - // without compilation - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new PhpDumper($container); - $this->assertEquals(str_replace('%path%', str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services9.php')), $dumper->dump(), '->dump() dumps services'); - - // with compilation - $container = include self::$fixturesPath.'/containers/container9.php'; - $container->compile(); - $dumper = new PhpDumper($container); - $this->assertEquals(str_replace('%path%', str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services9_compiled.php')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new PhpDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Symfony\Component\DependencyInjection\Exception\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } - - /** - * @group legacy - */ - public function testLegacySynchronizedServices() - { - $container = include self::$fixturesPath.'/containers/container20.php'; - $dumper = new PhpDumper($container); - $this->assertEquals(str_replace('%path%', str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services20.php')), $dumper->dump(), '->dump() dumps services'); - } - - public function testServicesWithAnonymousFactories() - { - $container = include self::$fixturesPath.'/containers/container19.php'; - $dumper = new PhpDumper($container); - - $this->assertStringEqualsFile(self::$fixturesPath.'/php/services19.php', $dumper->dump(), '->dump() dumps services with anonymous factories'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Service id "bar$" cannot be converted to a valid PHP method name. - */ - public function testAddServiceInvalidServiceId() - { - $container = new ContainerBuilder(); - $container->register('bar$', 'FooClass'); - $dumper = new PhpDumper($container); - $dumper->dump(); - } - - public function testAliases() - { - $container = include self::$fixturesPath.'/containers/container9.php'; - $container->compile(); - $dumper = new PhpDumper($container); - eval('?>'.$dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Aliases'))); - - $container = new \Symfony_DI_PhpDumper_Test_Aliases(); - $container->set('foo', $foo = new \stdClass()); - $this->assertSame($foo, $container->get('foo')); - $this->assertSame($foo, $container->get('alias_for_foo')); - $this->assertSame($foo, $container->get('alias_for_alias')); - } - - public function testFrozenContainerWithoutAliases() - { - $container = new ContainerBuilder(); - $container->compile(); - - $dumper = new PhpDumper($container); - eval('?>'.$dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Frozen_No_Aliases'))); - - $container = new \Symfony_DI_PhpDumper_Test_Frozen_No_Aliases(); - $this->assertFalse($container->has('foo')); - } - - public function testOverrideServiceWhenUsingADumpedContainer() - { - require_once self::$fixturesPath.'/php/services9.php'; - require_once self::$fixturesPath.'/includes/foo.php'; - - $container = new \ProjectServiceContainer(); - $container->set('bar', $bar = new \stdClass()); - $container->setParameter('foo_bar', 'foo_bar'); - - $this->assertEquals($bar, $container->get('bar'), '->set() overrides an already defined service'); - } - - public function testOverrideServiceWhenUsingADumpedContainerAndServiceIsUsedFromAnotherOne() - { - require_once self::$fixturesPath.'/php/services9.php'; - require_once self::$fixturesPath.'/includes/foo.php'; - require_once self::$fixturesPath.'/includes/classes.php'; - - $container = new \ProjectServiceContainer(); - $container->set('bar', $bar = new \stdClass()); - - $this->assertSame($bar, $container->get('foo')->bar, '->set() overrides an already defined service'); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - */ - public function testCircularReference() - { - $container = new ContainerBuilder(); - $container->register('foo', 'stdClass')->addArgument(new Reference('bar')); - $container->register('bar', 'stdClass')->setPublic(false)->addMethodCall('setA', array(new Reference('baz'))); - $container->register('baz', 'stdClass')->addMethodCall('setA', array(new Reference('foo'))); - $container->compile(); - - $dumper = new PhpDumper($container); - $dumper->dump(); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Dumper/XmlDumperTest.php b/vendor/symfony/dependency-injection/Tests/Dumper/XmlDumperTest.php deleted file mode 100644 index 8aa544c..0000000 --- a/vendor/symfony/dependency-injection/Tests/Dumper/XmlDumperTest.php +++ /dev/null @@ -1,184 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\XmlDumper; - -class XmlDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - public function testDump() - { - $dumper = new XmlDumper(new ContainerBuilder()); - - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services1.xml', $dumper->dump(), '->dump() dumps an empty container as an empty XML file'); - } - - public function testExportParameters() - { - $container = include self::$fixturesPath.'//containers/container8.php'; - $dumper = new XmlDumper($container); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services8.xml', $dumper->dump(), '->dump() dumps parameters'); - } - - public function testAddParameters() - { - $container = include self::$fixturesPath.'//containers/container8.php'; - $dumper = new XmlDumper($container); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services8.xml', $dumper->dump(), '->dump() dumps parameters'); - } - - /** - * @group legacy - */ - public function testLegacyAddService() - { - $container = include self::$fixturesPath.'/containers/legacy-container9.php'; - $dumper = new XmlDumper($container); - - $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/xml/legacy-services9.xml')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new XmlDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } - - public function testAddService() - { - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new XmlDumper($container); - - $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/xml/services9.xml')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new XmlDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } - - public function testDumpAnonymousServices() - { - $container = include self::$fixturesPath.'/containers/container11.php'; - $dumper = new XmlDumper($container); - $this->assertEquals(' - - - - - - - - - - - - - -', $dumper->dump()); - } - - public function testDumpEntities() - { - $container = include self::$fixturesPath.'/containers/container12.php'; - $dumper = new XmlDumper($container); - $this->assertEquals(" - - - - - foo<>&bar - - - -", $dumper->dump()); - } - - /** - * @dataProvider provideDecoratedServicesData - */ - public function testDumpDecoratedServices($expectedXmlDump, $container) - { - $dumper = new XmlDumper($container); - $this->assertEquals($expectedXmlDump, $dumper->dump()); - } - - public function provideDecoratedServicesData() - { - $fixturesPath = realpath(__DIR__.'/../Fixtures/'); - - return array( - array(" - - - - - -", include $fixturesPath.'/containers/container15.php'), - array(" - - - - - -", include $fixturesPath.'/containers/container16.php'), - ); - } - - /** - * @dataProvider provideCompiledContainerData - */ - public function testCompiledContainerCanBeDumped($containerFile) - { - $fixturesPath = __DIR__.'/../Fixtures'; - $container = require $fixturesPath.'/containers/'.$containerFile.'.php'; - $container->compile(); - $dumper = new XmlDumper($container); - $dumper->dump(); - } - - public function provideCompiledContainerData() - { - return array( - array('container8'), - array('container9'), - array('container11'), - array('container12'), - array('container14'), - ); - } - - public function testDumpInlinedServices() - { - $container = include self::$fixturesPath.'/containers/container21.php'; - $dumper = new XmlDumper($container); - - $this->assertEquals(file_get_contents(self::$fixturesPath.'/xml/services21.xml'), $dumper->dump()); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Dumper/YamlDumperTest.php b/vendor/symfony/dependency-injection/Tests/Dumper/YamlDumperTest.php deleted file mode 100644 index 8e9f117..0000000 --- a/vendor/symfony/dependency-injection/Tests/Dumper/YamlDumperTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Dumper; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\YamlDumper; - -class YamlDumperTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - public function testDump() - { - $dumper = new YamlDumper($container = new ContainerBuilder()); - - $this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services1.yml', $dumper->dump(), '->dump() dumps an empty container as an empty YAML file'); - - $container = new ContainerBuilder(); - $dumper = new YamlDumper($container); - } - - public function testAddParameters() - { - $container = include self::$fixturesPath.'/containers/container8.php'; - $dumper = new YamlDumper($container); - $this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services8.yml', $dumper->dump(), '->dump() dumps parameters'); - } - - /** - * @group legacy - */ - public function testLegacyAddService() - { - $container = include self::$fixturesPath.'/containers/legacy-container9.php'; - $dumper = new YamlDumper($container); - - $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/legacy-services9.yml')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new YamlDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } - - public function testAddService() - { - $container = include self::$fixturesPath.'/containers/container9.php'; - $dumper = new YamlDumper($container); - $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/services9.yml')), $dumper->dump(), '->dump() dumps services'); - - $dumper = new YamlDumper($container = new ContainerBuilder()); - $container->register('foo', 'FooClass')->addArgument(new \stdClass()); - try { - $dumper->dump(); - $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); - } - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Extension/ExtensionTest.php b/vendor/symfony/dependency-injection/Tests/Extension/ExtensionTest.php deleted file mode 100644 index e7f19a6..0000000 --- a/vendor/symfony/dependency-injection/Tests/Extension/ExtensionTest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Extension; - -class ExtensionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getResolvedEnabledFixtures - */ - public function testIsConfigEnabledReturnsTheResolvedValue($enabled) - { - $pb = $this->getMockBuilder('Symfony\Component\DependencyInjection\ParameterBag\ParameterBag') - ->setMethods(array('resolveValue')) - ->getMock() - ; - - $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder') - ->setMethods(array('getParameterBag')) - ->getMock() - ; - - $pb->expects($this->once()) - ->method('resolveValue') - ->with($this->equalTo($enabled)) - ->will($this->returnValue($enabled)) - ; - - $container->expects($this->once()) - ->method('getParameterBag') - ->will($this->returnValue($pb)) - ; - - $extension = $this->getMockBuilder('Symfony\Component\DependencyInjection\Extension\Extension') - ->setMethods(array()) - ->getMockForAbstractClass() - ; - - $r = new \ReflectionMethod('Symfony\Component\DependencyInjection\Extension\Extension', 'isConfigEnabled'); - $r->setAccessible(true); - - $r->invoke($extension, $container, array('enabled' => $enabled)); - } - - public function getResolvedEnabledFixtures() - { - return array( - array(true), - array(false), - ); - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage The config array has no 'enabled' key. - */ - public function testIsConfigEnabledOnNonEnableableConfig() - { - $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder') - ->getMock() - ; - - $extension = $this->getMockBuilder('Symfony\Component\DependencyInjection\Extension\Extension') - ->setMethods(array()) - ->getMockForAbstractClass() - ; - - $r = new \ReflectionMethod('Symfony\Component\DependencyInjection\Extension\Extension', 'isConfigEnabled'); - $r->setAccessible(true); - - $r->invoke($extension, $container, array()); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container10.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container10.php deleted file mode 100644 index a16ca9f..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container10.php +++ /dev/null @@ -1,14 +0,0 @@ - - register('foo', 'FooClass')-> - addArgument(new Reference('bar')) -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container11.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container11.php deleted file mode 100644 index 3e6cafc..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container11.php +++ /dev/null @@ -1,12 +0,0 @@ - - register('foo', 'FooClass')-> - addArgument(new Definition('BarClass', array(new Definition('BazClass')))) -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container12.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container12.php deleted file mode 100644 index 73c5b4e..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container12.php +++ /dev/null @@ -1,12 +0,0 @@ - - register('foo', 'FooClass\\Foo')-> - addArgument('foo<>&bar')-> - addTag('foo"bar\\bar', array('foo' => 'foo"barřž€')) -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container13.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container13.php deleted file mode 100644 index cc716c7..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container13.php +++ /dev/null @@ -1,16 +0,0 @@ - - register('foo', 'FooClass')-> - addArgument(new Reference('bar')) -; -$container-> - register('bar', 'BarClass') -; -$container->compile(); - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container14.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container14.php deleted file mode 100644 index 56ea6c1..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container14.php +++ /dev/null @@ -1,17 +0,0 @@ -register('foo', 'FooClass\\Foo') - ->setDecoratedService('bar', 'bar.woozy') -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container16.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container16.php deleted file mode 100644 index 67b4d35..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container16.php +++ /dev/null @@ -1,11 +0,0 @@ -register('foo', 'FooClass\\Foo') - ->setDecoratedService('bar') -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container17.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container17.php deleted file mode 100644 index d902ec2..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container17.php +++ /dev/null @@ -1,10 +0,0 @@ -register('foo', '%foo.class%') -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container18.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container18.php deleted file mode 100644 index 0248ed4..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container18.php +++ /dev/null @@ -1,14 +0,0 @@ -addScope(new Scope('request')); -$container-> - register('foo', 'FooClass')-> - setScope('request') -; -$container->compile(); - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container19.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container19.php deleted file mode 100644 index 64b8f06..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container19.php +++ /dev/null @@ -1,22 +0,0 @@ -register('service_from_anonymous_factory', 'Bar\FooClass') - ->setFactory(array(new Definition('Bar\FooClass'), 'getInstance')) -; - -$anonymousServiceWithFactory = new Definition('Bar\FooClass'); -$anonymousServiceWithFactory->setFactory('Bar\FooClass::getInstance'); -$container - ->register('service_with_method_call_and_factory', 'Bar\FooClass') - ->addMethodCall('setBar', array($anonymousServiceWithFactory)) -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container20.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container20.php deleted file mode 100644 index a40a0e8..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container20.php +++ /dev/null @@ -1,19 +0,0 @@ -register('request', 'Request') - ->setSynchronized(true) -; -$container - ->register('depends_on_request', 'stdClass') - ->addMethodCall('setRequest', array(new Reference('request', ContainerInterface::NULL_ON_INVALID_REFERENCE, false))) -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container21.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container21.php deleted file mode 100644 index d046738..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container21.php +++ /dev/null @@ -1,20 +0,0 @@ -setConfigurator(array(new Definition('Baz'), 'configureBar')); - -$fooFactory = new Definition('FooFactory'); -$fooFactory->setFactory(array(new Definition('Foobar'), 'createFooFactory')); - -$container - ->register('foo', 'Foo') - ->setFactory(array($fooFactory, 'createFoo')) - ->setConfigurator(array($bar, 'configureFoo')) -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container8.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container8.php deleted file mode 100644 index f0b4ca9..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container8.php +++ /dev/null @@ -1,14 +0,0 @@ - '%baz%', - 'baz' => 'bar', - 'bar' => 'foo is %%foo bar', - 'escape' => '@escapeme', - 'values' => array(true, false, null, 0, 1000.3, 'true', 'false', 'null'), -))); - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container9.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container9.php deleted file mode 100644 index 47064c3..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/container9.php +++ /dev/null @@ -1,113 +0,0 @@ -register('foo', '\Bar\FooClass') - ->addTag('foo', array('foo' => 'foo')) - ->addTag('foo', array('bar' => 'bar', 'baz' => 'baz')) - ->setFactory(array('Bar\\FooClass', 'getInstance')) - ->setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%'), true, new Reference('service_container'))) - ->setProperties(array('foo' => 'bar', 'moo' => new Reference('foo.baz'), 'qux' => array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%'))) - ->addMethodCall('setBar', array(new Reference('bar'))) - ->addMethodCall('initialize') - ->setConfigurator('sc_configure') -; -$container - ->register('foo.baz', '%baz_class%') - ->setFactory(array('%baz_class%', 'getInstance')) - ->setConfigurator(array('%baz_class%', 'configureStatic1')) -; -$container - ->register('bar', 'Bar\FooClass') - ->setArguments(array('foo', new Reference('foo.baz'), new Parameter('foo_bar'))) - ->setScope('container') - ->setConfigurator(array(new Reference('foo.baz'), 'configure')) -; -$container - ->register('foo_bar', '%foo_class%') - ->setScope('prototype') -; -$container->getParameterBag()->clear(); -$container->getParameterBag()->add(array( - 'baz_class' => 'BazClass', - 'foo_class' => 'Bar\FooClass', - 'foo' => 'bar', -)); -$container->setAlias('alias_for_foo', 'foo'); -$container->setAlias('alias_for_alias', 'alias_for_foo'); -$container - ->register('method_call1', 'Bar\FooClass') - ->setFile(realpath(__DIR__.'/../includes/foo.php')) - ->addMethodCall('setBar', array(new Reference('foo'))) - ->addMethodCall('setBar', array(new Reference('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE))) - ->addMethodCall('setBar', array(new Reference('foo3', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))) - ->addMethodCall('setBar', array(new Reference('foobaz', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))) - ->addMethodCall('setBar', array(new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")'))) -; -$container - ->register('foo_with_inline', 'Foo') - ->addMethodCall('setBar', array(new Reference('inlined'))) -; -$container - ->register('inlined', 'Bar') - ->setProperty('pub', 'pub') - ->addMethodCall('setBaz', array(new Reference('baz'))) - ->setPublic(false) -; -$container - ->register('baz', 'Baz') - ->addMethodCall('setFoo', array(new Reference('foo_with_inline'))) -; -$container - ->register('request', 'Request') - ->setSynthetic(true) -; -$container - ->register('configurator_service', 'ConfClass') - ->setPublic(false) - ->addMethodCall('setFoo', array(new Reference('baz'))) -; -$container - ->register('configured_service', 'stdClass') - ->setConfigurator(array(new Reference('configurator_service'), 'configureStdClass')) -; -$container - ->register('decorated', 'stdClass') -; -$container - ->register('decorator_service', 'stdClass') - ->setDecoratedService('decorated') -; -$container - ->register('decorator_service_with_name', 'stdClass') - ->setDecoratedService('decorated', 'decorated.pif-pouf') -; -$container - ->register('new_factory', 'FactoryClass') - ->setProperty('foo', 'bar') - ->setScope('container') - ->setPublic(false) -; -$container - ->register('factory_service', 'Bar') - ->setFactory(array(new Reference('foo.baz'), 'getInstance')) -; -$container - ->register('new_factory_service', 'FooBarBaz') - ->setProperty('foo', 'bar') - ->setFactory(array(new Reference('new_factory'), 'getInstance')) -; -$container - ->register('service_from_static_method', 'Bar\FooClass') - ->setFactory(array('Bar\FooClass', 'getInstance')) -; - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/legacy-container9.php b/vendor/symfony/dependency-injection/Tests/Fixtures/containers/legacy-container9.php deleted file mode 100644 index 9f4210c..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/containers/legacy-container9.php +++ /dev/null @@ -1,39 +0,0 @@ - - register('foo', 'Bar\FooClass')-> - addTag('foo', array('foo' => 'foo'))-> - addTag('foo', array('bar' => 'bar'))-> - setFactoryClass('Bar\\FooClass')-> - setFactoryMethod('getInstance')-> - setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%'), true, new Reference('service_container')))-> - setProperties(array('foo' => 'bar', 'moo' => new Reference('foo.baz'), 'qux' => array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%')))-> - addMethodCall('setBar', array(new Reference('bar')))-> - addMethodCall('initialize')-> - setConfigurator('sc_configure') -; -$container-> - register('foo.baz', '%baz_class%')-> - setFactoryClass('%baz_class%')-> - setFactoryMethod('getInstance')-> - setConfigurator(array('%baz_class%', 'configureStatic1')) -; -$container-> - register('factory_service', 'Bar')-> - setFactoryService('foo.baz')-> - setFactoryMethod('getInstance') -; -$container->getParameterBag()->clear(); -$container->getParameterBag()->add(array( - 'baz_class' => 'BazClass', - 'foo' => 'bar', -)); - -return $container; diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/legacy-services9.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/legacy-services9.dot deleted file mode 100644 index 4e8dfb9..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/legacy-services9.dot +++ /dev/null @@ -1,15 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_foo_baz [label="foo.baz\nBazClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_factory_service [label="factory_service\nBar\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; - node_bar [label="bar\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foo -> node_foo_baz [label="" style="filled"]; - node_foo -> node_service_container [label="" style="filled"]; - node_foo -> node_foo_baz [label="" style="dashed"]; - node_foo -> node_bar [label="setBar()" style="dashed"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services1.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services1.dot deleted file mode 100644 index 1bb7c30..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services1.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services10-1.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services10-1.dot deleted file mode 100644 index 0e578b1..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services10-1.dot +++ /dev/null @@ -1,10 +0,0 @@ -digraph sc { - ratio="normal" - node [fontsize="13" fontname="Verdana" shape="square"]; - edge [fontsize="12" fontname="Verdana" color="white" arrowhead="closed" arrowsize="1"]; - - node_foo [label="foo\nFooClass\n", shape=square, fillcolor="grey", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=square, fillcolor="green", style="empty"]; - node_bar [label="bar\n\n", shape=square, fillcolor="red", style="empty"]; - node_foo -> node_bar [label="" style="filled"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services10.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services10.dot deleted file mode 100644 index f17857f..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services10.dot +++ /dev/null @@ -1,10 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; - node_bar [label="bar\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foo -> node_bar [label="" style="filled"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services13.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services13.dot deleted file mode 100644 index bc7f813..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services13.dot +++ /dev/null @@ -1,10 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_bar [label="bar\nBarClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; - node_foo -> node_bar [label="" style="filled"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services14.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services14.dot deleted file mode 100644 index d07dc38..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services14.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_service_container [label="service_container\nContainer14\\ProjectServiceContainer\n", shape=record, fillcolor="#9999ff", style="filled"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services17.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services17.dot deleted file mode 100644 index a6d04bf..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services17.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo\n%foo.class%\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services18.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services18.dot deleted file mode 100644 index 4fbccee..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services18.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services9.dot b/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services9.dot deleted file mode 100644 index b3b424e..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/graphviz/services9.dot +++ /dev/null @@ -1,41 +0,0 @@ -digraph sc { - ratio="compress" - node [fontsize="11" fontname="Arial" shape="record"]; - edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; - - node_foo [label="foo (alias_for_foo)\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_foo_baz [label="foo.baz\nBazClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_bar [label="bar\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_foo_bar [label="foo_bar\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="dotted"]; - node_method_call1 [label="method_call1\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_foo_with_inline [label="foo_with_inline\nFoo\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_inlined [label="inlined\nBar\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_baz [label="baz\nBaz\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_request [label="request\nRequest\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_configurator_service [label="configurator_service\nConfClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_configured_service [label="configured_service\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_decorated [label="decorated\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_decorator_service [label="decorator_service\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_decorator_service_with_name [label="decorator_service_with_name\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_new_factory [label="new_factory\nFactoryClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_factory_service [label="factory_service\nBar\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_new_factory_service [label="new_factory_service\nFooBarBaz\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_from_static_method [label="service_from_static_method\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; - node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; - node_foo2 [label="foo2\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foo3 [label="foo3\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foobaz [label="foobaz\n\n", shape=record, fillcolor="#ff9999", style="filled"]; - node_foo -> node_foo_baz [label="" style="filled"]; - node_foo -> node_service_container [label="" style="filled"]; - node_foo -> node_foo_baz [label="" style="dashed"]; - node_foo -> node_bar [label="setBar()" style="dashed"]; - node_bar -> node_foo_baz [label="" style="filled"]; - node_method_call1 -> node_foo [label="setBar()" style="dashed"]; - node_method_call1 -> node_foo2 [label="setBar()" style="dashed"]; - node_method_call1 -> node_foo3 [label="setBar()" style="dashed"]; - node_method_call1 -> node_foobaz [label="setBar()" style="dashed"]; - node_foo_with_inline -> node_inlined [label="setBar()" style="dashed"]; - node_inlined -> node_baz [label="setBaz()" style="dashed"]; - node_baz -> node_foo_with_inline [label="setFoo()" style="dashed"]; - node_configurator_service -> node_baz [label="setFoo()" style="dashed"]; -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectExtension.php b/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectExtension.php deleted file mode 100644 index c9f8010..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectExtension.php +++ /dev/null @@ -1,40 +0,0 @@ -setDefinition('project.service.bar', new Definition('FooClass')); - $configuration->setParameter('project.parameter.bar', isset($config['foo']) ? $config['foo'] : 'foobar'); - - $configuration->setDefinition('project.service.foo', new Definition('FooClass')); - $configuration->setParameter('project.parameter.foo', isset($config['foo']) ? $config['foo'] : 'foobar'); - - return $configuration; - } - - public function getXsdValidationBasePath() - { - return false; - } - - public function getNamespace() - { - return 'http://www.example.com/schema/project'; - } - - public function getAlias() - { - return 'project'; - } - - public function getConfiguration(array $config, ContainerBuilder $container) - { - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtension.php b/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtension.php deleted file mode 100644 index 2ee2f12..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtension.php +++ /dev/null @@ -1,19 +0,0 @@ - -"ProjectWithXsdExtensionInPhar.phar!ProjectWithXsdExtensionInPhar.phplTUlWѶschema/project-1.0.xsdTUrr - - - - - - - - -|M*c(.k&`GBMB \ No newline at end of file diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/classes.php b/vendor/symfony/dependency-injection/Tests/Fixtures/includes/classes.php deleted file mode 100644 index 70c3d27..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/classes.php +++ /dev/null @@ -1,61 +0,0 @@ -configure(); -} - -class BarClass -{ - protected $baz; - public $foo = 'foo'; - - public function setBaz(BazClass $baz) - { - $this->baz = $baz; - } - - public function getBaz() - { - return $this->baz; - } -} - -class BazClass -{ - protected $foo; - - public function setFoo(Foo $foo) - { - $this->foo = $foo; - } - - public function configure($instance) - { - $instance->configure(); - } - - public static function getInstance() - { - return new self(); - } - - public static function configureStatic($instance) - { - $instance->configure(); - } - - public static function configureStatic1() - { - } -} - -class BarUserClass -{ - public $bar; - - public function __construct(BarClass $bar) - { - $this->bar = $bar; - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/createphar.php b/vendor/symfony/dependency-injection/Tests/Fixtures/includes/createphar.php deleted file mode 100644 index 5fa06a0..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/createphar.php +++ /dev/null @@ -1,47 +0,0 @@ -addFromString('ProjectWithXsdExtensionInPhar.php', <<addFromString('schema/project-1.0.xsd', << - - - - - - - - - -EOT -); -$phar->setStub(''); diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/foo.php b/vendor/symfony/dependency-injection/Tests/Fixtures/includes/foo.php deleted file mode 100644 index 55968af..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/foo.php +++ /dev/null @@ -1,38 +0,0 @@ -arguments = $arguments; - } - - public static function getInstance($arguments = array()) - { - $obj = new self($arguments); - $obj->called = true; - - return $obj; - } - - public function initialize() - { - $this->initialized = true; - } - - public function configure() - { - $this->configured = true; - } - - public function setBar($value = null) - { - $this->bar = $value; - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/schema/project-1.0.xsd b/vendor/symfony/dependency-injection/Tests/Fixtures/includes/schema/project-1.0.xsd deleted file mode 100644 index 282884e..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/includes/schema/project-1.0.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/nonvalid.ini b/vendor/symfony/dependency-injection/Tests/Fixtures/ini/nonvalid.ini deleted file mode 100644 index 9f84a608..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/nonvalid.ini +++ /dev/null @@ -1,2 +0,0 @@ -{NOT AN INI FILE} -{JUST A PLAIN TEXT FILE} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters.ini b/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters.ini deleted file mode 100644 index df92f75..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters.ini +++ /dev/null @@ -1,3 +0,0 @@ -[parameters] - foo = bar - bar = %foo% diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters1.ini b/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters1.ini deleted file mode 100644 index e50f722..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters1.ini +++ /dev/null @@ -1,3 +0,0 @@ -[parameters] - FOO = foo - baz = baz diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters2.ini b/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters2.ini deleted file mode 100644 index 75fbac6..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/ini/parameters2.ini +++ /dev/null @@ -1,2 +0,0 @@ -[parameters] - imported_from_ini = true diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services1-1.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services1-1.php deleted file mode 100644 index f157711..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services1-1.php +++ /dev/null @@ -1,30 +0,0 @@ -parameters = $this->getDefaultParameters(); - - $this->services = - $this->scopedServices = - $this->scopeStacks = array(); - $this->scopes = array(); - $this->scopeChildren = array(); - $this->methodMap = array( - 'test' => 'getTestService', - ); - - $this->aliases = array(); - } - - /** - * {@inheritdoc} - */ - public function compile() - { - throw new LogicException('You cannot compile a dumped frozen container.'); - } - - /** - * Gets the 'test' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getTestService() - { - return $this->services['test'] = new \stdClass(array('only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end')); - } - - /** - * {@inheritdoc} - */ - public function getParameter($name) - { - $name = strtolower($name); - - if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) { - throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name)); - } - - return $this->parameters[$name]; - } - - /** - * {@inheritdoc} - */ - public function hasParameter($name) - { - $name = strtolower($name); - - return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters); - } - - /** - * {@inheritdoc} - */ - public function setParameter($name, $value) - { - throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); - } - - /** - * {@inheritdoc} - */ - public function getParameterBag() - { - if (null === $this->parameterBag) { - $this->parameterBag = new FrozenParameterBag($this->parameters); - } - - return $this->parameterBag; - } - - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'empty_value' => '', - 'some_string' => '-', - ); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services12.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services12.php deleted file mode 100644 index a53f3a3..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services12.php +++ /dev/null @@ -1,124 +0,0 @@ -targetDirs[$i] = $dir = dirname($dir); - } - $this->parameters = $this->getDefaultParameters(); - - $this->services = - $this->scopedServices = - $this->scopeStacks = array(); - $this->scopes = array(); - $this->scopeChildren = array(); - $this->methodMap = array( - 'test' => 'getTestService', - ); - - $this->aliases = array(); - } - - /** - * {@inheritdoc} - */ - public function compile() - { - throw new LogicException('You cannot compile a dumped frozen container.'); - } - - /** - * Gets the 'test' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getTestService() - { - return $this->services['test'] = new \stdClass(('wiz'.$this->targetDirs[1]), array(('wiz'.$this->targetDirs[1]) => ($this->targetDirs[2].'/'))); - } - - /** - * {@inheritdoc} - */ - public function getParameter($name) - { - $name = strtolower($name); - - if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) { - throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name)); - } - - return $this->parameters[$name]; - } - - /** - * {@inheritdoc} - */ - public function hasParameter($name) - { - $name = strtolower($name); - - return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters); - } - - /** - * {@inheritdoc} - */ - public function setParameter($name, $value) - { - throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); - } - - /** - * {@inheritdoc} - */ - public function getParameterBag() - { - if (null === $this->parameterBag) { - $this->parameterBag = new FrozenParameterBag($this->parameters); - } - - return $this->parameterBag; - } - - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'foo' => ('wiz'.$this->targetDirs[1]), - 'bar' => __DIR__, - 'baz' => (__DIR__.'/PhpDumperTest.php'), - 'buz' => $this->targetDirs[2], - ); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php deleted file mode 100644 index 455600d..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php +++ /dev/null @@ -1,63 +0,0 @@ -methodMap = array( - 'service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService', - 'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService', - ); - } - - /** - * Gets the 'service_from_anonymous_factory' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getServiceFromAnonymousFactoryService() - { - return $this->services['service_from_anonymous_factory'] = call_user_func(array(new \Bar\FooClass(), 'getInstance')); - } - - /** - * Gets the 'service_with_method_call_and_factory' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getServiceWithMethodCallAndFactoryService() - { - $this->services['service_with_method_call_and_factory'] = $instance = new \Bar\FooClass(); - - $instance->setBar(\Bar\FooClass::getInstance()); - - return $instance; - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services20.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services20.php deleted file mode 100644 index 83f6dc7..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services20.php +++ /dev/null @@ -1,73 +0,0 @@ -methodMap = array( - 'depends_on_request' => 'getDependsOnRequestService', - 'request' => 'getRequestService', - ); - } - - /** - * Gets the 'depends_on_request' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getDependsOnRequestService() - { - $this->services['depends_on_request'] = $instance = new \stdClass(); - - $instance->setRequest($this->get('request', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - - return $instance; - } - - /** - * Gets the 'request' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Request A Request instance. - */ - protected function getRequestService() - { - return $this->services['request'] = new \Request(); - } - - /** - * Updates the 'request' service. - */ - protected function synchronizeRequestService() - { - if ($this->initialized('depends_on_request')) { - $this->get('depends_on_request')->setRequest($this->get('request', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services8.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services8.php deleted file mode 100644 index c2c52fe..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services8.php +++ /dev/null @@ -1,54 +0,0 @@ -getDefaultParameters())); - } - - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'foo' => '%baz%', - 'baz' => 'bar', - 'bar' => 'foo is %%foo bar', - 'escape' => '@escapeme', - 'values' => array( - 0 => true, - 1 => false, - 2 => NULL, - 3 => 0, - 4 => 1000.3, - 5 => 'true', - 6 => 'false', - 7 => 'null', - ), - ); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services9.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services9.php deleted file mode 100644 index 5977c1c..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services9.php +++ /dev/null @@ -1,376 +0,0 @@ -getDefaultParameters())); - $this->methodMap = array( - 'bar' => 'getBarService', - 'baz' => 'getBazService', - 'configurator_service' => 'getConfiguratorServiceService', - 'configured_service' => 'getConfiguredServiceService', - 'decorated' => 'getDecoratedService', - 'decorator_service' => 'getDecoratorServiceService', - 'decorator_service_with_name' => 'getDecoratorServiceWithNameService', - 'factory_service' => 'getFactoryServiceService', - 'foo' => 'getFooService', - 'foo.baz' => 'getFoo_BazService', - 'foo_bar' => 'getFooBarService', - 'foo_with_inline' => 'getFooWithInlineService', - 'inlined' => 'getInlinedService', - 'method_call1' => 'getMethodCall1Service', - 'new_factory' => 'getNewFactoryService', - 'new_factory_service' => 'getNewFactoryServiceService', - 'request' => 'getRequestService', - 'service_from_static_method' => 'getServiceFromStaticMethodService', - ); - $this->aliases = array( - 'alias_for_alias' => 'foo', - 'alias_for_foo' => 'foo', - ); - } - - /** - * Gets the 'bar' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getBarService() - { - $a = $this->get('foo.baz'); - - $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar')); - - $a->configure($instance); - - return $instance; - } - - /** - * Gets the 'baz' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Baz A Baz instance. - */ - protected function getBazService() - { - $this->services['baz'] = $instance = new \Baz(); - - $instance->setFoo($this->get('foo_with_inline')); - - return $instance; - } - - /** - * Gets the 'configured_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getConfiguredServiceService() - { - $this->services['configured_service'] = $instance = new \stdClass(); - - $this->get('configurator_service')->configureStdClass($instance); - - return $instance; - } - - /** - * Gets the 'decorated' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getDecoratedService() - { - return $this->services['decorated'] = new \stdClass(); - } - - /** - * Gets the 'decorator_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getDecoratorServiceService() - { - return $this->services['decorator_service'] = new \stdClass(); - } - - /** - * Gets the 'decorator_service_with_name' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getDecoratorServiceWithNameService() - { - return $this->services['decorator_service_with_name'] = new \stdClass(); - } - - /** - * Gets the 'factory_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar A Bar instance. - */ - protected function getFactoryServiceService() - { - return $this->services['factory_service'] = $this->get('foo.baz')->getInstance(); - } - - /** - * Gets the 'foo' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getFooService() - { - $a = $this->get('foo.baz'); - - $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo')), true, $this); - - $instance->setBar($this->get('bar')); - $instance->initialize(); - $instance->foo = 'bar'; - $instance->moo = $a; - $instance->qux = array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo')); - sc_configure($instance); - - return $instance; - } - - /** - * Gets the 'foo.baz' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return object A %baz_class% instance. - */ - protected function getFoo_BazService() - { - $this->services['foo.baz'] = $instance = call_user_func(array($this->getParameter('baz_class'), 'getInstance')); - - call_user_func(array($this->getParameter('baz_class'), 'configureStatic1'), $instance); - - return $instance; - } - - /** - * Gets the 'foo_bar' service. - * - * @return object A %foo_class% instance. - */ - protected function getFooBarService() - { - $class = $this->getParameter('foo_class'); - - return new $class(); - } - - /** - * Gets the 'foo_with_inline' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Foo A Foo instance. - */ - protected function getFooWithInlineService() - { - $this->services['foo_with_inline'] = $instance = new \Foo(); - - $instance->setBar($this->get('inlined')); - - return $instance; - } - - /** - * Gets the 'method_call1' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getMethodCall1Service() - { - require_once '%path%foo.php'; - - $this->services['method_call1'] = $instance = new \Bar\FooClass(); - - $instance->setBar($this->get('foo')); - $instance->setBar($this->get('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - if ($this->has('foo3')) { - $instance->setBar($this->get('foo3', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - if ($this->has('foobaz')) { - $instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE)); - } - $instance->setBar(($this->get("foo")->foo() . (($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default")))); - - return $instance; - } - - /** - * Gets the 'new_factory_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \FooBarBaz A FooBarBaz instance. - */ - protected function getNewFactoryServiceService() - { - $this->services['new_factory_service'] = $instance = $this->get('new_factory')->getInstance(); - - $instance->foo = 'bar'; - - return $instance; - } - - /** - * Gets the 'request' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @throws RuntimeException always since this service is expected to be injected dynamically - */ - protected function getRequestService() - { - throw new RuntimeException('You have requested a synthetic service ("request"). The DIC does not know how to construct this service.'); - } - - /** - * Gets the 'service_from_static_method' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getServiceFromStaticMethodService() - { - return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance(); - } - - /** - * Gets the 'configurator_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * This service is private. - * If you want to be able to request this service from the container directly, - * make it public, otherwise you might end up with broken code. - * - * @return \ConfClass A ConfClass instance. - */ - protected function getConfiguratorServiceService() - { - $this->services['configurator_service'] = $instance = new \ConfClass(); - - $instance->setFoo($this->get('baz')); - - return $instance; - } - - /** - * Gets the 'inlined' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * This service is private. - * If you want to be able to request this service from the container directly, - * make it public, otherwise you might end up with broken code. - * - * @return \Bar A Bar instance. - */ - protected function getInlinedService() - { - $this->services['inlined'] = $instance = new \Bar(); - - $instance->setBaz($this->get('baz')); - $instance->pub = 'pub'; - - return $instance; - } - - /** - * Gets the 'new_factory' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * This service is private. - * If you want to be able to request this service from the container directly, - * make it public, otherwise you might end up with broken code. - * - * @return \FactoryClass A FactoryClass instance. - */ - protected function getNewFactoryService() - { - $this->services['new_factory'] = $instance = new \FactoryClass(); - - $instance->foo = 'bar'; - - return $instance; - } - - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'baz_class' => 'BazClass', - 'foo_class' => 'Bar\\FooClass', - 'foo' => 'bar', - ); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services9_compiled.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/services9_compiled.php deleted file mode 100644 index 8c1e71f..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/services9_compiled.php +++ /dev/null @@ -1,357 +0,0 @@ -parameters = $this->getDefaultParameters(); - - $this->services = - $this->scopedServices = - $this->scopeStacks = array(); - $this->scopes = array(); - $this->scopeChildren = array(); - $this->methodMap = array( - 'bar' => 'getBarService', - 'baz' => 'getBazService', - 'configured_service' => 'getConfiguredServiceService', - 'decorator_service' => 'getDecoratorServiceService', - 'decorator_service_with_name' => 'getDecoratorServiceWithNameService', - 'factory_service' => 'getFactoryServiceService', - 'foo' => 'getFooService', - 'foo.baz' => 'getFoo_BazService', - 'foo_bar' => 'getFooBarService', - 'foo_with_inline' => 'getFooWithInlineService', - 'method_call1' => 'getMethodCall1Service', - 'new_factory_service' => 'getNewFactoryServiceService', - 'request' => 'getRequestService', - 'service_from_static_method' => 'getServiceFromStaticMethodService', - ); - $this->aliases = array( - 'alias_for_alias' => 'foo', - 'alias_for_foo' => 'foo', - 'decorated' => 'decorator_service_with_name', - ); - } - - /** - * {@inheritdoc} - */ - public function compile() - { - throw new LogicException('You cannot compile a dumped frozen container.'); - } - - /** - * Gets the 'bar' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getBarService() - { - $a = $this->get('foo.baz'); - - $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar')); - - $a->configure($instance); - - return $instance; - } - - /** - * Gets the 'baz' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Baz A Baz instance. - */ - protected function getBazService() - { - $this->services['baz'] = $instance = new \Baz(); - - $instance->setFoo($this->get('foo_with_inline')); - - return $instance; - } - - /** - * Gets the 'configured_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getConfiguredServiceService() - { - $a = new \ConfClass(); - $a->setFoo($this->get('baz')); - - $this->services['configured_service'] = $instance = new \stdClass(); - - $a->configureStdClass($instance); - - return $instance; - } - - /** - * Gets the 'decorator_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getDecoratorServiceService() - { - return $this->services['decorator_service'] = new \stdClass(); - } - - /** - * Gets the 'decorator_service_with_name' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \stdClass A stdClass instance. - */ - protected function getDecoratorServiceWithNameService() - { - return $this->services['decorator_service_with_name'] = new \stdClass(); - } - - /** - * Gets the 'factory_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar A Bar instance. - */ - protected function getFactoryServiceService() - { - return $this->services['factory_service'] = $this->get('foo.baz')->getInstance(); - } - - /** - * Gets the 'foo' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getFooService() - { - $a = $this->get('foo.baz'); - - $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this); - - $instance->setBar($this->get('bar')); - $instance->initialize(); - $instance->foo = 'bar'; - $instance->moo = $a; - $instance->qux = array('bar' => 'foo is bar', 'foobar' => 'bar'); - sc_configure($instance); - - return $instance; - } - - /** - * Gets the 'foo.baz' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \BazClass A BazClass instance. - */ - protected function getFoo_BazService() - { - $this->services['foo.baz'] = $instance = \BazClass::getInstance(); - - \BazClass::configureStatic1($instance); - - return $instance; - } - - /** - * Gets the 'foo_bar' service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getFooBarService() - { - return new \Bar\FooClass(); - } - - /** - * Gets the 'foo_with_inline' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Foo A Foo instance. - */ - protected function getFooWithInlineService() - { - $a = new \Bar(); - - $this->services['foo_with_inline'] = $instance = new \Foo(); - - $a->setBaz($this->get('baz')); - $a->pub = 'pub'; - - $instance->setBar($a); - - return $instance; - } - - /** - * Gets the 'method_call1' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getMethodCall1Service() - { - require_once '%path%foo.php'; - - $this->services['method_call1'] = $instance = new \Bar\FooClass(); - - $instance->setBar($this->get('foo')); - $instance->setBar(NULL); - $instance->setBar(($this->get("foo")->foo() . (($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default")))); - - return $instance; - } - - /** - * Gets the 'new_factory_service' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \FooBarBaz A FooBarBaz instance. - */ - protected function getNewFactoryServiceService() - { - $a = new \FactoryClass(); - $a->foo = 'bar'; - - $this->services['new_factory_service'] = $instance = $a->getInstance(); - - $instance->foo = 'bar'; - - return $instance; - } - - /** - * Gets the 'request' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @throws RuntimeException always since this service is expected to be injected dynamically - */ - protected function getRequestService() - { - throw new RuntimeException('You have requested a synthetic service ("request"). The DIC does not know how to construct this service.'); - } - - /** - * Gets the 'service_from_static_method' service. - * - * This service is shared. - * This method always returns the same instance of the service. - * - * @return \Bar\FooClass A Bar\FooClass instance. - */ - protected function getServiceFromStaticMethodService() - { - return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance(); - } - - /** - * {@inheritdoc} - */ - public function getParameter($name) - { - $name = strtolower($name); - - if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) { - throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name)); - } - - return $this->parameters[$name]; - } - - /** - * {@inheritdoc} - */ - public function hasParameter($name) - { - $name = strtolower($name); - - return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters); - } - - /** - * {@inheritdoc} - */ - public function setParameter($name, $value) - { - throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); - } - - /** - * {@inheritdoc} - */ - public function getParameterBag() - { - if (null === $this->parameterBag) { - $this->parameterBag = new FrozenParameterBag($this->parameters); - } - - return $this->parameterBag; - } - - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() - { - return array( - 'baz_class' => 'BazClass', - 'foo_class' => 'Bar\\FooClass', - 'foo' => 'bar', - ); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/php/simple.php b/vendor/symfony/dependency-injection/Tests/Fixtures/php/simple.php deleted file mode 100644 index aa4df99..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/php/simple.php +++ /dev/null @@ -1,3 +0,0 @@ -setParameter('foo', 'foo'); diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension1/services.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension1/services.xml deleted file mode 100644 index 52df38d..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension1/services.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension2/services.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension2/services.xml deleted file mode 100644 index 21a7ef5..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extension2/services.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services1.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services1.xml deleted file mode 100644 index 792fa07..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services1.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - BAR - - - - - - - - - %project.parameter.foo% - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services2.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services2.xml deleted file mode 100644 index 67d462b..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services2.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - BAR - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services3.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services3.xml deleted file mode 100644 index c23f02a..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services3.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - BAR - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services4.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services4.xml deleted file mode 100644 index 2c33c3a..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services4.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services5.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services5.xml deleted file mode 100644 index 0eaaff2..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services5.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services6.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services6.xml deleted file mode 100644 index a9c0103..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services6.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services7.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services7.xml deleted file mode 100644 index e77780d..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/extensions/services7.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/legacy-services6.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/legacy-services6.xml deleted file mode 100644 index 708e10f..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/legacy-services6.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/legacy-services9.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/legacy-services9.xml deleted file mode 100644 index 5692ba1..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/legacy-services9.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - BazClass - bar - - - - - - foo - - - foo is %foo% - %foo% - - true - - bar - - - foo is %foo% - %foo% - - - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/namespaces.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/namespaces.xml deleted file mode 100644 index 5a05ced..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/namespaces.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - foo - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/nonvalid.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/nonvalid.xml deleted file mode 100644 index e7b5bc9..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/nonvalid.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services1.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services1.xml deleted file mode 100644 index 6aa5732..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services1.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services10.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services10.xml deleted file mode 100644 index a4da1bf..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services10.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services13.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services13.xml deleted file mode 100644 index 1ac4938..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services13.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - true - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services14.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services14.xml deleted file mode 100644 index 7344621..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services14.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - app - - - - - - app - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services2.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services2.xml deleted file mode 100644 index f1ac14d..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services2.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - a string - bar - - 0 - 4 - null - true - true - false - on - off - 1.3 - 1000.3 - a string - - foo - bar - - - - value - - PHP_EOL - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services20.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services20.xml deleted file mode 100644 index 5d799fc..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services20.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services21.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services21.xml deleted file mode 100644 index 329bc3d..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services21.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services3.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services3.xml deleted file mode 100644 index 87bf183..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - foo - - true - false - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services4.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services4.xml deleted file mode 100644 index 03ad9f8..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services4_bad_import.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services4_bad_import.xml deleted file mode 100644 index 0b7f10a..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services4_bad_import.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services5.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services5.xml deleted file mode 100644 index acb93e7..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services5.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services6.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services6.xml deleted file mode 100644 index 9eb7b89..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services6.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - %path%/foo.php - - - foo - - - true - false - - - - - - - - - - - - - - - service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default") - - - - - foo - - - true - false - - - - - - - - - - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services7.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services7.xml deleted file mode 100644 index 824d8b5..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services7.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services8.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services8.xml deleted file mode 100644 index b17e500..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services8.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - %baz% - bar - foo is %%foo bar - @escapeme - - true - false - null - 0 - 1000.3 - true - false - null - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services9.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services9.xml deleted file mode 100644 index c4ddc41..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/services9.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - BazClass - Bar\FooClass - bar - - - - - - foo - - - foo is %foo% - %foo% - - true - - bar - - - foo is %foo% - %foo% - - - - - - - - - - - - - - foo - - %foo_bar% - - - - - %path%foo.php - - - - - - - - - - - - - - service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default") - - - - - - - - - pub - - - - - - - - - - - - - - - - - - - - - - - bar - - - - - - bar - - - - - - - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/withdoctype.xml b/vendor/symfony/dependency-injection/Tests/Fixtures/xml/withdoctype.xml deleted file mode 100644 index f217d5b..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/xml/withdoctype.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_calls.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_calls.yml deleted file mode 100644 index 3f34b07..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_calls.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: - method_call1: - class: FooClass - calls: foo diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_format.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_format.yml deleted file mode 100644 index 1f58cac..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_format.yml +++ /dev/null @@ -1,2 +0,0 @@ -parameters: - FOO: bar diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_import.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_import.yml deleted file mode 100644 index 0765dc8..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_import.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - foo.yml diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_imports.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_imports.yml deleted file mode 100644 index 1ce9d57..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_imports.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - foo:bar diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_parameters.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_parameters.yml deleted file mode 100644 index bbd13ac..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_parameters.yml +++ /dev/null @@ -1,2 +0,0 @@ -parameters: - foo:bar diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_service.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_service.yml deleted file mode 100644 index 811af3c..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_service.yml +++ /dev/null @@ -1,2 +0,0 @@ -services: - foo: bar diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_services.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_services.yml deleted file mode 100644 index cfbf17c..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/bad_services.yml +++ /dev/null @@ -1 +0,0 @@ -services: foo diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag1.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag1.yml deleted file mode 100644 index 14536fd..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag1.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - foo_service: - class: FooClass - # tags is not an array - tags: string diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag2.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag2.yml deleted file mode 100644 index 9028814..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag2.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - foo_service: - class: FooClass - tags: - # tag is missing the name key - foo_tag: { foo: bar } diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag3.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag3.yml deleted file mode 100644 index 72ec4e8..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag3.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - foo_service: - class: FooClass - tags: - # tag-attribute is not a scalar - - { name: foo, bar: { foo: foo, bar: bar } } diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag4.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag4.yml deleted file mode 100644 index e8e9939..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/badtag4.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - foo_service: - class: FooClass - tags: - # tag is not an array - - foo diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/legacy-services6.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/legacy-services6.yml deleted file mode 100644 index 46ac679..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/legacy-services6.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - constructor: { class: FooClass, factory_method: getInstance } - factory_service: { class: BazClass, factory_method: getInstance, factory_service: baz_factory } - request: - class: Request - synthetic: true - synchronized: true - lazy: true diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/legacy-services9.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/legacy-services9.yml deleted file mode 100644 index 64d1726..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/legacy-services9.yml +++ /dev/null @@ -1,28 +0,0 @@ -parameters: - baz_class: BazClass - foo: bar - -services: - foo: - class: Bar\FooClass - tags: - - { name: foo, foo: foo } - - { name: foo, bar: bar } - factory_class: Bar\FooClass - factory_method: getInstance - arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container'] - properties: { foo: bar, moo: '@foo.baz', qux: { '%foo%': 'foo is %foo%', foobar: '%foo%' } } - calls: - - [setBar, ['@bar']] - - [initialize, { }] - - configurator: sc_configure - foo.baz: - class: %baz_class% - factory_class: %baz_class% - factory_method: getInstance - configurator: ['%baz_class%', configureStatic1] - factory_service: - class: Bar - factory_method: getInstance - factory_service: foo.baz diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/nonvalid1.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/nonvalid1.yml deleted file mode 100644 index 4eddb87..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/nonvalid1.yml +++ /dev/null @@ -1,2 +0,0 @@ -foo: - bar diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/nonvalid2.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/nonvalid2.yml deleted file mode 100644 index c508d53..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/nonvalid2.yml +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services1.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services1.yml deleted file mode 100644 index 8b13789..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services1.yml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services10.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services10.yml deleted file mode 100644 index f2f8d95..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services10.yml +++ /dev/null @@ -1,9 +0,0 @@ -parameters: - project.parameter.foo: BAR - -services: - project.service.foo: - class: BAR - -project: - test: %project.parameter.foo% diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services11.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services11.yml deleted file mode 100644 index 40126f0..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services11.yml +++ /dev/null @@ -1 +0,0 @@ -foobarfoobar: {} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services13.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services13.yml deleted file mode 100644 index d52d355..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services13.yml +++ /dev/null @@ -1,3 +0,0 @@ -# used to test imports in XML -parameters: - imported_from_yaml: true diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services14.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services14.yml deleted file mode 100644 index 4c188c5..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services14.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - factory: { class: FooBarClass, factory: baz:getClass} - factory_with_static_call: { class: FooBarClass, factory: FooBacFactory::createFooBar} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services2.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services2.yml deleted file mode 100644 index 3c12746..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services2.yml +++ /dev/null @@ -1,12 +0,0 @@ -parameters: - FOO: bar - values: - - true - - false - - 0 - - 1000.3 - bar: foo - escape: @@escapeme - foo_bar: @foo_bar - MixedCase: - MixedCaseKey: value diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services20.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services20.yml deleted file mode 100644 index 847f656..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services20.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - request: - class: Request - synthetic: true - synchronized: true - depends_on_request: - class: stdClass - calls: - - [setRequest, ['@?request']] diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services21.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services21.yml deleted file mode 100644 index da717a8..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services21.yml +++ /dev/null @@ -1,15 +0,0 @@ -services: - manager: - class: UserManager - arguments: - - true - calls: - - method: setLogger - arguments: - - @logger - - method: setClass - arguments: - - User - tags: - - name: manager - alias: user diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services3.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services3.yml deleted file mode 100644 index 0e92cdf..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services3.yml +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - foo: foo - values: - - true - - false diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services4.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services4.yml deleted file mode 100644 index 8e0987f..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services4.yml +++ /dev/null @@ -1,7 +0,0 @@ -imports: - - { resource: services2.yml } - - { resource: services3.yml } - - { resource: "../php/simple.php" } - - { resource: "../ini/parameters.ini", class: Symfony\Component\DependencyInjection\Loader\IniFileLoader } - - { resource: "../ini/parameters2.ini" } - - { resource: "../xml/services13.xml" } diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services4_bad_import.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services4_bad_import.yml deleted file mode 100644 index f7089fc..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services4_bad_import.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: foo_fake.yml, ignore_errors: true } diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services6.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services6.yml deleted file mode 100644 index 78abf4d..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services6.yml +++ /dev/null @@ -1,33 +0,0 @@ -services: - foo: { class: FooClass } - baz: { class: BazClass } - scope.container: { class: FooClass, scope: container } - scope.custom: { class: FooClass, scope: custom } - scope.prototype: { class: FooClass, scope: prototype } - file: { class: FooClass, file: %path%/foo.php } - arguments: { class: FooClass, arguments: [foo, @foo, [true, false]] } - configurator1: { class: FooClass, configurator: sc_configure } - configurator2: { class: FooClass, configurator: [@baz, configure] } - configurator3: { class: FooClass, configurator: [BazClass, configureStatic] } - method_call1: - class: FooClass - calls: - - [ setBar, [] ] - - [ setBar ] - - [ setBar, ['@=service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")'] ] - method_call2: - class: FooClass - calls: - - [ setBar, [ foo, @foo, [true, false] ] ] - alias_for_foo: @foo - another_alias_for_foo: - alias: foo - public: false - decorator_service: - decorates: decorated - decorator_service_with_name: - decorates: decorated - decoration_inner_name: decorated.pif-pouf - new_factory1: { class: FooBarClass, factory: factory} - new_factory2: { class: FooBarClass, factory: [@baz, getClass]} - new_factory3: { class: FooBarClass, factory: [BazClass, getInstance]} diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services7.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services7.yml deleted file mode 100644 index 09064f2..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services7.yml +++ /dev/null @@ -1,2 +0,0 @@ -services: - foo: { class: BarClass } diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services8.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services8.yml deleted file mode 100644 index a1fb590..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services8.yml +++ /dev/null @@ -1,7 +0,0 @@ -parameters: - foo: '%baz%' - baz: bar - bar: 'foo is %%foo bar' - escape: '@@escapeme' - values: [true, false, null, 0, 1000.3, 'true', 'false', 'null'] - diff --git a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services9.yml b/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services9.yml deleted file mode 100644 index fdab85f..0000000 --- a/vendor/symfony/dependency-injection/Tests/Fixtures/yaml/services9.yml +++ /dev/null @@ -1,94 +0,0 @@ -parameters: - baz_class: BazClass - foo_class: Bar\FooClass - foo: bar - -services: - foo: - class: Bar\FooClass - tags: - - { name: foo, foo: foo } - - { name: foo, bar: bar, baz: baz } - arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container'] - properties: { foo: bar, moo: '@foo.baz', qux: { '%foo%': 'foo is %foo%', foobar: '%foo%' } } - calls: - - [setBar, ['@bar']] - - [initialize, { }] - - factory: [Bar\FooClass, getInstance] - configurator: sc_configure - foo.baz: - class: %baz_class% - factory: ['%baz_class%', getInstance] - configurator: ['%baz_class%', configureStatic1] - bar: - class: Bar\FooClass - arguments: [foo, '@foo.baz', '%foo_bar%'] - configurator: ['@foo.baz', configure] - foo_bar: - class: %foo_class% - scope: prototype - method_call1: - class: Bar\FooClass - file: %path%foo.php - calls: - - [setBar, ['@foo']] - - [setBar, ['@?foo2']] - - [setBar, ['@?foo3']] - - [setBar, ['@?foobaz']] - - [setBar, ['@=service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")']] - - foo_with_inline: - class: Foo - calls: - - [setBar, ['@inlined']] - - inlined: - class: Bar - public: false - properties: { pub: pub } - calls: - - [setBaz, ['@baz']] - - baz: - class: Baz - calls: - - [setFoo, ['@foo_with_inline']] - - request: - class: Request - synthetic: true - configurator_service: - class: ConfClass - public: false - calls: - - [setFoo, ['@baz']] - - configured_service: - class: stdClass - configurator: ['@configurator_service', configureStdClass] - decorated: - class: stdClass - decorator_service: - class: stdClass - decorates: decorated - decorator_service_with_name: - class: stdClass - decorates: decorated - decoration_inner_name: decorated.pif-pouf - new_factory: - class: FactoryClass - public: false - properties: { foo: bar } - factory_service: - class: Bar - factory: ['@foo.baz', getInstance] - new_factory_service: - class: FooBarBaz - properties: { foo: bar } - factory: ['@new_factory', getInstance] - service_from_static_method: - class: Bar\FooClass - factory: [Bar\FooClass, getInstance] - alias_for_foo: @foo - alias_for_alias: @foo diff --git a/vendor/symfony/dependency-injection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php b/vendor/symfony/dependency-injection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php deleted file mode 100644 index cb44024..0000000 --- a/vendor/symfony/dependency-injection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\LazyProxy\Instantiator; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator; - -/** - * Tests for {@see \Symfony\Component\DependencyInjection\Instantiator\RealServiceInstantiator}. - * - * @author Marco Pivetta - * - * @covers \Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator - */ -class RealServiceInstantiatorTest extends \PHPUnit_Framework_TestCase -{ - public function testInstantiateProxy() - { - $instantiator = new RealServiceInstantiator(); - $instance = new \stdClass(); - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $callback = function () use ($instance) { - return $instance; - }; - - $this->assertSame($instance, $instantiator->instantiateProxy($container, new Definition(), 'foo', $callback)); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/LazyProxy/PhpDumper/NullDumperTest.php b/vendor/symfony/dependency-injection/Tests/LazyProxy/PhpDumper/NullDumperTest.php deleted file mode 100644 index 2081ebc..0000000 --- a/vendor/symfony/dependency-injection/Tests/LazyProxy/PhpDumper/NullDumperTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\LazyProxy\PhpDumper; - -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper; - -/** - * Tests for {@see \Symfony\Component\DependencyInjection\PhpDumper\NullDumper}. - * - * @author Marco Pivetta - * - * @covers \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper - */ -class NullDumperTest extends \PHPUnit_Framework_TestCase -{ - public function testNullDumper() - { - $dumper = new NullDumper(); - $definition = new Definition('stdClass'); - - $this->assertFalse($dumper->isProxyCandidate($definition)); - $this->assertSame('', $dumper->getProxyFactoryCode($definition, 'foo')); - $this->assertSame('', $dumper->getProxyCode($definition)); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php b/vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php deleted file mode 100644 index 40aec20..0000000 --- a/vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * @group legacy - */ -class LegacyContainerBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceFactoryMethod() - { - $builder = new ContainerBuilder(); - $builder->register('bar', 'stdClass'); - $builder->register('foo1', 'Bar\FooClass')->setFactoryClass('Bar\FooClass')->setFactoryMethod('getInstance')->addArgument(array('foo' => '%value%', '%value%' => 'foo', new Reference('bar'))); - $builder->setParameter('value', 'bar'); - $this->assertTrue($builder->get('foo1')->called, '->createService() calls the factory method to create the service instance'); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar')), $builder->get('foo1')->arguments, '->createService() passes the arguments to the factory method'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService - */ - public function testCreateServiceFactoryService() - { - $builder = new ContainerBuilder(); - $builder->register('baz_service')->setFactoryService('baz_factory')->setFactoryMethod('getInstance'); - $builder->register('baz_factory', 'BazClass'); - - $this->assertInstanceOf('BazClass', $builder->get('baz_service')); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/LegacyDefinitionTest.php b/vendor/symfony/dependency-injection/Tests/LegacyDefinitionTest.php deleted file mode 100644 index 07891ff..0000000 --- a/vendor/symfony/dependency-injection/Tests/LegacyDefinitionTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Definition; - -/** - * @group legacy - */ -class LegacyDefinitionTest extends \PHPUnit_Framework_TestCase -{ - public function testSetGetFactoryClass() - { - $def = new Definition('stdClass'); - $this->assertNull($def->getFactoryClass()); - $this->assertSame($def, $def->setFactoryClass('stdClass2'), '->setFactoryClass() implements a fluent interface.'); - $this->assertEquals('stdClass2', $def->getFactoryClass(), '->getFactoryClass() returns current class to construct this service.'); - } - - public function testSetGetFactoryMethod() - { - $def = new Definition('stdClass'); - $this->assertNull($def->getFactoryMethod()); - $this->assertSame($def, $def->setFactoryMethod('foo'), '->setFactoryMethod() implements a fluent interface'); - $this->assertEquals('foo', $def->getFactoryMethod(), '->getFactoryMethod() returns the factory method name'); - } - - public function testSetGetFactoryService() - { - $def = new Definition('stdClass'); - $this->assertNull($def->getFactoryService()); - $this->assertSame($def, $def->setFactoryService('foo.bar'), '->setFactoryService() implements a fluent interface.'); - $this->assertEquals('foo.bar', $def->getFactoryService(), '->getFactoryService() returns current service to construct this service.'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Loader/ClosureLoaderTest.php b/vendor/symfony/dependency-injection/Tests/Loader/ClosureLoaderTest.php deleted file mode 100644 index 483e30b..0000000 --- a/vendor/symfony/dependency-injection/Tests/Loader/ClosureLoaderTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\ClosureLoader; - -class ClosureLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::supports - */ - public function testSupports() - { - $loader = new ClosureLoader(new ContainerBuilder()); - - $this->assertTrue($loader->supports(function ($container) {}), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::load - */ - public function testLoad() - { - $loader = new ClosureLoader($container = new ContainerBuilder()); - - $loader->load(function ($container) { - $container->setParameter('foo', 'foo'); - }); - - $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a \Closure resource'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Loader/IniFileLoaderTest.php b/vendor/symfony/dependency-injection/Tests/Loader/IniFileLoaderTest.php deleted file mode 100644 index 9188018..0000000 --- a/vendor/symfony/dependency-injection/Tests/Loader/IniFileLoaderTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\Config\FileLocator; - -class IniFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - protected $container; - protected $loader; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - } - - protected function setUp() - { - $this->container = new ContainerBuilder(); - $this->loader = new IniFileLoader($this->container, new FileLocator(self::$fixturesPath.'/ini')); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load - */ - public function testIniFileCanBeLoaded() - { - $this->loader->load('parameters.ini'); - $this->assertEquals(array('foo' => 'bar', 'bar' => '%foo%'), $this->container->getParameterBag()->all(), '->load() takes a single file name as its first argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load - * - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The file "foo.ini" does not exist (in: - */ - public function testExceptionIsRaisedWhenIniFileDoesNotExist() - { - $this->loader->load('foo.ini'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load - * - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The "nonvalid.ini" file is not valid. - */ - public function testExceptionIsRaisedWhenIniFileCannotBeParsed() - { - @$this->loader->load('nonvalid.ini'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::supports - */ - public function testSupports() - { - $loader = new IniFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.ini'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Loader/PhpFileLoaderTest.php b/vendor/symfony/dependency-injection/Tests/Loader/PhpFileLoaderTest.php deleted file mode 100644 index 5ae097c..0000000 --- a/vendor/symfony/dependency-injection/Tests/Loader/PhpFileLoaderTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\Config\FileLocator; - -class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::supports - */ - public function testSupports() - { - $loader = new PhpFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.php'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load - */ - public function testLoad() - { - $loader = new PhpFileLoader($container = new ContainerBuilder(), new FileLocator()); - - $loader->load(__DIR__.'/../Fixtures/php/simple.php'); - - $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a PHP file resource'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php b/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php deleted file mode 100644 index 8bf524a..0000000 --- a/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php +++ /dev/null @@ -1,495 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\ExpressionLanguage\Expression; - -class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - require_once self::$fixturesPath.'/includes/foo.php'; - require_once self::$fixturesPath.'/includes/ProjectExtension.php'; - require_once self::$fixturesPath.'/includes/ProjectWithXsdExtension.php'; - } - - public function testLoad() - { - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); - - try { - $loader->load('foo.xml'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); - $this->assertStringStartsWith('The file "foo.xml" does not exist (in:', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); - } - } - - public function testParseFile() - { - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); - $r = new \ReflectionObject($loader); - $m = $r->getMethod('parseFileToDOM'); - $m->setAccessible(true); - - try { - $m->invoke($loader, self::$fixturesPath.'/ini/parameters.ini'); - $this->fail('->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - $this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'parameters.ini'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - - $e = $e->getPrevious(); - $this->assertInstanceOf('InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - $this->assertStringStartsWith('[ERROR 4] Start tag expected, \'<\' not found (in', $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - } - - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/xml')); - - try { - $m->invoke($loader, self::$fixturesPath.'/xml/nonvalid.xml'); - $this->fail('->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD'); - $this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'nonvalid.xml'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file'); - - $e = $e->getPrevious(); - $this->assertInstanceOf('InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD'); - $this->assertStringStartsWith('[ERROR 1845] Element \'nonvalid\': No matching global declaration available for the validation root. (in', $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD'); - } - - $xml = $m->invoke($loader, self::$fixturesPath.'/xml/services1.xml'); - $this->assertInstanceOf('DOMDocument', $xml, '->parseFileToDOM() returns an SimpleXMLElement object'); - } - - public function testLoadParameters() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services2.xml'); - - $actual = $container->getParameterBag()->all(); - $expected = array( - 'a string', - 'foo' => 'bar', - 'values' => array( - 0, - 'integer' => 4, - 100 => null, - 'true', - true, - false, - 'on', - 'off', - 'float' => 1.3, - 1000.3, - 'a string', - array('foo', 'bar'), - ), - 'mixedcase' => array('MixedCaseKey' => 'value'), - 'constant' => PHP_EOL, - ); - - $this->assertEquals($expected, $actual, '->load() converts XML values to PHP ones'); - } - - public function testLoadImports() - { - $container = new ContainerBuilder(); - $resolver = new LoaderResolver(array( - new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), - new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), - )); - $loader->setResolver($resolver); - $loader->load('services4.xml'); - - $actual = $container->getParameterBag()->all(); - $expected = array( - 'a string', - 'foo' => 'bar', - 'values' => array( - 0, - 'integer' => 4, - 100 => null, - 'true', - true, - false, - 'on', - 'off', - 'float' => 1.3, - 1000.3, - 'a string', - array('foo', 'bar'), - ), - 'mixedcase' => array('MixedCaseKey' => 'value'), - 'constant' => PHP_EOL, - 'bar' => '%foo%', - 'imported_from_ini' => true, - 'imported_from_yaml' => true, - ); - - $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); - - // Bad import throws no exception due to ignore_errors value. - $loader->load('services4_bad_import.xml'); - } - - public function testLoadAnonymousServices() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services5.xml'); - $services = $container->getDefinitions(); - $this->assertCount(4, $services, '->load() attributes unique ids to anonymous services'); - - // anonymous service as an argument - $args = $services['foo']->getArguments(); - $this->assertCount(1, $args, '->load() references anonymous services as "normal" ones'); - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Reference', $args[0], '->load() converts anonymous services to references to "normal" services'); - $this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones'); - $inner = $services[(string) $args[0]]; - $this->assertEquals('BarClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); - - // inner anonymous services - $args = $inner->getArguments(); - $this->assertCount(1, $args, '->load() references anonymous services as "normal" ones'); - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Reference', $args[0], '->load() converts anonymous services to references to "normal" services'); - $this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones'); - $inner = $services[(string) $args[0]]; - $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); - $this->assertFalse($inner->isPublic()); - - // anonymous service as a property - $properties = $services['foo']->getProperties(); - $property = $properties['p']; - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Reference', $property, '->load() converts anonymous services to references to "normal" services'); - $this->assertTrue(isset($services[(string) $property]), '->load() makes a reference to the created ones'); - $inner = $services[(string) $property]; - $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); - } - - /** - * @group legacy - */ - public function testLegacyLoadServices() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('legacy-services6.xml'); - $services = $container->getDefinitions(); - $this->assertEquals('FooClass', $services['constructor']->getClass()); - $this->assertEquals('getInstance', $services['constructor']->getFactoryMethod()); - $this->assertNull($services['factory_service']->getClass()); - $this->assertEquals('baz_factory', $services['factory_service']->getFactoryService()); - $this->assertEquals('getInstance', $services['factory_service']->getFactoryMethod()); - $this->assertTrue($services['request']->isSynthetic(), '->load() parses the synthetic flag'); - $this->assertTrue($services['request']->isSynchronized(), '->load() parses the synchronized flag'); - $this->assertTrue($services['request']->isLazy(), '->load() parses the lazy flag'); - $this->assertNull($services['request']->getDecoratedService()); - } - - public function testLoadServices() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services6.xml'); - $services = $container->getDefinitions(); - $this->assertTrue(isset($services['foo']), '->load() parses elements'); - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Definition', $services['foo'], '->load() converts element to Definition instances'); - $this->assertEquals('FooClass', $services['foo']->getClass(), '->load() parses the class attribute'); - $this->assertEquals('container', $services['scope.container']->getScope()); - $this->assertEquals('custom', $services['scope.custom']->getScope()); - $this->assertEquals('prototype', $services['scope.prototype']->getScope()); - $this->assertEquals('%path%/foo.php', $services['file']->getFile(), '->load() parses the file tag'); - $this->assertEquals(array('foo', new Reference('foo'), array(true, false)), $services['arguments']->getArguments(), '->load() parses the argument tags'); - $this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(new Reference('baz', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertEquals('factory', $services['new_factory1']->getFactory(), '->load() parses the factory tag'); - $this->assertEquals(array(new Reference('baz', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false), 'getClass'), $services['new_factory2']->getFactory(), '->load() parses the factory tag'); - $this->assertEquals(array('BazClass', 'getInstance'), $services['new_factory3']->getFactory(), '->load() parses the factory tag'); - - $aliases = $container->getAliases(); - $this->assertTrue(isset($aliases['alias_for_foo']), '->load() parses elements'); - $this->assertEquals('foo', (string) $aliases['alias_for_foo'], '->load() parses aliases'); - $this->assertTrue($aliases['alias_for_foo']->isPublic()); - $this->assertTrue(isset($aliases['another_alias_for_foo'])); - $this->assertEquals('foo', (string) $aliases['another_alias_for_foo']); - $this->assertFalse($aliases['another_alias_for_foo']->isPublic()); - - $this->assertEquals(array('decorated', null), $services['decorator_service']->getDecoratedService()); - $this->assertEquals(array('decorated', 'decorated.pif-pouf'), $services['decorator_service_with_name']->getDecoratedService()); - } - - public function testParsesTags() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services10.xml'); - - $services = $container->findTaggedServiceIds('foo_tag'); - $this->assertCount(1, $services); - - foreach ($services as $id => $tagAttributes) { - foreach ($tagAttributes as $attributes) { - $this->assertArrayHasKey('other_option', $attributes); - $this->assertEquals('lorem', $attributes['other_option']); - $this->assertArrayHasKey('other-option', $attributes, 'unnormalized tag attributes should not be removed'); - - $this->assertEquals('ciz', $attributes['some_option'], 'no overriding should be done when normalizing'); - $this->assertEquals('cat', $attributes['some-option']); - - $this->assertArrayNotHasKey('an_other_option', $attributes, 'normalization should not be done when an underscore is already found'); - } - } - } - - public function testConvertDomElementToArray() - { - $doc = new \DOMDocument('1.0'); - $doc->loadXML('bar'); - $this->assertEquals('bar', XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument('1.0'); - $doc->loadXML(''); - $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument('1.0'); - $doc->loadXML('bar'); - $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument('1.0'); - $doc->loadXML('barbar'); - $this->assertEquals(array('foo' => array('value' => 'bar', 'foo' => 'bar')), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument('1.0'); - $doc->loadXML(''); - $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument('1.0'); - $doc->loadXML(''); - $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - - $doc = new \DOMDocument('1.0'); - $doc->loadXML(''); - $this->assertEquals(array('foo' => array(array('foo' => 'bar'), array('foo' => 'bar'))), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - } - - public function testExtensions() - { - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $container->registerExtension(new \ProjectWithXsdExtension()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - - // extension without an XSD - $loader->load('extensions/services1.xml'); - $container->compile(); - $services = $container->getDefinitions(); - $parameters = $container->getParameterBag()->all(); - - $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); - $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); - - $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); - $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); - - // extension with an XSD - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $container->registerExtension(new \ProjectWithXsdExtension()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('extensions/services2.xml'); - $container->compile(); - $services = $container->getDefinitions(); - $parameters = $container->getParameterBag()->all(); - - $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); - $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); - - $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); - $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); - - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $container->registerExtension(new \ProjectWithXsdExtension()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - - // extension with an XSD (does not validate) - try { - $loader->load('extensions/services3.xml'); - $this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - $this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'services3.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - - $e = $e->getPrevious(); - $this->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - $this->assertContains('The attribute \'bar\' is not allowed', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } - - // non-registered extension - try { - $loader->load('extensions/services4.xml'); - $this->fail('->load() throws an InvalidArgumentException if the tag is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tag is not valid'); - $this->assertStringStartsWith('There is no extension able to load the configuration for "project:bar" (in', $e->getMessage(), '->load() throws an InvalidArgumentException if the tag is not valid'); - } - } - - public function testExtensionInPhar() - { - if (extension_loaded('suhosin') && false === strpos(ini_get('suhosin.executor.include.whitelist'), 'phar')) { - $this->markTestSkipped('To run this test, add "phar" to the "suhosin.executor.include.whitelist" settings in your php.ini file.'); - } - - require_once self::$fixturesPath.'/includes/ProjectWithXsdExtensionInPhar.phar'; - - // extension with an XSD in PHAR archive - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectWithXsdExtensionInPhar()); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('extensions/services6.xml'); - - // extension with an XSD in PHAR archive (does not validate) - try { - $loader->load('extensions/services7.xml'); - $this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - $this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'services7.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - - $e = $e->getPrevious(); - $this->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - $this->assertContains('The attribute \'bar\' is not allowed', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\XmlFileLoader::supports - */ - public function testSupports() - { - $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - public function testNoNamingConflictsForAnonymousServices() - { - $container = new ContainerBuilder(); - - $loader1 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension1')); - $loader1->load('services.xml'); - $services = $container->getDefinitions(); - $this->assertCount(2, $services, '->load() attributes unique ids to anonymous services'); - $loader2 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension2')); - $loader2->load('services.xml'); - $services = $container->getDefinitions(); - $this->assertCount(4, $services, '->load() attributes unique ids to anonymous services'); - - $services = $container->getDefinitions(); - $args1 = $services['extension1.foo']->getArguments(); - $inner1 = $services[(string) $args1[0]]; - $this->assertEquals('BarClass1', $inner1->getClass(), '->load() uses the same configuration as for the anonymous ones'); - $args2 = $services['extension2.foo']->getArguments(); - $inner2 = $services[(string) $args2[0]]; - $this->assertEquals('BarClass2', $inner2->getClass(), '->load() uses the same configuration as for the anonymous ones'); - } - - public function testDocTypeIsNotAllowed() - { - $container = new ContainerBuilder(); - - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - - // document types are not allowed. - try { - $loader->load('withdoctype.xml'); - $this->fail('->load() throws an InvalidArgumentException if the configuration contains a document type'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration contains a document type'); - $this->assertRegExp(sprintf('#^Unable to parse file ".+%s".$#', 'withdoctype.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration contains a document type'); - - $e = $e->getPrevious(); - $this->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration contains a document type'); - $this->assertSame('Document types are not allowed.', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration contains a document type'); - } - } - - public function testXmlNamespaces() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('namespaces.xml'); - $services = $container->getDefinitions(); - - $this->assertTrue(isset($services['foo']), '->load() parses elements'); - $this->assertEquals(1, count($services['foo']->getTag('foo.tag')), '->load parses elements'); - $this->assertEquals(array(array('setBar', array('foo'))), $services['foo']->getMethodCalls(), '->load() parses the tag'); - } - - public function testLoadIndexedArguments() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services14.xml'); - - $this->assertEquals(array('index_0' => 'app'), $container->findDefinition('logger')->getArguments()); - } - - public function testLoadInlinedServices() - { - $container = new ContainerBuilder(); - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services21.xml'); - - $foo = $container->getDefinition('foo'); - - $fooFactory = $foo->getFactory(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $fooFactory[0]); - $this->assertSame('FooFactory', $fooFactory[0]->getClass()); - $this->assertSame('createFoo', $fooFactory[1]); - - $fooFactoryFactory = $fooFactory[0]->getFactory(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $fooFactoryFactory[0]); - $this->assertSame('Foobar', $fooFactoryFactory[0]->getClass()); - $this->assertSame('createFooFactory', $fooFactoryFactory[1]); - - $fooConfigurator = $foo->getConfigurator(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $fooConfigurator[0]); - $this->assertSame('Bar', $fooConfigurator[0]->getClass()); - $this->assertSame('configureFoo', $fooConfigurator[1]); - - $barConfigurator = $fooConfigurator[0]->getConfigurator(); - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $barConfigurator[0]); - $this->assertSame('Baz', $barConfigurator[0]->getClass()); - $this->assertSame('configureBar', $barConfigurator[1]); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php b/vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php deleted file mode 100644 index c94f40b..0000000 --- a/vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php +++ /dev/null @@ -1,283 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\Loader; - -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\ExpressionLanguage\Expression; - -class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase -{ - protected static $fixturesPath; - - public static function setUpBeforeClass() - { - self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); - require_once self::$fixturesPath.'/includes/foo.php'; - require_once self::$fixturesPath.'/includes/ProjectExtension.php'; - } - - public function testLoadFile() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); - $r = new \ReflectionObject($loader); - $m = $r->getMethod('loadFile'); - $m->setAccessible(true); - - try { - $m->invoke($loader, 'foo.yml'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); - $this->assertEquals('The service file "foo.yml" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); - } - - try { - $m->invoke($loader, 'parameters.ini'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); - $this->assertEquals('The service file "parameters.ini" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); - } - - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - - foreach (array('nonvalid1', 'nonvalid2') as $fixture) { - try { - $m->invoke($loader, $fixture.'.yml'); - $this->fail('->load() throws an InvalidArgumentException if the loaded file does not validate'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not validate'); - $this->assertStringMatchesFormat('The service file "nonvalid%d.yml" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not validate'); - } - } - } - - /** - * @dataProvider provideInvalidFiles - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - */ - public function testLoadInvalidFile($file) - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - - $loader->load($file.'.yml'); - } - - public function provideInvalidFiles() - { - return array( - array('bad_parameters'), - array('bad_imports'), - array('bad_import'), - array('bad_services'), - array('bad_service'), - array('bad_calls'), - array('bad_format'), - ); - } - - public function testLoadParameters() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services2.yml'); - $this->assertEquals(array('foo' => 'bar', 'mixedcase' => array('MixedCaseKey' => 'value'), 'values' => array(true, false, 0, 1000.3), 'bar' => 'foo', 'escape' => '@escapeme', 'foo_bar' => new Reference('foo_bar')), $container->getParameterBag()->all(), '->load() converts YAML keys to lowercase'); - } - - public function testLoadImports() - { - $container = new ContainerBuilder(); - $resolver = new LoaderResolver(array( - new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), - new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), - new PhpFileLoader($container, new FileLocator(self::$fixturesPath.'/php')), - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), - )); - $loader->setResolver($resolver); - $loader->load('services4.yml'); - - $actual = $container->getParameterBag()->all(); - $expected = array('foo' => 'bar', 'values' => array(true, false), 'bar' => '%foo%', 'escape' => '@escapeme', 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'imported_from_ini' => true, 'imported_from_xml' => true); - $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); - - // Bad import throws no exception due to ignore_errors value. - $loader->load('services4_bad_import.yml'); - } - - /** - * @group legacy - */ - public function testLegacyLoadServices() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('legacy-services6.yml'); - $services = $container->getDefinitions(); - $this->assertEquals('FooClass', $services['constructor']->getClass()); - $this->assertEquals('getInstance', $services['constructor']->getFactoryMethod()); - $this->assertEquals('BazClass', $services['factory_service']->getClass()); - $this->assertEquals('baz_factory', $services['factory_service']->getFactoryService()); - $this->assertEquals('getInstance', $services['factory_service']->getFactoryMethod()); - $this->assertTrue($services['request']->isSynthetic(), '->load() parses the synthetic flag'); - $this->assertTrue($services['request']->isSynchronized(), '->load() parses the synchronized flag'); - $this->assertTrue($services['request']->isLazy(), '->load() parses the lazy flag'); - $this->assertNull($services['request']->getDecoratedService()); - } - - public function testLoadServices() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services6.yml'); - $services = $container->getDefinitions(); - $this->assertTrue(isset($services['foo']), '->load() parses service elements'); - $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Definition', $services['foo'], '->load() converts service element to Definition instances'); - $this->assertEquals('FooClass', $services['foo']->getClass(), '->load() parses the class attribute'); - $this->assertEquals('container', $services['scope.container']->getScope()); - $this->assertEquals('custom', $services['scope.custom']->getScope()); - $this->assertEquals('prototype', $services['scope.prototype']->getScope()); - $this->assertEquals('%path%/foo.php', $services['file']->getFile(), '->load() parses the file tag'); - $this->assertEquals(array('foo', new Reference('foo'), array(true, false)), $services['arguments']->getArguments(), '->load() parses the argument tags'); - $this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(new Reference('baz'), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag'); - $this->assertEquals(array(array('setBar', array()), array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag'); - $this->assertEquals('factory', $services['new_factory1']->getFactory(), '->load() parses the factory tag'); - $this->assertEquals(array(new Reference('baz'), 'getClass'), $services['new_factory2']->getFactory(), '->load() parses the factory tag'); - $this->assertEquals(array('BazClass', 'getInstance'), $services['new_factory3']->getFactory(), '->load() parses the factory tag'); - - $aliases = $container->getAliases(); - $this->assertTrue(isset($aliases['alias_for_foo']), '->load() parses aliases'); - $this->assertEquals('foo', (string) $aliases['alias_for_foo'], '->load() parses aliases'); - $this->assertTrue($aliases['alias_for_foo']->isPublic()); - $this->assertTrue(isset($aliases['another_alias_for_foo'])); - $this->assertEquals('foo', (string) $aliases['another_alias_for_foo']); - $this->assertFalse($aliases['another_alias_for_foo']->isPublic()); - - $this->assertEquals(array('decorated', null), $services['decorator_service']->getDecoratedService()); - $this->assertEquals(array('decorated', 'decorated.pif-pouf'), $services['decorator_service_with_name']->getDecoratedService()); - } - - public function testLoadFactoryShortSyntax() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services14.yml'); - $services = $container->getDefinitions(); - - $this->assertEquals(array(new Reference('baz'), 'getClass'), $services['factory']->getFactory(), '->load() parses the factory tag with service:method'); - $this->assertEquals(array('FooBacFactory', 'createFooBar'), $services['factory_with_static_call']->getFactory(), '->load() parses the factory tag with Class::method'); - } - - public function testExtensions() - { - $container = new ContainerBuilder(); - $container->registerExtension(new \ProjectExtension()); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services10.yml'); - $container->compile(); - $services = $container->getDefinitions(); - $parameters = $container->getParameterBag()->all(); - - $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); - $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); - - $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); - $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); - - try { - $loader->load('services11.yml'); - $this->fail('->load() throws an InvalidArgumentException if the tag is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tag is not valid'); - $this->assertStringStartsWith('There is no extension able to load the configuration for "foobarfoobar" (in', $e->getMessage(), '->load() throws an InvalidArgumentException if the tag is not valid'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\Loader\YamlFileLoader::supports - */ - public function testSupports() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator()); - - $this->assertTrue($loader->supports('foo.yml'), '->supports() returns true if the resource is loadable'); - $this->assertTrue($loader->supports('foo.yaml'), '->supports() returns true if the resource is loadable'); - $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); - } - - public function testNonArrayTagsThrowsException() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - try { - $loader->load('badtag1.yml'); - $this->fail('->load() should throw an exception when the tags key of a service is not an array'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tags key is not an array'); - $this->assertStringStartsWith('Parameter "tags" must be an array for service', $e->getMessage(), '->load() throws an InvalidArgumentException if the tags key is not an array'); - } - } - - /** - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage A "tags" entry must be an array for service - */ - public function testNonArrayTagThrowsException() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('badtag4.yml'); - } - - public function testTagWithoutNameThrowsException() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - try { - $loader->load('badtag2.yml'); - $this->fail('->load() should throw an exception when a tag is missing the name key'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag is missing the name key'); - $this->assertStringStartsWith('A "tags" entry is missing a "name" key for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag is missing the name key'); - } - } - - public function testTagWithAttributeArrayThrowsException() - { - $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); - try { - $loader->load('badtag3.yml'); - $this->fail('->load() should throw an exception when a tag-attribute is not a scalar'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar'); - $this->assertStringStartsWith('A "tags" attribute must be of a scalar-type for service "foo_service", tag "foo", attribute "bar"', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar'); - } - } - - public function testLoadYamlOnlyWithKeys() - { - $container = new ContainerBuilder(); - $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); - $loader->load('services21.yml'); - - $definition = $container->getDefinition('manager'); - $this->assertEquals(array(array('setLogger', array(new Reference('logger'))), array('setClass', array('User'))), $definition->getMethodCalls()); - $this->assertEquals(array(true), $definition->getArguments()); - $this->assertEquals(array('manager' => array(array('alias' => 'user'))), $definition->getTags()); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/ParameterBag/FrozenParameterBagTest.php b/vendor/symfony/dependency-injection/Tests/ParameterBag/FrozenParameterBagTest.php deleted file mode 100644 index 6d963dc..0000000 --- a/vendor/symfony/dependency-injection/Tests/ParameterBag/FrozenParameterBagTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; - -use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; - -class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::__construct - */ - public function testConstructor() - { - $parameters = array( - 'foo' => 'foo', - 'bar' => 'bar', - ); - $bag = new FrozenParameterBag($parameters); - $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::clear - * @expectedException \LogicException - */ - public function testClear() - { - $bag = new FrozenParameterBag(array()); - $bag->clear(); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::set - * @expectedException \LogicException - */ - public function testSet() - { - $bag = new FrozenParameterBag(array()); - $bag->set('foo', 'bar'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::add - * @expectedException \LogicException - */ - public function testAdd() - { - $bag = new FrozenParameterBag(array()); - $bag->add(array()); - } - - /** - * @expectedException \LogicException - */ - public function testRemove() - { - $bag = new FrozenParameterBag(array('foo' => 'bar')); - $bag->remove('foo'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/ParameterBag/ParameterBagTest.php b/vendor/symfony/dependency-injection/Tests/ParameterBag/ParameterBagTest.php deleted file mode 100644 index e1f8169..0000000 --- a/vendor/symfony/dependency-injection/Tests/ParameterBag/ParameterBagTest.php +++ /dev/null @@ -1,279 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; - -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; -use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; - -class ParameterBagTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::__construct - */ - public function testConstructor() - { - $bag = new ParameterBag($parameters = array( - 'foo' => 'foo', - 'bar' => 'bar', - )); - $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::clear - */ - public function testClear() - { - $bag = new ParameterBag($parameters = array( - 'foo' => 'foo', - 'bar' => 'bar', - )); - $bag->clear(); - $this->assertEquals(array(), $bag->all(), '->clear() removes all parameters'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::remove - */ - public function testRemove() - { - $bag = new ParameterBag(array( - 'foo' => 'foo', - 'bar' => 'bar', - )); - $bag->remove('foo'); - $this->assertEquals(array('bar' => 'bar'), $bag->all(), '->remove() removes a parameter'); - $bag->remove('BAR'); - $this->assertEquals(array(), $bag->all(), '->remove() converts key to lowercase before removing'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::get - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::set - */ - public function testGetSet() - { - $bag = new ParameterBag(array('foo' => 'bar')); - $bag->set('bar', 'foo'); - $this->assertEquals('foo', $bag->get('bar'), '->set() sets the value of a new parameter'); - - $bag->set('foo', 'baz'); - $this->assertEquals('baz', $bag->get('foo'), '->set() overrides previously set parameter'); - - $bag->set('Foo', 'baz1'); - $this->assertEquals('baz1', $bag->get('foo'), '->set() converts the key to lowercase'); - $this->assertEquals('baz1', $bag->get('FOO'), '->get() converts the key to lowercase'); - - try { - $bag->get('baba'); - $this->fail('->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException', $e, '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - $this->assertEquals('You have requested a non-existent parameter "baba".', $e->getMessage(), '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - } - } - - public function testGetThrowParameterNotFoundException() - { - $bag = new ParameterBag(array( - 'foo' => 'foo', - 'bar' => 'bar', - 'baz' => 'baz', - )); - - try { - $bag->get('foo1'); - $this->fail('->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException', $e, '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - $this->assertEquals('You have requested a non-existent parameter "foo1". Did you mean this: "foo"?', $e->getMessage(), '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException with some advices'); - } - - try { - $bag->get('bag'); - $this->fail('->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException', $e, '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - $this->assertEquals('You have requested a non-existent parameter "bag". Did you mean one of these: "bar", "baz"?', $e->getMessage(), '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException with some advices'); - } - - try { - $bag->get(''); - $this->fail('->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException', $e, '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist'); - $this->assertEquals('You have requested a non-existent parameter "".', $e->getMessage(), '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException with some advices'); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::has - */ - public function testHas() - { - $bag = new ParameterBag(array('foo' => 'bar')); - $this->assertTrue($bag->has('foo'), '->has() returns true if a parameter is defined'); - $this->assertTrue($bag->has('Foo'), '->has() converts the key to lowercase'); - $this->assertFalse($bag->has('bar'), '->has() returns false if a parameter is not defined'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolveValue - */ - public function testResolveValue() - { - $bag = new ParameterBag(array()); - $this->assertEquals('foo', $bag->resolveValue('foo'), '->resolveValue() returns its argument unmodified if no placeholders are found'); - - $bag = new ParameterBag(array('foo' => 'bar')); - $this->assertEquals('I\'m a bar', $bag->resolveValue('I\'m a %foo%'), '->resolveValue() replaces placeholders by their values'); - $this->assertEquals(array('bar' => 'bar'), $bag->resolveValue(array('%foo%' => '%foo%')), '->resolveValue() replaces placeholders in keys and values of arrays'); - $this->assertEquals(array('bar' => array('bar' => array('bar' => 'bar'))), $bag->resolveValue(array('%foo%' => array('%foo%' => array('%foo%' => '%foo%')))), '->resolveValue() replaces placeholders in nested arrays'); - $this->assertEquals('I\'m a %%foo%%', $bag->resolveValue('I\'m a %%foo%%'), '->resolveValue() supports % escaping by doubling it'); - $this->assertEquals('I\'m a bar %%foo bar', $bag->resolveValue('I\'m a %foo% %%foo %foo%'), '->resolveValue() supports % escaping by doubling it'); - $this->assertEquals(array('foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar'))), $bag->resolveValue(array('foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar')))), '->resolveValue() supports % escaping by doubling it'); - - $bag = new ParameterBag(array('foo' => true)); - $this->assertTrue($bag->resolveValue('%foo%'), '->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings'); - $bag = new ParameterBag(array('foo' => null)); - $this->assertNull($bag->resolveValue('%foo%'), '->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings'); - - $bag = new ParameterBag(array('foo' => 'bar', 'baz' => '%%%foo% %foo%%% %%foo%% %%%foo%%%')); - $this->assertEquals('%%bar bar%% %%foo%% %%bar%%', $bag->resolveValue('%baz%'), '->resolveValue() replaces params placed besides escaped %'); - - $bag = new ParameterBag(array('baz' => '%%s?%%s')); - $this->assertEquals('%%s?%%s', $bag->resolveValue('%baz%'), '->resolveValue() is not replacing greedily'); - - $bag = new ParameterBag(array()); - try { - $bag->resolveValue('%foobar%'); - $this->fail('->resolveValue() throws an InvalidArgumentException if a placeholder references a non-existent parameter'); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('You have requested a non-existent parameter "foobar".', $e->getMessage(), '->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); - } - - try { - $bag->resolveValue('foo %foobar% bar'); - $this->fail('->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('You have requested a non-existent parameter "foobar".', $e->getMessage(), '->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); - } - - $bag = new ParameterBag(array('foo' => 'a %bar%', 'bar' => array())); - try { - $bag->resolveValue('%foo%'); - $this->fail('->resolveValue() throws a RuntimeException when a parameter embeds another non-string parameter'); - } catch (RuntimeException $e) { - $this->assertEquals('A string value must be composed of strings and/or numbers, but found parameter "bar" of type array inside string value "a %bar%".', $e->getMessage(), '->resolveValue() throws a RuntimeException when a parameter embeds another non-string parameter'); - } - - $bag = new ParameterBag(array('foo' => '%bar%', 'bar' => '%foobar%', 'foobar' => '%foo%')); - try { - $bag->resolveValue('%foo%'); - $this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } catch (ParameterCircularReferenceException $e) { - $this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").', $e->getMessage(), '->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } - - $bag = new ParameterBag(array('foo' => 'a %bar%', 'bar' => 'a %foobar%', 'foobar' => 'a %foo%')); - try { - $bag->resolveValue('%foo%'); - $this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } catch (ParameterCircularReferenceException $e) { - $this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").', $e->getMessage(), '->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); - } - - $bag = new ParameterBag(array('host' => 'foo.bar', 'port' => 1337)); - $this->assertEquals('foo.bar:1337', $bag->resolveValue('%host%:%port%')); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve - */ - public function testResolveIndicatesWhyAParameterIsNeeded() - { - $bag = new ParameterBag(array('foo' => '%bar%')); - - try { - $bag->resolve(); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e->getMessage()); - } - - $bag = new ParameterBag(array('foo' => '%bar%')); - - try { - $bag->resolve(); - } catch (ParameterNotFoundException $e) { - $this->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e->getMessage()); - } - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve - */ - public function testResolveUnescapesValue() - { - $bag = new ParameterBag(array( - 'foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar')), - 'bar' => 'I\'m a %%foo%%', - )); - - $bag->resolve(); - - $this->assertEquals('I\'m a %foo%', $bag->get('bar'), '->resolveValue() supports % escaping by doubling it'); - $this->assertEquals(array('bar' => array('ding' => 'I\'m a bar %foo %bar')), $bag->get('foo'), '->resolveValue() supports % escaping by doubling it'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::escapeValue - */ - public function testEscapeValue() - { - $bag = new ParameterBag(); - - $bag->add(array( - 'foo' => $bag->escapeValue(array('bar' => array('ding' => 'I\'m a bar %foo %bar', 'zero' => null))), - 'bar' => $bag->escapeValue('I\'m a %foo%'), - )); - - $this->assertEquals('I\'m a %%foo%%', $bag->get('bar'), '->escapeValue() escapes % by doubling it'); - $this->assertEquals(array('bar' => array('ding' => 'I\'m a bar %%foo %%bar', 'zero' => null)), $bag->get('foo'), '->escapeValue() escapes % by doubling it'); - } - - /** - * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve - * @dataProvider stringsWithSpacesProvider - */ - public function testResolveStringWithSpacesReturnsString($expected, $test, $description) - { - $bag = new ParameterBag(array('foo' => 'bar')); - - try { - $this->assertEquals($expected, $bag->resolveString($test), $description); - } catch (ParameterNotFoundException $e) { - $this->fail(sprintf('%s - "%s"', $description, $expected)); - } - } - - public function stringsWithSpacesProvider() - { - return array( - array('bar', '%foo%', 'Parameters must be wrapped by %.'), - array('% foo %', '% foo %', 'Parameters should not have spaces.'), - array('{% set my_template = "foo" %}', '{% set my_template = "foo" %}', 'Twig-like strings are not parameters.'), - array('50% is less than 100%', '50% is less than 100%', 'Text between % signs is allowed, if there are spaces.'), - ); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/ParameterTest.php b/vendor/symfony/dependency-injection/Tests/ParameterTest.php deleted file mode 100644 index bed188e..0000000 --- a/vendor/symfony/dependency-injection/Tests/ParameterTest.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Parameter; - -class ParameterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Parameter::__construct - */ - public function testConstructor() - { - $ref = new Parameter('foo'); - $this->assertEquals('foo', (string) $ref, '__construct() sets the id of the parameter, which is used for the __toString() method'); - } -} diff --git a/vendor/symfony/dependency-injection/Tests/ReferenceTest.php b/vendor/symfony/dependency-injection/Tests/ReferenceTest.php deleted file mode 100644 index f14e99f..0000000 --- a/vendor/symfony/dependency-injection/Tests/ReferenceTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Tests; - -use Symfony\Component\DependencyInjection\Reference; - -class ReferenceTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Symfony\Component\DependencyInjection\Reference::__construct - */ - public function testConstructor() - { - $ref = new Reference('foo'); - $this->assertEquals('foo', (string) $ref, '__construct() sets the id of the reference, which is used for the __toString() method'); - } - - public function testCaseInsensitive() - { - $ref = new Reference('FooBar'); - $this->assertEquals('foobar', (string) $ref, 'the id is lowercased as the container is case insensitive'); - } -} diff --git a/vendor/symfony/dom-crawler/Tests/CrawlerTest.php b/vendor/symfony/dom-crawler/Tests/CrawlerTest.php deleted file mode 100755 index 4cfd06f..0000000 --- a/vendor/symfony/dom-crawler/Tests/CrawlerTest.php +++ /dev/null @@ -1,1084 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DomCrawler\Tests; - -use Symfony\Component\CssSelector\CssSelector; -use Symfony\Component\DomCrawler\Crawler; - -class CrawlerTest extends \PHPUnit_Framework_TestCase -{ - public function testConstructor() - { - $crawler = new Crawler(); - $this->assertCount(0, $crawler, '__construct() returns an empty crawler'); - - $crawler = new Crawler(new \DOMNode()); - $this->assertCount(1, $crawler, '__construct() takes a node as a first argument'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::add - */ - public function testAdd() - { - $crawler = new Crawler(); - $crawler->add($this->createDomDocument()); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMDocument'); - - $crawler = new Crawler(); - $crawler->add($this->createNodeList()); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMNodeList'); - - foreach ($this->createNodeList() as $node) { - $list[] = $node; - } - $crawler = new Crawler(); - $crawler->add($list); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from an array of nodes'); - - $crawler = new Crawler(); - $crawler->add($this->createNodeList()->item(0)); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMElement'); - - $crawler = new Crawler(); - $crawler->add('Foo'); - $this->assertEquals('Foo', $crawler->filterXPath('//body')->text(), '->add() adds nodes from a string'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testAddInvalidNode() - { - $crawler = new Crawler(); - $crawler->add(1); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - */ - public function testAddHtmlContent() - { - $crawler = new Crawler(); - $crawler->addHtmlContent('
', 'UTF-8'); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addHtmlContent() adds nodes from an HTML string'); - - $crawler->addHtmlContent('', 'UTF-8'); - - $this->assertEquals('http://symfony.com', $crawler->filterXPath('//base')->attr('href'), '->addHtmlContent() adds nodes from an HTML string'); - $this->assertEquals('http://symfony.com/contact', $crawler->filterXPath('//a')->link()->getUri(), '->addHtmlContent() adds nodes from an HTML string'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - * @requires extension mbstring - */ - public function testAddHtmlContentCharset() - { - $crawler = new Crawler(); - $crawler->addHtmlContent('
Tiếng Việt', 'UTF-8'); - - $this->assertEquals('Tiếng Việt', $crawler->filterXPath('//div')->text()); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - */ - public function testAddHtmlContentInvalidBaseTag() - { - $crawler = new Crawler(null, 'http://symfony.com'); - - $crawler->addHtmlContent('', 'UTF-8'); - - $this->assertEquals('http://symfony.com/contact', current($crawler->filterXPath('//a')->links())->getUri(), '->addHtmlContent() correctly handles a non-existent base tag href attribute'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - */ - public function testAddHtmlContentUnsupportedCharset() - { - $crawler = new Crawler(); - $crawler->addHtmlContent(file_get_contents(__DIR__.'/Fixtures/windows-1250.html'), 'Windows-1250'); - - $this->assertEquals('Žťčýů', $crawler->filterXPath('//p')->text()); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - * @requires extension mbstring - */ - public function testAddHtmlContentCharsetGbk() - { - $crawler = new Crawler(); - //gbk encode of

中文

- $crawler->addHtmlContent(base64_decode('PGh0bWw+PHA+1tDOxDwvcD48L2h0bWw+'), 'gbk'); - - $this->assertEquals('中文', $crawler->filterXPath('//p')->text()); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addHtmlContent - */ - public function testAddHtmlContentWithErrors() - { - $internalErrors = libxml_use_internal_errors(true); - - $crawler = new Crawler(); - $crawler->addHtmlContent(<< - - - - - - - -EOF - , 'UTF-8'); - - $errors = libxml_get_errors(); - $this->assertCount(1, $errors); - $this->assertEquals("Tag nav invalid\n", $errors[0]->message); - - libxml_clear_errors(); - libxml_use_internal_errors($internalErrors); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addXmlContent - */ - public function testAddXmlContent() - { - $crawler = new Crawler(); - $crawler->addXmlContent('
', 'UTF-8'); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addXmlContent() adds nodes from an XML string'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addXmlContent - */ - public function testAddXmlContentCharset() - { - $crawler = new Crawler(); - $crawler->addXmlContent('
Tiếng Việt
', 'UTF-8'); - - $this->assertEquals('Tiếng Việt', $crawler->filterXPath('//div')->text()); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addXmlContent - */ - public function testAddXmlContentWithErrors() - { - $internalErrors = libxml_use_internal_errors(true); - - $crawler = new Crawler(); - $crawler->addXmlContent(<< - - - - -
- - -EOF - , 'UTF-8'); - - $this->assertTrue(count(libxml_get_errors()) > 1); - - libxml_clear_errors(); - libxml_use_internal_errors($internalErrors); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addContent - */ - public function testAddContent() - { - $crawler = new Crawler(); - $crawler->addContent('
', 'text/html; charset=UTF-8'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an HTML string'); - - $crawler = new Crawler(); - $crawler->addContent('
', 'text/html; charset=UTF-8; dir=RTL'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an HTML string with extended content type'); - - $crawler = new Crawler(); - $crawler->addContent('
'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() uses text/html as the default type'); - - $crawler = new Crawler(); - $crawler->addContent('
', 'text/xml; charset=UTF-8'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an XML string'); - - $crawler = new Crawler(); - $crawler->addContent('
', 'text/xml'); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addContent() adds nodes from an XML string'); - - $crawler = new Crawler(); - $crawler->addContent('foo bar', 'text/plain'); - $this->assertCount(0, $crawler, '->addContent() does nothing if the type is not (x|ht)ml'); - - $crawler = new Crawler(); - $crawler->addContent('中文'); - $this->assertEquals('中文', $crawler->filterXPath('//span')->text(), '->addContent() guess wrong charset'); - - $crawler = new Crawler(); - $crawler->addContent(iconv('UTF-8', 'SJIS', '日本語')); - $this->assertEquals('日本語', $crawler->filterXPath('//body')->text(), '->addContent() can recognize "Shift_JIS" in html5 meta charset tag'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addDocument - */ - public function testAddDocument() - { - $crawler = new Crawler(); - $crawler->addDocument($this->createDomDocument()); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addDocument() adds nodes from a \DOMDocument'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addNodeList - */ - public function testAddNodeList() - { - $crawler = new Crawler(); - $crawler->addNodeList($this->createNodeList()); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNodeList() adds nodes from a \DOMNodeList'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addNodes - */ - public function testAddNodes() - { - foreach ($this->createNodeList() as $node) { - $list[] = $node; - } - - $crawler = new Crawler(); - $crawler->addNodes($list); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNodes() adds nodes from an array of nodes'); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::addNode - */ - public function testAddNode() - { - $crawler = new Crawler(); - $crawler->addNode($this->createNodeList()->item(0)); - - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNode() adds nodes from a \DOMElement'); - } - - public function testClear() - { - $crawler = new Crawler(new \DOMNode()); - $crawler->clear(); - $this->assertCount(0, $crawler, '->clear() removes all the nodes from the crawler'); - } - - public function testEq() - { - $crawler = $this->createTestCrawler()->filterXPath('//li'); - $this->assertNotSame($crawler, $crawler->eq(0), '->eq() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->eq() returns a new instance of a crawler'); - - $this->assertEquals('Two', $crawler->eq(1)->text(), '->eq() returns the nth node of the list'); - $this->assertCount(0, $crawler->eq(100), '->eq() returns an empty crawler if the nth node does not exist'); - } - - public function testEach() - { - $data = $this->createTestCrawler()->filterXPath('//ul[1]/li')->each(function ($node, $i) { - return $i.'-'.$node->text(); - }); - - $this->assertEquals(array('0-One', '1-Two', '2-Three'), $data, '->each() executes an anonymous function on each node of the list'); - } - - public function testSlice() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - $this->assertNotSame($crawler->slice(), $crawler, '->slice() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->slice(), '->slice() returns a new instance of a crawler'); - - $this->assertCount(3, $crawler->slice(), '->slice() does not slice the nodes in the list if any param is entered'); - $this->assertCount(1, $crawler->slice(1, 1), '->slice() slices the nodes in the list'); - } - - public function testReduce() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - $nodes = $crawler->reduce(function ($node, $i) { - return $i !== 1; - }); - $this->assertNotSame($nodes, $crawler, '->reduce() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $nodes, '->reduce() returns a new instance of a crawler'); - - $this->assertCount(2, $nodes, '->reduce() filters the nodes in the list'); - } - - public function testAttr() - { - $this->assertEquals('first', $this->createTestCrawler()->filterXPath('//li')->attr('class'), '->attr() returns the attribute of the first element of the node list'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->attr('class'); - $this->fail('->attr() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->attr() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testMissingAttrValueIsNull() - { - $crawler = new Crawler(); - $crawler->addContent('
', 'text/html; charset=UTF-8'); - $div = $crawler->filterXPath('//div'); - - $this->assertEquals('sample value', $div->attr('non-empty-attr'), '->attr() reads non-empty attributes correctly'); - $this->assertEquals('', $div->attr('empty-attr'), '->attr() reads empty attributes correctly'); - $this->assertNull($div->attr('missing-attr'), '->attr() reads missing attributes correctly'); - } - - public function testNodeName() - { - $this->assertEquals('li', $this->createTestCrawler()->filterXPath('//li')->nodeName(), '->nodeName() returns the node name of the first element of the node list'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->nodeName(); - $this->fail('->nodeName() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->nodeName() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testText() - { - $this->assertEquals('One', $this->createTestCrawler()->filterXPath('//li')->text(), '->text() returns the node value of the first element of the node list'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->text(); - $this->fail('->text() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->text() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testHtml() - { - $this->assertEquals('Bar', $this->createTestCrawler()->filterXPath('//a[5]')->html()); - $this->assertEquals('', trim($this->createTestCrawler()->filterXPath('//form[@id="FooFormId"]')->html())); - - try { - $this->createTestCrawler()->filterXPath('//ol')->html(); - $this->fail('->html() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->html() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testExtract() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - - $this->assertEquals(array('One', 'Two', 'Three'), $crawler->extract('_text'), '->extract() returns an array of extracted data from the node list'); - $this->assertEquals(array(array('One', 'first'), array('Two', ''), array('Three', '')), $crawler->extract(array('_text', 'class')), '->extract() returns an array of extracted data from the node list'); - - $this->assertEquals(array(), $this->createTestCrawler()->filterXPath('//ol')->extract('_text'), '->extract() returns an empty array if the node list is empty'); - } - - public function testFilterXpathComplexQueries() - { - $crawler = $this->createTestCrawler()->filterXPath('//body'); - - $this->assertCount(0, $crawler->filterXPath('/input')); - $this->assertCount(0, $crawler->filterXPath('/body')); - $this->assertCount(1, $crawler->filterXPath('/_root/body')); - $this->assertCount(1, $crawler->filterXPath('./body')); - $this->assertCount(1, $crawler->filterXPath('.//body')); - $this->assertCount(5, $crawler->filterXPath('.//input')); - $this->assertCount(4, $crawler->filterXPath('//form')->filterXPath('//button | //input')); - $this->assertCount(1, $crawler->filterXPath('body')); - $this->assertCount(6, $crawler->filterXPath('//button | //input')); - $this->assertCount(1, $crawler->filterXPath('//body')); - $this->assertCount(1, $crawler->filterXPath('descendant-or-self::body')); - $this->assertCount(1, $crawler->filterXPath('//div[@id="parent"]')->filterXPath('./div'), 'A child selection finds only the current div'); - $this->assertCount(3, $crawler->filterXPath('//div[@id="parent"]')->filterXPath('descendant::div'), 'A descendant selector matches the current div and its child'); - $this->assertCount(3, $crawler->filterXPath('//div[@id="parent"]')->filterXPath('//div'), 'A descendant selector matches the current div and its child'); - $this->assertCount(5, $crawler->filterXPath('(//a | //div)//img')); - $this->assertCount(7, $crawler->filterXPath('((//a | //div)//img | //ul)')); - $this->assertCount(7, $crawler->filterXPath('( ( //a | //div )//img | //ul )')); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::filterXPath - */ - public function testFilterXPath() - { - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->filterXPath('//li'), '->filterXPath() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filterXPath() returns a new instance of a crawler'); - - $crawler = $this->createTestCrawler()->filterXPath('//ul'); - $this->assertCount(6, $crawler->filterXPath('//li'), '->filterXPath() filters the node list with the XPath expression'); - - $crawler = $this->createTestCrawler(); - $this->assertCount(3, $crawler->filterXPath('//body')->filterXPath('//button')->parents(), '->filterXpath() preserves parents when chained'); - } - - public function testFilterXPathWithDefaultNamespace() - { - $crawler = $this->createTestXmlCrawler()->filterXPath('//default:entry/default:id'); - $this->assertCount(1, $crawler, '->filterXPath() automatically registers a namespace'); - $this->assertSame('tag:youtube.com,2008:video:kgZRZmEc9j4', $crawler->text()); - } - - public function testFilterXPathWithCustomDefaultNamespace() - { - $crawler = $this->createTestXmlCrawler(); - $crawler->setDefaultNamespacePrefix('x'); - $crawler = $crawler->filterXPath('//x:entry/x:id'); - - $this->assertCount(1, $crawler, '->filterXPath() lets to override the default namespace prefix'); - $this->assertSame('tag:youtube.com,2008:video:kgZRZmEc9j4', $crawler->text()); - } - - public function testFilterXPathWithNamespace() - { - $crawler = $this->createTestXmlCrawler()->filterXPath('//yt:accessControl'); - $this->assertCount(2, $crawler, '->filterXPath() automatically registers a namespace'); - } - - public function testFilterXPathWithMultipleNamespaces() - { - $crawler = $this->createTestXmlCrawler()->filterXPath('//media:group/yt:aspectRatio'); - $this->assertCount(1, $crawler, '->filterXPath() automatically registers multiple namespaces'); - $this->assertSame('widescreen', $crawler->text()); - } - - public function testFilterXPathWithManuallyRegisteredNamespace() - { - $crawler = $this->createTestXmlCrawler(); - $crawler->registerNamespace('m', 'http://search.yahoo.com/mrss/'); - - $crawler = $crawler->filterXPath('//m:group/yt:aspectRatio'); - $this->assertCount(1, $crawler, '->filterXPath() uses manually registered namespace'); - $this->assertSame('widescreen', $crawler->text()); - } - - public function testFilterXPathWithAnUrl() - { - $crawler = $this->createTestXmlCrawler(); - - $crawler = $crawler->filterXPath('//media:category[@scheme="http://gdata.youtube.com/schemas/2007/categories.cat"]'); - $this->assertCount(1, $crawler); - $this->assertSame('Music', $crawler->text()); - } - - public function testFilterXPathWithFakeRoot() - { - $crawler = $this->createTestCrawler(); - $this->assertCount(0, $crawler->filterXPath('.'), '->filterXPath() returns an empty result if the XPath references the fake root node'); - $this->assertCount(0, $crawler->filterXPath('/_root'), '->filterXPath() returns an empty result if the XPath references the fake root node'); - $this->assertCount(0, $crawler->filterXPath('self::*'), '->filterXPath() returns an empty result if the XPath references the fake root node'); - $this->assertCount(0, $crawler->filterXPath('self::_root'), '->filterXPath() returns an empty result if the XPath references the fake root node'); - } - - public function testFilterXPathWithAncestorAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//form'); - - $this->assertCount(0, $crawler->filterXPath('ancestor::*'), 'The fake root node has no ancestor nodes'); - } - - public function testFilterXPathWithAncestorOrSelfAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//form'); - - $this->assertCount(0, $crawler->filterXPath('ancestor-or-self::*'), 'The fake root node has no ancestor nodes'); - } - - public function testFilterXPathWithAttributeAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//form'); - - $this->assertCount(0, $crawler->filterXPath('attribute::*'), 'The fake root node has no attribute nodes'); - } - - public function testFilterXPathWithAttributeAxisAfterElementAxis() - { - $this->assertCount(3, $this->createTestCrawler()->filterXPath('//form/button/attribute::*'), '->filterXPath() handles attribute axes properly when they are preceded by an element filtering axis'); - } - - public function testFilterXPathWithChildAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//div[@id="parent"]'); - - $this->assertCount(1, $crawler->filterXPath('child::div'), 'A child selection finds only the current div'); - } - - public function testFilterXPathWithFollowingAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//a'); - - $this->assertCount(0, $crawler->filterXPath('following::div'), 'The fake root node has no following nodes'); - } - - public function testFilterXPathWithFollowingSiblingAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//a'); - - $this->assertCount(0, $crawler->filterXPath('following-sibling::div'), 'The fake root node has no following nodes'); - } - - public function testFilterXPathWithNamespaceAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//button'); - - $this->assertCount(0, $crawler->filterXPath('namespace::*'), 'The fake root node has no namespace nodes'); - } - - public function testFilterXPathWithNamespaceAxisAfterElementAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//div[@id="parent"]/namespace::*'); - - $this->assertCount(0, $crawler->filterXPath('namespace::*'), 'Namespace axes cannot be requested'); - } - - public function testFilterXPathWithParentAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//button'); - - $this->assertCount(0, $crawler->filterXPath('parent::*'), 'The fake root node has no parent nodes'); - } - - public function testFilterXPathWithPrecedingAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//form'); - - $this->assertCount(0, $crawler->filterXPath('preceding::*'), 'The fake root node has no preceding nodes'); - } - - public function testFilterXPathWithPrecedingSiblingAxis() - { - $crawler = $this->createTestCrawler()->filterXPath('//form'); - - $this->assertCount(0, $crawler->filterXPath('preceding-sibling::*'), 'The fake root node has no preceding nodes'); - } - - public function testFilterXPathWithSelfAxes() - { - $crawler = $this->createTestCrawler()->filterXPath('//a'); - - $this->assertCount(0, $crawler->filterXPath('self::a'), 'The fake root node has no "real" element name'); - $this->assertCount(0, $crawler->filterXPath('self::a/img'), 'The fake root node has no "real" element name'); - $this->assertCount(9, $crawler->filterXPath('self::*/a')); - } - - /** - * @covers Symfony\Component\DomCrawler\Crawler::filter - */ - public function testFilter() - { - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->filter('li'), '->filter() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filter() returns a new instance of a crawler'); - - $crawler = $this->createTestCrawler()->filter('ul'); - - $this->assertCount(6, $crawler->filter('li'), '->filter() filters the node list with the CSS selector'); - } - - public function testFilterWithDefaultNamespace() - { - $crawler = $this->createTestXmlCrawler()->filter('default|entry default|id'); - $this->assertCount(1, $crawler, '->filter() automatically registers namespaces'); - $this->assertSame('tag:youtube.com,2008:video:kgZRZmEc9j4', $crawler->text()); - } - - public function testFilterWithNamespace() - { - CssSelector::disableHtmlExtension(); - - $crawler = $this->createTestXmlCrawler()->filter('yt|accessControl'); - $this->assertCount(2, $crawler, '->filter() automatically registers namespaces'); - } - - public function testFilterWithMultipleNamespaces() - { - CssSelector::disableHtmlExtension(); - - $crawler = $this->createTestXmlCrawler()->filter('media|group yt|aspectRatio'); - $this->assertCount(1, $crawler, '->filter() automatically registers namespaces'); - $this->assertSame('widescreen', $crawler->text()); - } - - public function testFilterWithDefaultNamespaceOnly() - { - $crawler = new Crawler(' - - - http://localhost/foo - weekly - 0.5 - 2012-11-16 - - - http://localhost/bar - weekly - 0.5 - 2012-11-16 - - - '); - - $this->assertEquals(2, $crawler->filter('url')->count()); - } - - public function testSelectLink() - { - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->selectLink('Foo'), '->selectLink() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectLink() returns a new instance of a crawler'); - - $this->assertCount(1, $crawler->selectLink('Fabien\'s Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(1, $crawler->selectLink('Fabien\'s Bar'), '->selectLink() selects links by the alt attribute of a clickable image'); - - $this->assertCount(2, $crawler->selectLink('Fabien"s Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(2, $crawler->selectLink('Fabien"s Bar'), '->selectLink() selects links by the alt attribute of a clickable image'); - - $this->assertCount(1, $crawler->selectLink('\' Fabien"s Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(1, $crawler->selectLink('\' Fabien"s Bar'), '->selectLink() selects links by the alt attribute of a clickable image'); - - $this->assertCount(4, $crawler->selectLink('Foo'), '->selectLink() selects links by the node values'); - $this->assertCount(4, $crawler->selectLink('Bar'), '->selectLink() selects links by the node values'); - } - - public function testSelectButton() - { - $crawler = $this->createTestCrawler(); - $this->assertNotSame($crawler, $crawler->selectButton('FooValue'), '->selectButton() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectButton() returns a new instance of a crawler'); - - $this->assertEquals(1, $crawler->selectButton('FooValue')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('FooName')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('FooId')->count(), '->selectButton() selects buttons'); - - $this->assertEquals(1, $crawler->selectButton('BarValue')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('BarName')->count(), '->selectButton() selects buttons'); - $this->assertEquals(1, $crawler->selectButton('BarId')->count(), '->selectButton() selects buttons'); - - $this->assertEquals(1, $crawler->selectButton('FooBarValue')->count(), '->selectButton() selects buttons with form attribute too'); - $this->assertEquals(1, $crawler->selectButton('FooBarName')->count(), '->selectButton() selects buttons with form attribute too'); - } - - public function testSelectButtonWithSingleQuotesInNameAttribute() - { - $html = << - - -
-
- - - - -HTML; - - $crawler = new Crawler($html); - - $this->assertCount(1, $crawler->selectButton('Click \'Here\'')); - } - - public function testSelectButtonWithDoubleQuotesInNameAttribute() - { - $html = << - - -
- Login -
-
- - - - -HTML; - - $crawler = new Crawler($html); - - $this->assertCount(1, $crawler->selectButton('Click "Here"')); - } - - public function testLink() - { - $crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Link', $crawler->link(), '->link() returns a Link instance'); - - $this->assertEquals('POST', $crawler->link('post')->getMethod(), '->link() takes a method as its argument'); - - $crawler = $this->createTestCrawler('http://example.com/bar')->selectLink('GetLink'); - $this->assertEquals('http://example.com/bar?get=param', $crawler->link()->getUri(), '->link() returns a Link instance'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->link(); - $this->fail('->link() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->link() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testSelectLinkAndLinkFiltered() - { - $html = << - - -
- Login -
-
- - - - -HTML; - - $crawler = new Crawler($html); - $filtered = $crawler->filterXPath("descendant-or-self::*[@id = 'login-form']"); - - $this->assertCount(0, $filtered->selectLink('Login')); - $this->assertCount(1, $filtered->selectButton('Submit')); - - $filtered = $crawler->filterXPath("descendant-or-self::*[@id = 'action']"); - - $this->assertCount(1, $filtered->selectLink('Login')); - $this->assertCount(0, $filtered->selectButton('Submit')); - - $this->assertCount(1, $crawler->selectLink('Login')->selectLink('Login')); - $this->assertCount(1, $crawler->selectButton('Submit')->selectButton('Submit')); - } - - public function testChaining() - { - $crawler = new Crawler('
'); - - $this->assertEquals('a', $crawler->filterXPath('//div')->filterXPath('div')->filterXPath('div')->attr('name')); - } - - public function testLinks() - { - $crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo'); - $this->assertInternalType('array', $crawler->links(), '->links() returns an array'); - - $this->assertCount(4, $crawler->links(), '->links() returns an array'); - $links = $crawler->links(); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Link', $links[0], '->links() returns an array of Link instances'); - - $this->assertEquals(array(), $this->createTestCrawler()->filterXPath('//ol')->links(), '->links() returns an empty array if the node selection is empty'); - } - - public function testForm() - { - $testCrawler = $this->createTestCrawler('http://example.com/bar/'); - $crawler = $testCrawler->selectButton('FooValue'); - $crawler2 = $testCrawler->selectButton('FooBarValue'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Form', $crawler->form(), '->form() returns a Form instance'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Form', $crawler2->form(), '->form() returns a Form instance'); - - $this->assertEquals($crawler->form()->getFormNode()->getAttribute('id'), $crawler2->form()->getFormNode()->getAttribute('id'), '->form() works on elements with form attribute'); - - $this->assertEquals(array('FooName' => 'FooBar', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler->form(array('FooName' => 'FooBar'))->getValues(), '->form() takes an array of values to submit as its first argument'); - $this->assertEquals(array('FooName' => 'FooValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler->form()->getValues(), '->getValues() returns correct form values'); - $this->assertEquals(array('FooBarName' => 'FooBarValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler2->form()->getValues(), '->getValues() returns correct form values'); - - try { - $this->createTestCrawler()->filterXPath('//ol')->form(); - $this->fail('->form() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->form() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testLast() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - $this->assertNotSame($crawler, $crawler->last(), '->last() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->last() returns a new instance of a crawler'); - - $this->assertEquals('Three', $crawler->last()->text()); - } - - public function testFirst() - { - $crawler = $this->createTestCrawler()->filterXPath('//li'); - $this->assertNotSame($crawler, $crawler->first(), '->first() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->first() returns a new instance of a crawler'); - - $this->assertEquals('One', $crawler->first()->text()); - } - - public function testSiblings() - { - $crawler = $this->createTestCrawler()->filterXPath('//li')->eq(1); - $this->assertNotSame($crawler, $crawler->siblings(), '->siblings() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->siblings() returns a new instance of a crawler'); - - $nodes = $crawler->siblings(); - $this->assertEquals(2, $nodes->count()); - $this->assertEquals('One', $nodes->eq(0)->text()); - $this->assertEquals('Three', $nodes->eq(1)->text()); - - $nodes = $this->createTestCrawler()->filterXPath('//li')->eq(0)->siblings(); - $this->assertEquals(2, $nodes->count()); - $this->assertEquals('Two', $nodes->eq(0)->text()); - $this->assertEquals('Three', $nodes->eq(1)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->siblings(); - $this->fail('->siblings() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->siblings() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testNextAll() - { - $crawler = $this->createTestCrawler()->filterXPath('//li')->eq(1); - $this->assertNotSame($crawler, $crawler->nextAll(), '->nextAll() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->nextAll() returns a new instance of a crawler'); - - $nodes = $crawler->nextAll(); - $this->assertEquals(1, $nodes->count()); - $this->assertEquals('Three', $nodes->eq(0)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->nextAll(); - $this->fail('->nextAll() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->nextAll() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testPreviousAll() - { - $crawler = $this->createTestCrawler()->filterXPath('//li')->eq(2); - $this->assertNotSame($crawler, $crawler->previousAll(), '->previousAll() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->previousAll() returns a new instance of a crawler'); - - $nodes = $crawler->previousAll(); - $this->assertEquals(2, $nodes->count()); - $this->assertEquals('Two', $nodes->eq(0)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->previousAll(); - $this->fail('->previousAll() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->previousAll() throws an \InvalidArgumentException if the node list is empty'); - } - } - - public function testChildren() - { - $crawler = $this->createTestCrawler()->filterXPath('//ul'); - $this->assertNotSame($crawler, $crawler->children(), '->children() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->children() returns a new instance of a crawler'); - - $nodes = $crawler->children(); - $this->assertEquals(3, $nodes->count()); - $this->assertEquals('One', $nodes->eq(0)->text()); - $this->assertEquals('Two', $nodes->eq(1)->text()); - $this->assertEquals('Three', $nodes->eq(2)->text()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->children(); - $this->fail('->children() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->children() throws an \InvalidArgumentException if the node list is empty'); - } - - try { - $crawler = new Crawler('

'); - $crawler->filter('p')->children(); - $this->assertTrue(true, '->children() does not trigger a notice if the node has no children'); - } catch (\PHPUnit_Framework_Error_Notice $e) { - $this->fail('->children() does not trigger a notice if the node has no children'); - } - } - - public function testParents() - { - $crawler = $this->createTestCrawler()->filterXPath('//li[1]'); - $this->assertNotSame($crawler, $crawler->parents(), '->parents() returns a new instance of a crawler'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->parents() returns a new instance of a crawler'); - - $nodes = $crawler->parents(); - $this->assertEquals(3, $nodes->count()); - - $nodes = $this->createTestCrawler()->filterXPath('//html')->parents(); - $this->assertEquals(0, $nodes->count()); - - try { - $this->createTestCrawler()->filterXPath('//ol')->parents(); - $this->fail('->parents() throws an \InvalidArgumentException if the node list is empty'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->parents() throws an \InvalidArgumentException if the node list is empty'); - } - } - - /** - * @dataProvider getBaseTagData - */ - public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = null) - { - $crawler = new Crawler('', $currentUri); - $this->assertEquals($expectedUri, $crawler->filterXPath('//a')->link()->getUri(), $description); - } - - public function getBaseTagData() - { - return array( - array('http://base.com', 'link', 'http://base.com/link'), - array('//base.com', 'link', 'https://base.com/link', 'https://domain.com', ' tag can use a schema-less URL'), - array('path/', 'link', 'https://domain.com/path/link', 'https://domain.com', ' tag can set a path'), - array('http://base.com', '#', 'http://base.com#', 'http://domain.com/path/link', ' tag does work with links to an anchor'), - array('http://base.com', '', 'http://base.com', 'http://domain.com/path/link', ' tag does work with empty links'), - ); - } - - /** - * @dataProvider getBaseTagWithFormData - */ - public function testBaseTagWithForm($baseValue, $actionValue, $expectedUri, $currentUri = null, $description = null) - { - $crawler = new Crawler('
', - array('bar' => array('InputFormField', 'bar')), - ), - array( - 'appends the submitted button value but not other submit buttons', - ' - ', - array('foobar' => array('InputFormField', 'foobar')), - ), - array( - 'turns an image input into x and y fields', - '', - array('bar.x' => array('InputFormField', '0'), 'bar.y' => array('InputFormField', '0')), - ), - array( - 'returns textareas', - ' - ', - array('foo' => array('TextareaFormField', 'foo')), - ), - array( - 'returns inputs', - ' - ', - array('foo' => array('InputFormField', 'foo')), - ), - array( - 'returns checkboxes', - ' - ', - array('foo' => array('ChoiceFormField', 'foo')), - ), - array( - 'returns not-checked checkboxes', - ' - ', - array('foo' => array('ChoiceFormField', false)), - ), - array( - 'returns radio buttons', - ' - - ', - array('foo' => array('ChoiceFormField', 'bar')), - ), - array( - 'returns file inputs', - ' - ', - array('foo' => array('FileFormField', array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0))), - ), - ); - } - - public function testGetFormNode() - { - $dom = new \DOMDocument(); - $dom->loadHTML('
'); - - $form = new Form($dom->getElementsByTagName('input')->item(0), 'http://example.com'); - - $this->assertSame($dom->getElementsByTagName('form')->item(0), $form->getFormNode(), '->getFormNode() returns the form node associated with this form'); - } - - public function testGetFormNodeFromNamedForm() - { - $dom = new \DOMDocument(); - $dom->loadHTML('
'); - - $form = new Form($dom->getElementsByTagName('form')->item(0), 'http://example.com'); - - $this->assertSame($dom->getElementsByTagName('form')->item(0), $form->getFormNode(), '->getFormNode() returns the form node associated with this form'); - } - - public function testGetMethod() - { - $form = $this->createForm('
'); - $this->assertEquals('GET', $form->getMethod(), '->getMethod() returns get if no method is defined'); - - $form = $this->createForm('
'); - $this->assertEquals('POST', $form->getMethod(), '->getMethod() returns the method attribute value of the form'); - - $form = $this->createForm('
', 'put'); - $this->assertEquals('PUT', $form->getMethod(), '->getMethod() returns the method defined in the constructor if provided'); - - $form = $this->createForm('
', 'delete'); - $this->assertEquals('DELETE', $form->getMethod(), '->getMethod() returns the method defined in the constructor if provided'); - - $form = $this->createForm('
', 'patch'); - $this->assertEquals('PATCH', $form->getMethod(), '->getMethod() returns the method defined in the constructor if provided'); - } - - public function testGetSetValue() - { - $form = $this->createForm('
'); - - $this->assertEquals('foo', $form['foo']->getValue(), '->offsetGet() returns the value of a form field'); - - $form['foo'] = 'bar'; - - $this->assertEquals('bar', $form['foo']->getValue(), '->offsetSet() changes the value of a form field'); - - try { - $form['foobar'] = 'bar'; - $this->fail('->offsetSet() throws an \InvalidArgumentException exception if the field does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->offsetSet() throws an \InvalidArgumentException exception if the field does not exist'); - } - - try { - $form['foobar']; - $this->fail('->offsetSet() throws an \InvalidArgumentException exception if the field does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->offsetSet() throws an \InvalidArgumentException exception if the field does not exist'); - } - } - - public function testSetValueOnMultiValuedFieldsWithMalformedName() - { - $form = $this->createForm('
'); - - try { - $form['foo[bar'] = 'bar'; - $this->fail('->offsetSet() throws an \InvalidArgumentException exception if the name is malformed.'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->offsetSet() throws an \InvalidArgumentException exception if the name is malformed.'); - } - } - - public function testDisableValidation() - { - $form = $this->createForm('
- - - - '); - - $form->disableValidation(); - - $form['foo[bar]']->select('foo'); - $form['foo[baz]']->select('bar'); - $this->assertEquals('foo', $form['foo[bar]']->getValue(), '->disableValidation() disables validation of all ChoiceFormField.'); - $this->assertEquals('bar', $form['foo[baz]']->getValue(), '->disableValidation() disables validation of all ChoiceFormField.'); - } - - public function testOffsetUnset() - { - $form = $this->createForm('
'); - unset($form['foo']); - $this->assertFalse(isset($form['foo']), '->offsetUnset() removes a field'); - } - - public function testOffsetExists() - { - $form = $this->createForm('
'); - - $this->assertTrue(isset($form['foo']), '->offsetExists() return true if the field exists'); - $this->assertFalse(isset($form['bar']), '->offsetExists() return false if the field does not exist'); - } - - public function testGetValues() - { - $form = $this->createForm('
'); - $this->assertEquals(array('foo[bar]' => 'foo', 'bar' => 'bar', 'baz' => array()), $form->getValues(), '->getValues() returns all form field values'); - - $form = $this->createForm('
'); - $this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include not-checked checkboxes'); - - $form = $this->createForm('
'); - $this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include file input fields'); - - $form = $this->createForm('
'); - $this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include disabled fields'); - } - - public function testSetValues() - { - $form = $this->createForm('
'); - $form->setValues(array('foo' => false, 'bar' => 'foo')); - $this->assertEquals(array('bar' => 'foo'), $form->getValues(), '->setValues() sets the values of fields'); - } - - public function testMultiselectSetValues() - { - $form = $this->createForm('
'); - $form->setValues(array('multi' => array('foo', 'bar'))); - $this->assertEquals(array('multi' => array('foo', 'bar')), $form->getValues(), '->setValue() sets the values of select'); - } - - public function testGetPhpValues() - { - $form = $this->createForm('
'); - $this->assertEquals(array('foo' => array('bar' => 'foo'), 'bar' => 'bar'), $form->getPhpValues(), '->getPhpValues() converts keys with [] to arrays'); - - $form = $this->createForm('
'); - $this->assertEquals(array('fo.o' => array('ba.r' => 'foo'), 'ba r' => 'bar'), $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names'); - - $form = $this->createForm('
'); - $this->assertEquals(array('fo.o' => array('ba.r' => array('foo', 'ba.z' => 'bar'))), $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names recursively'); - - $form = $this->createForm('
'); - $this->assertEquals(array('foo' => array('bar' => 'foo'), 'bar' => 'bar'), $form->getPhpValues(), "->getPhpValues() doesn't return empty values"); - } - - public function testGetFiles() - { - $form = $this->createForm('
'); - $this->assertEquals(array(), $form->getFiles(), '->getFiles() returns an empty array if method is get'); - - $form = $this->createForm('
'); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for POST'); - - $form = $this->createForm('
', 'put'); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for PUT'); - - $form = $this->createForm('
', 'delete'); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for DELETE'); - - $form = $this->createForm('
', 'patch'); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for PATCH'); - - $form = $this->createForm('
'); - $this->assertEquals(array(), $form->getFiles(), '->getFiles() does not include disabled file fields'); - } - - public function testGetPhpFiles() - { - $form = $this->createForm('
'); - $this->assertEquals(array('foo' => array('bar' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0))), $form->getPhpFiles(), '->getPhpFiles() converts keys with [] to arrays'); - - $form = $this->createForm('
'); - $this->assertEquals(array('f.o o' => array('bar' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0))), $form->getPhpFiles(), '->getPhpFiles() preserves periods and spaces in names'); - - $form = $this->createForm('
'); - $this->assertEquals(array('f.o o' => array('bar' => array('ba.z' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0), array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)))), $form->getPhpFiles(), '->getPhpFiles() preserves periods and spaces in names recursively'); - } - - /** - * @dataProvider provideGetUriValues - */ - public function testGetUri($message, $form, $values, $uri, $method = null) - { - $form = $this->createForm($form, $method); - $form->setValues($values); - - $this->assertEquals('http://example.com'.$uri, $form->getUri(), '->getUri() '.$message); - } - - public function testGetBaseUri() - { - $dom = new \DOMDocument(); - $dom->loadHTML('
'); - - $nodes = $dom->getElementsByTagName('input'); - $form = new Form($nodes->item($nodes->length - 1), 'http://www.foo.com/'); - $this->assertEquals('http://www.foo.com/foo.php', $form->getUri()); - } - - public function testGetUriWithAnchor() - { - $form = $this->createForm('
', null, 'http://example.com/id/123'); - - $this->assertEquals('http://example.com/id/123#foo', $form->getUri()); - } - - public function testGetUriActionAbsolute() - { - $formHtml = '
'; - - $form = $this->createForm($formHtml); - $this->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form->getUri(), '->getUri() returns absolute URIs set in the action form'); - - $form = $this->createForm($formHtml, null, 'https://login.foo.com'); - $this->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form->getUri(), '->getUri() returns absolute URIs set in the action form'); - - $form = $this->createForm($formHtml, null, 'https://login.foo.com/bar/'); - $this->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form->getUri(), '->getUri() returns absolute URIs set in the action form'); - - // The action URI haven't the same domain Host have an another domain as Host - $form = $this->createForm($formHtml, null, 'https://www.foo.com'); - $this->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form->getUri(), '->getUri() returns absolute URIs set in the action form'); - - $form = $this->createForm($formHtml, null, 'https://www.foo.com/bar/'); - $this->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form->getUri(), '->getUri() returns absolute URIs set in the action form'); - } - - public function testGetUriAbsolute() - { - $form = $this->createForm('
', null, 'http://localhost/foo/'); - $this->assertEquals('http://localhost/foo/foo', $form->getUri(), '->getUri() returns absolute URIs'); - - $form = $this->createForm('
', null, 'http://localhost/foo/'); - $this->assertEquals('http://localhost/foo', $form->getUri(), '->getUri() returns absolute URIs'); - } - - public function testGetUriWithOnlyQueryString() - { - $form = $this->createForm('
', null, 'http://localhost/foo/bar'); - $this->assertEquals('http://localhost/foo/bar?get=param', $form->getUri(), '->getUri() returns absolute URIs only if the host has been defined in the constructor'); - } - - public function testGetUriWithoutAction() - { - $form = $this->createForm('
', null, 'http://localhost/foo/bar'); - $this->assertEquals('http://localhost/foo/bar', $form->getUri(), '->getUri() returns path if no action defined'); - } - - public function provideGetUriValues() - { - return array( - array( - 'returns the URI of the form', - '
', - array(), - '/foo', - ), - array( - 'appends the form values if the method is get', - '
', - array(), - '/foo?foo=foo', - ), - array( - 'appends the form values and merges the submitted values', - '
', - array('foo' => 'bar'), - '/foo?foo=bar', - ), - array( - 'does not append values if the method is post', - '
', - array(), - '/foo', - ), - array( - 'does not append values if the method is patch', - '
', - array(), - '/foo', - 'PUT', - ), - array( - 'does not append values if the method is delete', - '
', - array(), - '/foo', - 'DELETE', - ), - array( - 'does not append values if the method is put', - '
', - array(), - '/foo', - 'PATCH', - ), - array( - 'appends the form values to an existing query string', - '
', - array(), - '/foo?bar=bar&foo=foo', - ), - array( - 'replaces query values with the form values', - '
', - array(), - '/foo?bar=foo', - ), - array( - 'returns an empty URI if the action is empty', - '
', - array(), - '/', - ), - array( - 'appends the form values even if the action is empty', - '
', - array(), - '/?foo=foo', - ), - array( - 'chooses the path if the action attribute value is a sharp (#)', - '
', - array(), - '/#', - ), - ); - } - - public function testHas() - { - $form = $this->createForm('
'); - - $this->assertFalse($form->has('foo'), '->has() returns false if a field is not in the form'); - $this->assertTrue($form->has('bar'), '->has() returns true if a field is in the form'); - } - - public function testRemove() - { - $form = $this->createForm('
'); - $form->remove('bar'); - $this->assertFalse($form->has('bar'), '->remove() removes a field'); - } - - public function testGet() - { - $form = $this->createForm('
'); - - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Field\\InputFormField', $form->get('bar'), '->get() returns the field object associated with the given name'); - - try { - $form->get('foo'); - $this->fail('->get() throws an \InvalidArgumentException if the field does not exist'); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true, '->get() throws an \InvalidArgumentException if the field does not exist'); - } - } - - public function testAll() - { - $form = $this->createForm('
'); - - $fields = $form->all(); - $this->assertCount(1, $fields, '->all() return an array of form field objects'); - $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Field\\InputFormField', $fields['bar'], '->all() return an array of form field objects'); - } - - public function testSubmitWithoutAFormButton() - { - $dom = new \DOMDocument(); - $dom->loadHTML(' - -
- - - - '); - - $nodes = $dom->getElementsByTagName('form'); - $form = new Form($nodes->item(0), 'http://example.com'); - $this->assertSame($nodes->item(0), $form->getFormNode(), '->getFormNode() returns the form node associated with this form'); - } - - public function testTypeAttributeIsCaseInsensitive() - { - $form = $this->createForm('
'); - $this->assertTrue($form->has('example.x'), '->has() returns true if the image input was correctly turned into an x and a y fields'); - $this->assertTrue($form->has('example.y'), '->has() returns true if the image input was correctly turned into an x and a y fields'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFormFieldRegistryAddThrowAnExceptionWhenTheNameIsMalformed() - { - $registry = new FormFieldRegistry(); - $registry->add($this->getFormFieldMock('[foo]')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFormFieldRegistryRemoveThrowAnExceptionWhenTheNameIsMalformed() - { - $registry = new FormFieldRegistry(); - $registry->remove('[foo]'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFormFieldRegistryGetThrowAnExceptionWhenTheNameIsMalformed() - { - $registry = new FormFieldRegistry(); - $registry->get('[foo]'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFormFieldRegistryGetThrowAnExceptionWhenTheFieldDoesNotExist() - { - $registry = new FormFieldRegistry(); - $registry->get('foo'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFormFieldRegistrySetThrowAnExceptionWhenTheNameIsMalformed() - { - $registry = new FormFieldRegistry(); - $registry->set('[foo]', null); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFormFieldRegistrySetThrowAnExceptionWhenTheFieldDoesNotExist() - { - $registry = new FormFieldRegistry(); - $registry->set('foo', null); - } - - public function testFormFieldRegistryHasReturnsTrueWhenTheFQNExists() - { - $registry = new FormFieldRegistry(); - $registry->add($this->getFormFieldMock('foo[bar]')); - - $this->assertTrue($registry->has('foo')); - $this->assertTrue($registry->has('foo[bar]')); - $this->assertFalse($registry->has('bar')); - $this->assertFalse($registry->has('foo[foo]')); - } - - public function testFormRegistryFieldsCanBeRemoved() - { - $registry = new FormFieldRegistry(); - $registry->add($this->getFormFieldMock('foo')); - $registry->remove('foo'); - $this->assertFalse($registry->has('foo')); - } - - public function testFormRegistrySupportsMultivaluedFields() - { - $registry = new FormFieldRegistry(); - $registry->add($this->getFormFieldMock('foo[]')); - $registry->add($this->getFormFieldMock('foo[]')); - $registry->add($this->getFormFieldMock('bar[5]')); - $registry->add($this->getFormFieldMock('bar[]')); - $registry->add($this->getFormFieldMock('bar[baz]')); - - $this->assertEquals( - array('foo[0]', 'foo[1]', 'bar[5]', 'bar[6]', 'bar[baz]'), - array_keys($registry->all()) - ); - } - - public function testFormRegistrySetValues() - { - $registry = new FormFieldRegistry(); - $registry->add($f2 = $this->getFormFieldMock('foo[2]')); - $registry->add($f3 = $this->getFormFieldMock('foo[3]')); - $registry->add($fbb = $this->getFormFieldMock('foo[bar][baz]')); - - $f2 - ->expects($this->exactly(2)) - ->method('setValue') - ->with(2) - ; - - $f3 - ->expects($this->exactly(2)) - ->method('setValue') - ->with(3) - ; - - $fbb - ->expects($this->exactly(2)) - ->method('setValue') - ->with('fbb') - ; - - $registry->set('foo[2]', 2); - $registry->set('foo[3]', 3); - $registry->set('foo[bar][baz]', 'fbb'); - - $registry->set('foo', array( - 2 => 2, - 3 => 3, - 'bar' => array( - 'baz' => 'fbb', - ), - )); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Cannot set value on a compound field "foo[bar]". - */ - public function testFormRegistrySetValueOnCompoundField() - { - $registry = new FormFieldRegistry(); - $registry->add($this->getFormFieldMock('foo[bar][baz]')); - - $registry->set('foo[bar]', 'fbb'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unreachable field "0" - */ - public function testFormRegistrySetArrayOnNotCompoundField() - { - $registry = new FormFieldRegistry(); - $registry->add($this->getFormFieldMock('bar')); - - $registry->set('bar', array('baz')); - } - - public function testDifferentFieldTypesWithSameName() - { - $dom = new \DOMDocument(); - $dom->loadHTML(' - - -
- - - - - - - - - - '); - $form = new Form($dom->getElementsByTagName('form')->item(0), 'http://example.com'); - - $this->assertInstanceOf('Symfony\Component\DomCrawler\Field\ChoiceFormField', $form->get('option')); - } - - protected function getFormFieldMock($name, $value = null) - { - $field = $this - ->getMockBuilder('Symfony\\Component\\DomCrawler\\Field\\FormField') - ->setMethods(array('getName', 'getValue', 'setValue', 'initialize')) - ->disableOriginalConstructor() - ->getMock() - ; - - $field - ->expects($this->any()) - ->method('getName') - ->will($this->returnValue($name)) - ; - - $field - ->expects($this->any()) - ->method('getValue') - ->will($this->returnValue($value)) - ; - - return $field; - } - - protected function createForm($form, $method = null, $currentUri = null) - { - $dom = new \DOMDocument(); - $dom->loadHTML(''.$form.''); - - $xPath = new \DOMXPath($dom); - $nodes = $xPath->query('//input | //button'); - - if (null === $currentUri) { - $currentUri = 'http://example.com/'; - } - - return new Form($nodes->item($nodes->length - 1), $currentUri, $method); - } - - protected function createTestHtml5Form() - { - $dom = new \DOMDocument(); - $dom->loadHTML(' - -

Hello form

-
-
- -
- - - - -
-
-
- - - -
- -
- -
-
-
- - -
- - - -
-
-
- - - - -

- {% for row in items|batch(3, 'No item') %} - - {% for column in row %} - - {% endfor %} - - {% endfor %} -
{{ column }}
- -The above example will be rendered as: - -.. code-block:: jinja - - - - - - - - - - - - - - - - - -
abc
def
gNo itemNo item
- -Arguments ---------- - -* ``size``: The size of the batch; fractional numbers will be rounded up -* ``fill``: Used to fill in missing items diff --git a/vendor/twig/twig/doc/filters/capitalize.rst b/vendor/twig/twig/doc/filters/capitalize.rst deleted file mode 100644 index 10546a1..0000000 --- a/vendor/twig/twig/doc/filters/capitalize.rst +++ /dev/null @@ -1,11 +0,0 @@ -``capitalize`` -============== - -The ``capitalize`` filter capitalizes a value. The first character will be -uppercase, all others lowercase: - -.. code-block:: jinja - - {{ 'my first car'|capitalize }} - - {# outputs 'My first car' #} diff --git a/vendor/twig/twig/doc/filters/convert_encoding.rst b/vendor/twig/twig/doc/filters/convert_encoding.rst deleted file mode 100644 index f4ebe58..0000000 --- a/vendor/twig/twig/doc/filters/convert_encoding.rst +++ /dev/null @@ -1,28 +0,0 @@ -``convert_encoding`` -==================== - -.. versionadded:: 1.4 - The ``convert_encoding`` filter was added in Twig 1.4. - -The ``convert_encoding`` filter converts a string from one encoding to -another. The first argument is the expected output charset and the second one -is the input charset: - -.. code-block:: jinja - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - -.. note:: - - This filter relies on the `iconv`_ or `mbstring`_ extension, so one of - them must be installed. In case both are installed, `mbstring`_ is used by - default (Twig before 1.8.1 uses `iconv`_ by default). - -Arguments ---------- - -* ``to``: The output charset -* ``from``: The input charset - -.. _`iconv`: http://php.net/iconv -.. _`mbstring`: http://php.net/mbstring diff --git a/vendor/twig/twig/doc/filters/date.rst b/vendor/twig/twig/doc/filters/date.rst deleted file mode 100644 index c86d42b..0000000 --- a/vendor/twig/twig/doc/filters/date.rst +++ /dev/null @@ -1,94 +0,0 @@ -``date`` -======== - -.. versionadded:: 1.1 - The timezone support has been added in Twig 1.1. - -.. versionadded:: 1.5 - The default date format support has been added in Twig 1.5. - -.. versionadded:: 1.6.1 - The default timezone support has been added in Twig 1.6.1. - -.. versionadded:: 1.11.0 - The introduction of the false value for the timezone was introduced in Twig 1.11.0 - -The ``date`` filter formats a date to a given format: - -.. code-block:: jinja - - {{ post.published_at|date("m/d/Y") }} - -The format specifier is the same as supported by `date`_, -except when the filtered data is of type `DateInterval`_, when the format must conform to -`DateInterval::format`_ instead. - -The ``date`` filter accepts strings (it must be in a format supported by the -`strtotime`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For -instance, to display the current date, filter the word "now": - -.. code-block:: jinja - - {{ "now"|date("m/d/Y") }} - -To escape words and characters in the date format use ``\\`` in front of each -character: - -.. code-block:: jinja - - {{ post.published_at|date("F jS \\a\\t g:ia") }} - -If the value passed to the ``date`` filter is ``null``, it will return the -current date by default. If an empty string is desired instead of the current -date, use a ternary operator: - -.. code-block:: jinja - - {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }} - -If no format is provided, Twig will use the default one: ``F j, Y H:i``. This -default can be easily changed by calling the ``setDateFormat()`` method on the -``core`` extension instance. The first argument is the default format for -dates and the second one is the default format for date intervals: - -.. code-block:: php - - $twig = new Twig_Environment($loader); - $twig->getExtension('core')->setDateFormat('d/m/Y', '%d days'); - -Timezone --------- - -By default, the date is displayed by applying the default timezone (the one -specified in php.ini or declared in Twig -- see below), but you can override -it by explicitly specifying a timezone: - -.. code-block:: jinja - - {{ post.published_at|date("m/d/Y", "Europe/Paris") }} - -If the date is already a DateTime object, and if you want to keep its current -timezone, pass ``false`` as the timezone value: - -.. code-block:: jinja - - {{ post.published_at|date("m/d/Y", false) }} - -The default timezone can also be set globally by calling ``setTimezone()``: - -.. code-block:: php - - $twig = new Twig_Environment($loader); - $twig->getExtension('core')->setTimezone('Europe/Paris'); - -Arguments ---------- - -* ``format``: The date format -* ``timezone``: The date timezone - -.. _`strtotime`: http://www.php.net/strtotime -.. _`DateTime`: http://www.php.net/DateTime -.. _`DateInterval`: http://www.php.net/DateInterval -.. _`date`: http://www.php.net/date -.. _`DateInterval::format`: http://www.php.net/DateInterval.format diff --git a/vendor/twig/twig/doc/filters/date_modify.rst b/vendor/twig/twig/doc/filters/date_modify.rst deleted file mode 100644 index add40b5..0000000 --- a/vendor/twig/twig/doc/filters/date_modify.rst +++ /dev/null @@ -1,23 +0,0 @@ -``date_modify`` -=============== - -.. versionadded:: 1.9.0 - The date_modify filter has been added in Twig 1.9.0. - -The ``date_modify`` filter modifies a date with a given modifier string: - -.. code-block:: jinja - - {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }} - -The ``date_modify`` filter accepts strings (it must be in a format supported -by the `strtotime`_ function) or `DateTime`_ instances. You can easily combine -it with the :doc:`date` filter for formatting. - -Arguments ---------- - -* ``modifier``: The modifier - -.. _`strtotime`: http://www.php.net/strtotime -.. _`DateTime`: http://www.php.net/DateTime diff --git a/vendor/twig/twig/doc/filters/default.rst b/vendor/twig/twig/doc/filters/default.rst deleted file mode 100644 index 641ac6e..0000000 --- a/vendor/twig/twig/doc/filters/default.rst +++ /dev/null @@ -1,33 +0,0 @@ -``default`` -=========== - -The ``default`` filter returns the passed default value if the value is -undefined or empty, otherwise the value of the variable: - -.. code-block:: jinja - - {{ var|default('var is not defined') }} - - {{ var.foo|default('foo item on var is not defined') }} - - {{ var['foo']|default('foo item on var is not defined') }} - - {{ ''|default('passed var is empty') }} - -When using the ``default`` filter on an expression that uses variables in some -method calls, be sure to use the ``default`` filter whenever a variable can be -undefined: - -.. code-block:: jinja - - {{ var.method(foo|default('foo'))|default('foo') }} - -.. note:: - - Read the documentation for the :doc:`defined<../tests/defined>` and - :doc:`empty<../tests/empty>` tests to learn more about their semantics. - -Arguments ---------- - -* ``default``: The default value diff --git a/vendor/twig/twig/doc/filters/escape.rst b/vendor/twig/twig/doc/filters/escape.rst deleted file mode 100644 index fc9771a..0000000 --- a/vendor/twig/twig/doc/filters/escape.rst +++ /dev/null @@ -1,116 +0,0 @@ -``escape`` -========== - -.. versionadded:: 1.9.0 - The ``css``, ``url``, and ``html_attr`` strategies were added in Twig - 1.9.0. - -.. versionadded:: 1.14.0 - The ability to define custom escapers was added in Twig 1.14.0. - -The ``escape`` filter escapes a string for safe insertion into the final -output. It supports different escaping strategies depending on the template -context. - -By default, it uses the HTML escaping strategy: - -.. code-block:: jinja - - {{ user.username|escape }} - -For convenience, the ``e`` filter is defined as an alias: - -.. code-block:: jinja - - {{ user.username|e }} - -The ``escape`` filter can also be used in other contexts than HTML thanks to -an optional argument which defines the escaping strategy to use: - -.. code-block:: jinja - - {{ user.username|e }} - {# is equivalent to #} - {{ user.username|e('html') }} - -And here is how to escape variables included in JavaScript code: - -.. code-block:: jinja - - {{ user.username|escape('js') }} - {{ user.username|e('js') }} - -The ``escape`` filter supports the following escaping strategies: - -* ``html``: escapes a string for the **HTML body** context. - -* ``js``: escapes a string for the **JavaScript context**. - -* ``css``: escapes a string for the **CSS context**. CSS escaping can be - applied to any string being inserted into CSS and escapes everything except - alphanumerics. - -* ``url``: escapes a string for the **URI or parameter contexts**. This should - not be used to escape an entire URI; only a subcomponent being inserted. - -* ``html_attr``: escapes a string for the **HTML attribute** context. - -.. note:: - - Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function - for the HTML escaping strategy. - -.. caution:: - - When using automatic escaping, Twig tries to not double-escape a variable - when the automatic escaping strategy is the same as the one applied by the - escape filter; but that does not work when using a variable as the - escaping strategy: - - .. code-block:: jinja - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape('html') }} {# won't be double-escaped #} - {{ var|escape(strategy) }} {# will be double-escaped #} - {% endautoescape %} - - When using a variable as the escaping strategy, you should disable - automatic escaping: - - .. code-block:: jinja - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape(strategy)|raw }} {# won't be double-escaped #} - {% endautoescape %} - -Custom Escapers ---------------- - -You can define custom escapers by calling the ``setEscaper()`` method on the -``core`` extension instance. The first argument is the escaper name (to be -used in the ``escape`` call) and the second one must be a valid PHP callable: - -.. code-block:: php - - $twig = new Twig_Environment($loader); - $twig->getExtension('core')->setEscaper('csv', 'csv_escaper')); - -When called by Twig, the callable receives the Twig environment instance, the -string to escape, and the charset. - -.. note:: - - Built-in escapers cannot be overridden mainly they should be considered as - the final implementation and also for better performance. - -Arguments ---------- - -* ``strategy``: The escaping strategy -* ``charset``: The string charset - -.. _`htmlspecialchars`: http://php.net/htmlspecialchars diff --git a/vendor/twig/twig/doc/filters/first.rst b/vendor/twig/twig/doc/filters/first.rst deleted file mode 100644 index 674c1f9..0000000 --- a/vendor/twig/twig/doc/filters/first.rst +++ /dev/null @@ -1,25 +0,0 @@ -``first`` -========= - -.. versionadded:: 1.12.2 - The ``first`` filter was added in Twig 1.12.2. - -The ``first`` filter returns the first "element" of a sequence, a mapping, or -a string: - -.. code-block:: jinja - - {{ [1, 2, 3, 4]|first }} - {# outputs 1 #} - - {{ { a: 1, b: 2, c: 3, d: 4 }|first }} - {# outputs 1 #} - - {{ '1234'|first }} - {# outputs 1 #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -.. _`Traversable`: http://php.net/manual/en/class.traversable.php diff --git a/vendor/twig/twig/doc/filters/format.rst b/vendor/twig/twig/doc/filters/format.rst deleted file mode 100644 index f8effd9..0000000 --- a/vendor/twig/twig/doc/filters/format.rst +++ /dev/null @@ -1,16 +0,0 @@ -``format`` -========== - -The ``format`` filter formats a given string by replacing the placeholders -(placeholders follows the `sprintf`_ notation): - -.. code-block:: jinja - - {{ "I like %s and %s."|format(foo, "bar") }} - - {# outputs I like foo and bar - if the foo parameter equals to the foo string. #} - -.. _`sprintf`: http://www.php.net/sprintf - -.. seealso:: :doc:`replace` diff --git a/vendor/twig/twig/doc/filters/index.rst b/vendor/twig/twig/doc/filters/index.rst deleted file mode 100644 index 8daa961..0000000 --- a/vendor/twig/twig/doc/filters/index.rst +++ /dev/null @@ -1,37 +0,0 @@ -Filters -======= - -.. toctree:: - :maxdepth: 1 - - abs - batch - capitalize - convert_encoding - date - date_modify - default - escape - first - format - join - json_encode - keys - last - length - lower - merge - nl2br - number_format - raw - replace - reverse - round - slice - sort - split - striptags - title - trim - upper - url_encode diff --git a/vendor/twig/twig/doc/filters/join.rst b/vendor/twig/twig/doc/filters/join.rst deleted file mode 100644 index 2fab945..0000000 --- a/vendor/twig/twig/doc/filters/join.rst +++ /dev/null @@ -1,23 +0,0 @@ -``join`` -======== - -The ``join`` filter returns a string which is the concatenation of the items -of a sequence: - -.. code-block:: jinja - - {{ [1, 2, 3]|join }} - {# returns 123 #} - -The separator between elements is an empty string per default, but you can -define it with the optional first parameter: - -.. code-block:: jinja - - {{ [1, 2, 3]|join('|') }} - {# outputs 1|2|3 #} - -Arguments ---------- - -* ``glue``: The separator diff --git a/vendor/twig/twig/doc/filters/json_encode.rst b/vendor/twig/twig/doc/filters/json_encode.rst deleted file mode 100644 index a39bb47..0000000 --- a/vendor/twig/twig/doc/filters/json_encode.rst +++ /dev/null @@ -1,21 +0,0 @@ -``json_encode`` -=============== - -The ``json_encode`` filter returns the JSON representation of a value: - -.. code-block:: jinja - - {{ data|json_encode() }} - -.. note:: - - Internally, Twig uses the PHP `json_encode`_ function. - -Arguments ---------- - -* ``options``: A bitmask of `json_encode options`_ (``{{ - data|json_encode(constant('JSON_PRETTY_PRINT')) }}``) - -.. _`json_encode`: http://php.net/json_encode -.. _`json_encode options`: http://www.php.net/manual/en/json.constants.php diff --git a/vendor/twig/twig/doc/filters/keys.rst b/vendor/twig/twig/doc/filters/keys.rst deleted file mode 100644 index e4f090c..0000000 --- a/vendor/twig/twig/doc/filters/keys.rst +++ /dev/null @@ -1,11 +0,0 @@ -``keys`` -======== - -The ``keys`` filter returns the keys of an array. It is useful when you want to -iterate over the keys of an array: - -.. code-block:: jinja - - {% for key in array|keys %} - ... - {% endfor %} diff --git a/vendor/twig/twig/doc/filters/last.rst b/vendor/twig/twig/doc/filters/last.rst deleted file mode 100644 index 345b657..0000000 --- a/vendor/twig/twig/doc/filters/last.rst +++ /dev/null @@ -1,25 +0,0 @@ -``last`` -======== - -.. versionadded:: 1.12.2 - The ``last`` filter was added in Twig 1.12.2. - -The ``last`` filter returns the last "element" of a sequence, a mapping, or -a string: - -.. code-block:: jinja - - {{ [1, 2, 3, 4]|last }} - {# outputs 4 #} - - {{ { a: 1, b: 2, c: 3, d: 4 }|last }} - {# outputs 4 #} - - {{ '1234'|last }} - {# outputs 4 #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -.. _`Traversable`: http://php.net/manual/en/class.traversable.php diff --git a/vendor/twig/twig/doc/filters/length.rst b/vendor/twig/twig/doc/filters/length.rst deleted file mode 100644 index 1f783b3..0000000 --- a/vendor/twig/twig/doc/filters/length.rst +++ /dev/null @@ -1,11 +0,0 @@ -``length`` -========== - -The ``length`` filter returns the number of items of a sequence or mapping, or -the length of a string: - -.. code-block:: jinja - - {% if users|length > 10 %} - ... - {% endif %} diff --git a/vendor/twig/twig/doc/filters/lower.rst b/vendor/twig/twig/doc/filters/lower.rst deleted file mode 100644 index ef9faa9..0000000 --- a/vendor/twig/twig/doc/filters/lower.rst +++ /dev/null @@ -1,10 +0,0 @@ -``lower`` -========= - -The ``lower`` filter converts a value to lowercase: - -.. code-block:: jinja - - {{ 'WELCOME'|lower }} - - {# outputs 'welcome' #} diff --git a/vendor/twig/twig/doc/filters/merge.rst b/vendor/twig/twig/doc/filters/merge.rst deleted file mode 100644 index 88780dd..0000000 --- a/vendor/twig/twig/doc/filters/merge.rst +++ /dev/null @@ -1,48 +0,0 @@ -``merge`` -========= - -The ``merge`` filter merges an array with another array: - -.. code-block:: jinja - - {% set values = [1, 2] %} - - {% set values = values|merge(['apple', 'orange']) %} - - {# values now contains [1, 2, 'apple', 'orange'] #} - -New values are added at the end of the existing ones. - -The ``merge`` filter also works on hashes: - -.. code-block:: jinja - - {% set items = { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'unknown' } %} - - {% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %} - - {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'renault': 'car' } #} - -For hashes, the merging process occurs on the keys: if the key does not -already exist, it is added but if the key already exists, its value is -overridden. - -.. tip:: - - If you want to ensure that some values are defined in an array (by given - default values), reverse the two elements in the call: - - .. code-block:: jinja - - {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} - - {% set items = { 'apple': 'unknown' }|merge(items) %} - - {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #} - -.. note:: - - Internally, Twig uses the PHP `array_merge`_ function. It supports - Traversable objects by transforming those to arrays. - -.. _`array_merge`: http://php.net/array_merge diff --git a/vendor/twig/twig/doc/filters/nl2br.rst b/vendor/twig/twig/doc/filters/nl2br.rst deleted file mode 100644 index 5c923e1..0000000 --- a/vendor/twig/twig/doc/filters/nl2br.rst +++ /dev/null @@ -1,22 +0,0 @@ -``nl2br`` -========= - -.. versionadded:: 1.5 - The ``nl2br`` filter was added in Twig 1.5. - -The ``nl2br`` filter inserts HTML line breaks before all newlines in a string: - -.. code-block:: jinja - - {{ "I like Twig.\nYou will like it too."|nl2br }} - {# outputs - - I like Twig.
- You will like it too. - - #} - -.. note:: - - The ``nl2br`` filter pre-escapes the input before applying the - transformation. diff --git a/vendor/twig/twig/doc/filters/number_format.rst b/vendor/twig/twig/doc/filters/number_format.rst deleted file mode 100644 index 3114e84..0000000 --- a/vendor/twig/twig/doc/filters/number_format.rst +++ /dev/null @@ -1,45 +0,0 @@ -``number_format`` -================= - -.. versionadded:: 1.5 - The ``number_format`` filter was added in Twig 1.5 - -The ``number_format`` filter formats numbers. It is a wrapper around PHP's -`number_format`_ function: - -.. code-block:: jinja - - {{ 200.35|number_format }} - -You can control the number of decimal places, decimal point, and thousands -separator using the additional arguments: - -.. code-block:: jinja - - {{ 9800.333|number_format(2, '.', ',') }} - -If no formatting options are provided then Twig will use the default formatting -options of: - -* 0 decimal places. -* ``.`` as the decimal point. -* ``,`` as the thousands separator. - -These defaults can be easily changed through the core extension: - -.. code-block:: php - - $twig = new Twig_Environment($loader); - $twig->getExtension('core')->setNumberFormat(3, '.', ','); - -The defaults set for ``number_format`` can be over-ridden upon each call using the -additional parameters. - -Arguments ---------- - -* ``decimal``: The number of decimal points to display -* ``decimal_point``: The character(s) to use for the decimal point -* ``thousand_sep``: The character(s) to use for the thousands separator - -.. _`number_format`: http://php.net/number_format diff --git a/vendor/twig/twig/doc/filters/raw.rst b/vendor/twig/twig/doc/filters/raw.rst deleted file mode 100644 index e5e5b12..0000000 --- a/vendor/twig/twig/doc/filters/raw.rst +++ /dev/null @@ -1,36 +0,0 @@ -``raw`` -======= - -The ``raw`` filter marks the value as being "safe", which means that in an -environment with automatic escaping enabled this variable will not be escaped -if ``raw`` is the last filter applied to it: - -.. code-block:: jinja - - {% autoescape %} - {{ var|raw }} {# var won't be escaped #} - {% endautoescape %} - -.. note:: - - Be careful when using the ``raw`` filter inside expressions: - - .. code-block:: jinja - - {% autoescape %} - {% set hello = 'Hello' %} - {% set hola = 'Hola' %} - - {{ false ? 'Hola' : hello|raw }} - does not render the same as - {{ false ? hola : hello|raw }} - but renders the same as - {{ (false ? hola : hello)|raw }} - {% endautoescape %} - - The first ternary statement is not escaped: ``hello`` is marked as being - safe and Twig does not escape static values (see - :doc:`escape<../tags/autoescape>`). In the second ternary statement, even - if ``hello`` is marked as safe, ``hola`` remains unsafe and so is the whole - expression. The third ternary statement is marked as safe and the result is - not escaped. diff --git a/vendor/twig/twig/doc/filters/replace.rst b/vendor/twig/twig/doc/filters/replace.rst deleted file mode 100644 index 1227957..0000000 --- a/vendor/twig/twig/doc/filters/replace.rst +++ /dev/null @@ -1,19 +0,0 @@ -``replace`` -=========== - -The ``replace`` filter formats a given string by replacing the placeholders -(placeholders are free-form): - -.. code-block:: jinja - - {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }} - - {# outputs I like foo and bar - if the foo parameter equals to the foo string. #} - -Arguments ---------- - -* ``replace_pairs``: The placeholder values - -.. seealso:: :doc:`format` diff --git a/vendor/twig/twig/doc/filters/reverse.rst b/vendor/twig/twig/doc/filters/reverse.rst deleted file mode 100644 index 76fd2c1..0000000 --- a/vendor/twig/twig/doc/filters/reverse.rst +++ /dev/null @@ -1,47 +0,0 @@ -``reverse`` -=========== - -.. versionadded:: 1.6 - Support for strings has been added in Twig 1.6. - -The ``reverse`` filter reverses a sequence, a mapping, or a string: - -.. code-block:: jinja - - {% for user in users|reverse %} - ... - {% endfor %} - - {{ '1234'|reverse }} - - {# outputs 4321 #} - -.. tip:: - - For sequences and mappings, numeric keys are not preserved. To reverse - them as well, pass ``true`` as an argument to the ``reverse`` filter: - - .. code-block:: jinja - - {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse %} - {{ key }}: {{ value }} - {%- endfor %} - - {# output: 0: c 1: b 2: a #} - - {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse(true) %} - {{ key }}: {{ value }} - {%- endfor %} - - {# output: 3: c 2: b 1: a #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -Arguments ---------- - -* ``preserve_keys``: Preserve keys when reversing a mapping or a sequence. - -.. _`Traversable`: http://php.net/Traversable diff --git a/vendor/twig/twig/doc/filters/round.rst b/vendor/twig/twig/doc/filters/round.rst deleted file mode 100644 index 2521cf1..0000000 --- a/vendor/twig/twig/doc/filters/round.rst +++ /dev/null @@ -1,37 +0,0 @@ -``round`` -========= - -.. versionadded:: 1.15.0 - The ``round`` filter was added in Twig 1.15.0. - -The ``round`` filter rounds a number to a given precision: - -.. code-block:: jinja - - {{ 42.55|round }} - {# outputs 43 #} - - {{ 42.55|round(1, 'floor') }} - {# outputs 42.5 #} - -The ``round`` filter takes two optional arguments; the first one specifies the -precision (default is ``0``) and the second the rounding method (default is -``common``): - -* ``common`` rounds either up or down (rounds the value up to precision decimal - places away from zero, when it is half way there -- making 1.5 into 2 and - -1.5 into -2); - -* ``ceil`` always rounds up; - -* ``floor`` always rounds down. - -.. note:: - - The ``//`` operator is equivalent to ``|round(0, 'floor')``. - -Arguments ---------- - -* ``precision``: The rounding precision -* ``method``: The rounding method diff --git a/vendor/twig/twig/doc/filters/slice.rst b/vendor/twig/twig/doc/filters/slice.rst deleted file mode 100644 index 70bf139..0000000 --- a/vendor/twig/twig/doc/filters/slice.rst +++ /dev/null @@ -1,71 +0,0 @@ -``slice`` -=========== - -.. versionadded:: 1.6 - The ``slice`` filter was added in Twig 1.6. - -The ``slice`` filter extracts a slice of a sequence, a mapping, or a string: - -.. code-block:: jinja - - {% for i in [1, 2, 3, 4, 5]|slice(1, 2) %} - {# will iterate over 2 and 3 #} - {% endfor %} - - {{ '12345'|slice(1, 2) }} - - {# outputs 23 #} - -You can use any valid expression for both the start and the length: - -.. code-block:: jinja - - {% for i in [1, 2, 3, 4, 5]|slice(start, length) %} - {# ... #} - {% endfor %} - -As syntactic sugar, you can also use the ``[]`` notation: - -.. code-block:: jinja - - {% for i in [1, 2, 3, 4, 5][start:length] %} - {# ... #} - {% endfor %} - - {{ '12345'[1:2] }} {# will display "23" #} - - {# you can omit the first argument -- which is the same as 0 #} - {{ '12345'[:2] }} {# will display "12" #} - - {# you can omit the last argument -- which will select everything till the end #} - {{ '12345'[2:] }} {# will display "345" #} - -The ``slice`` filter works as the `array_slice`_ PHP function for arrays and -`mb_substr`_ for strings with a fallback to `substr`_. - -If the start is non-negative, the sequence will start at that start in the -variable. If start is negative, the sequence will start that far from the end -of the variable. - -If length is given and is positive, then the sequence will have up to that -many elements in it. If the variable is shorter than the length, then only the -available variable elements will be present. If length is given and is -negative then the sequence will stop that many elements from the end of the -variable. If it is omitted, then the sequence will have everything from offset -up until the end of the variable. - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -Arguments ---------- - -* ``start``: The start of the slice -* ``length``: The size of the slice -* ``preserve_keys``: Whether to preserve key or not (when the input is an array) - -.. _`Traversable`: http://php.net/manual/en/class.traversable.php -.. _`array_slice`: http://php.net/array_slice -.. _`mb_substr` : http://php.net/mb-substr -.. _`substr`: http://php.net/substr diff --git a/vendor/twig/twig/doc/filters/sort.rst b/vendor/twig/twig/doc/filters/sort.rst deleted file mode 100644 index 350207f..0000000 --- a/vendor/twig/twig/doc/filters/sort.rst +++ /dev/null @@ -1,18 +0,0 @@ -``sort`` -======== - -The ``sort`` filter sorts an array: - -.. code-block:: jinja - - {% for user in users|sort %} - ... - {% endfor %} - -.. note:: - - Internally, Twig uses the PHP `asort`_ function to maintain index - association. It supports Traversable objects by transforming - those to arrays. - -.. _`asort`: http://php.net/asort diff --git a/vendor/twig/twig/doc/filters/split.rst b/vendor/twig/twig/doc/filters/split.rst deleted file mode 100644 index bbc6d79..0000000 --- a/vendor/twig/twig/doc/filters/split.rst +++ /dev/null @@ -1,53 +0,0 @@ -``split`` -========= - -.. versionadded:: 1.10.3 - The ``split`` filter was added in Twig 1.10.3. - -The ``split`` filter splits a string by the given delimiter and returns a list -of strings: - -.. code-block:: jinja - - {% set foo = "one,two,three"|split(',') %} - {# foo contains ['one', 'two', 'three'] #} - -You can also pass a ``limit`` argument: - - * If ``limit`` is positive, the returned array will contain a maximum of - limit elements with the last element containing the rest of string; - - * If ``limit`` is negative, all components except the last -limit are - returned; - - * If ``limit`` is zero, then this is treated as 1. - -.. code-block:: jinja - - {% set foo = "one,two,three,four,five"|split(',', 3) %} - {# foo contains ['one', 'two', 'three,four,five'] #} - -If the ``delimiter`` is an empty string, then value will be split by equal -chunks. Length is set by the ``limit`` argument (one character by default). - -.. code-block:: jinja - - {% set foo = "123"|split('') %} - {# foo contains ['1', '2', '3'] #} - - {% set bar = "aabbcc"|split('', 2) %} - {# bar contains ['aa', 'bb', 'cc'] #} - -.. note:: - - Internally, Twig uses the PHP `explode`_ or `str_split`_ (if delimiter is - empty) functions for string splitting. - -Arguments ---------- - -* ``delimiter``: The delimiter -* ``limit``: The limit argument - -.. _`explode`: http://php.net/explode -.. _`str_split`: http://php.net/str_split diff --git a/vendor/twig/twig/doc/filters/striptags.rst b/vendor/twig/twig/doc/filters/striptags.rst deleted file mode 100644 index 72c6f25..0000000 --- a/vendor/twig/twig/doc/filters/striptags.rst +++ /dev/null @@ -1,15 +0,0 @@ -``striptags`` -============= - -The ``striptags`` filter strips SGML/XML tags and replace adjacent whitespace -by one space: - -.. code-block:: jinja - - {{ some_html|striptags }} - -.. note:: - - Internally, Twig uses the PHP `strip_tags`_ function. - -.. _`strip_tags`: http://php.net/strip_tags diff --git a/vendor/twig/twig/doc/filters/title.rst b/vendor/twig/twig/doc/filters/title.rst deleted file mode 100644 index c5a318e..0000000 --- a/vendor/twig/twig/doc/filters/title.rst +++ /dev/null @@ -1,11 +0,0 @@ -``title`` -========= - -The ``title`` filter returns a titlecased version of the value. Words will -start with uppercase letters, all remaining characters are lowercase: - -.. code-block:: jinja - - {{ 'my first car'|title }} - - {# outputs 'My First Car' #} diff --git a/vendor/twig/twig/doc/filters/trim.rst b/vendor/twig/twig/doc/filters/trim.rst deleted file mode 100644 index 4ddb208..0000000 --- a/vendor/twig/twig/doc/filters/trim.rst +++ /dev/null @@ -1,29 +0,0 @@ -``trim`` -======== - -.. versionadded:: 1.6.2 - The ``trim`` filter was added in Twig 1.6.2. - -The ``trim`` filter strips whitespace (or other characters) from the beginning -and end of a string: - -.. code-block:: jinja - - {{ ' I like Twig. '|trim }} - - {# outputs 'I like Twig.' #} - - {{ ' I like Twig.'|trim('.') }} - - {# outputs ' I like Twig' #} - -.. note:: - - Internally, Twig uses the PHP `trim`_ function. - -Arguments ---------- - -* ``character_mask``: The characters to strip - -.. _`trim`: http://php.net/trim diff --git a/vendor/twig/twig/doc/filters/upper.rst b/vendor/twig/twig/doc/filters/upper.rst deleted file mode 100644 index 561cebe..0000000 --- a/vendor/twig/twig/doc/filters/upper.rst +++ /dev/null @@ -1,10 +0,0 @@ -``upper`` -========= - -The ``upper`` filter converts a value to uppercase: - -.. code-block:: jinja - - {{ 'welcome'|upper }} - - {# outputs 'WELCOME' #} diff --git a/vendor/twig/twig/doc/filters/url_encode.rst b/vendor/twig/twig/doc/filters/url_encode.rst deleted file mode 100644 index 5944e59..0000000 --- a/vendor/twig/twig/doc/filters/url_encode.rst +++ /dev/null @@ -1,34 +0,0 @@ -``url_encode`` -============== - -.. versionadded:: 1.12.3 - Support for encoding an array as query string was added in Twig 1.12.3. - -.. versionadded:: 1.16.0 - The ``raw`` argument was removed in Twig 1.16.0. Twig now always encodes - according to RFC 3986. - -The ``url_encode`` filter percent encodes a given string as URL segment -or an array as query string: - -.. code-block:: jinja - - {{ "path-seg*ment"|url_encode }} - {# outputs "path-seg%2Ament" #} - - {{ "string with spaces"|url_encode }} - {# outputs "string%20with%20spaces" #} - - {{ {'param': 'value', 'foo': 'bar'}|url_encode }} - {# outputs "param=value&foo=bar" #} - -.. note:: - - Internally, Twig uses the PHP `urlencode`_ (or `rawurlencode`_ if you pass - ``true`` as the first parameter) or the `http_build_query`_ function. Note - that as of Twig 1.16.0, ``urlencode`` **always** uses ``rawurlencode`` (the - ``raw`` argument was removed.) - -.. _`urlencode`: http://php.net/urlencode -.. _`rawurlencode`: http://php.net/rawurlencode -.. _`http_build_query`: http://php.net/http_build_query diff --git a/vendor/twig/twig/doc/functions/attribute.rst b/vendor/twig/twig/doc/functions/attribute.rst deleted file mode 100644 index ceba96b..0000000 --- a/vendor/twig/twig/doc/functions/attribute.rst +++ /dev/null @@ -1,26 +0,0 @@ -``attribute`` -============= - -.. versionadded:: 1.2 - The ``attribute`` function was added in Twig 1.2. - -The ``attribute`` function can be used to access a "dynamic" attribute of a -variable: - -.. code-block:: jinja - - {{ attribute(object, method) }} - {{ attribute(object, method, arguments) }} - {{ attribute(array, item) }} - -In addition, the ``defined`` test can check for the existence of a dynamic -attribute: - -.. code-block:: jinja - - {{ attribute(object, method) is defined ? 'Method exists' : 'Method does not exist' }} - -.. note:: - - The resolution algorithm is the same as the one used for the ``.`` - notation, except that the item can be any valid expression. diff --git a/vendor/twig/twig/doc/functions/block.rst b/vendor/twig/twig/doc/functions/block.rst deleted file mode 100644 index fd571ef..0000000 --- a/vendor/twig/twig/doc/functions/block.rst +++ /dev/null @@ -1,15 +0,0 @@ -``block`` -========= - -When a template uses inheritance and if you want to print a block multiple -times, use the ``block`` function: - -.. code-block:: jinja - - {% block title %}{% endblock %} - -

{{ block('title') }}

- - {% block body %}{% endblock %} - -.. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>` diff --git a/vendor/twig/twig/doc/functions/constant.rst b/vendor/twig/twig/doc/functions/constant.rst deleted file mode 100644 index bea0e9f..0000000 --- a/vendor/twig/twig/doc/functions/constant.rst +++ /dev/null @@ -1,18 +0,0 @@ -``constant`` -============ - -.. versionadded: 1.12.1 - constant now accepts object instances as the second argument. - -``constant`` returns the constant value for a given string: - -.. code-block:: jinja - - {{ some_date|date(constant('DATE_W3C')) }} - {{ constant('Namespace\\Classname::CONSTANT_NAME') }} - -As of 1.12.1 you can read constants from object instances as well: - -.. code-block:: jinja - - {{ constant('RSS', date) }} diff --git a/vendor/twig/twig/doc/functions/cycle.rst b/vendor/twig/twig/doc/functions/cycle.rst deleted file mode 100644 index e343493..0000000 --- a/vendor/twig/twig/doc/functions/cycle.rst +++ /dev/null @@ -1,28 +0,0 @@ -``cycle`` -========= - -The ``cycle`` function cycles on an array of values: - -.. code-block:: jinja - - {% set start_year = date() | date('Y') %} - {% set end_year = start_year + 5 %} - - {% for year in start_year..end_year %} - {{ cycle(['odd', 'even'], loop.index0) }} - {% endfor %} - -The array can contain any number of values: - -.. code-block:: jinja - - {% set fruits = ['apple', 'orange', 'citrus'] %} - - {% for i in 0..10 %} - {{ cycle(fruits, i) }} - {% endfor %} - -Arguments ---------- - -* ``position``: The cycle position diff --git a/vendor/twig/twig/doc/functions/date.rst b/vendor/twig/twig/doc/functions/date.rst deleted file mode 100644 index 714e08c..0000000 --- a/vendor/twig/twig/doc/functions/date.rst +++ /dev/null @@ -1,52 +0,0 @@ -``date`` -======== - -.. versionadded:: 1.6 - The date function has been added in Twig 1.6. - -.. versionadded:: 1.6.1 - The default timezone support has been added in Twig 1.6.1. - -Converts an argument to a date to allow date comparison: - -.. code-block:: jinja - - {% if date(user.created_at) < date('-2days') %} - {# do something #} - {% endif %} - -The argument must be in one of PHP’s supported `date and time formats`_. - -You can pass a timezone as the second argument: - -.. code-block:: jinja - - {% if date(user.created_at) < date('-2days', 'Europe/Paris') %} - {# do something #} - {% endif %} - -If no argument is passed, the function returns the current date: - -.. code-block:: jinja - - {% if date(user.created_at) < date() %} - {# always! #} - {% endif %} - -.. note:: - - You can set the default timezone globally by calling ``setTimezone()`` on - the ``core`` extension instance: - - .. code-block:: php - - $twig = new Twig_Environment($loader); - $twig->getExtension('core')->setTimezone('Europe/Paris'); - -Arguments ---------- - -* ``date``: The date -* ``timezone``: The timezone - -.. _`date and time formats`: http://php.net/manual/en/datetime.formats.php diff --git a/vendor/twig/twig/doc/functions/dump.rst b/vendor/twig/twig/doc/functions/dump.rst deleted file mode 100644 index a231f08..0000000 --- a/vendor/twig/twig/doc/functions/dump.rst +++ /dev/null @@ -1,69 +0,0 @@ -``dump`` -======== - -.. versionadded:: 1.5 - The ``dump`` function was added in Twig 1.5. - -The ``dump`` function dumps information about a template variable. This is -mostly useful to debug a template that does not behave as expected by -introspecting its variables: - -.. code-block:: jinja - - {{ dump(user) }} - -.. note:: - - The ``dump`` function is not available by default. You must add the - ``Twig_Extension_Debug`` extension explicitly when creating your Twig - environment:: - - $twig = new Twig_Environment($loader, array( - 'debug' => true, - // ... - )); - $twig->addExtension(new Twig_Extension_Debug()); - - Even when enabled, the ``dump`` function won't display anything if the - ``debug`` option on the environment is not enabled (to avoid leaking debug - information on a production server). - -In an HTML context, wrap the output with a ``pre`` tag to make it easier to -read: - -.. code-block:: jinja - -
-        {{ dump(user) }}
-    
- -.. tip:: - - Using a ``pre`` tag is not needed when `XDebug`_ is enabled and - ``html_errors`` is ``on``; as a bonus, the output is also nicer with - XDebug enabled. - -You can debug several variables by passing them as additional arguments: - -.. code-block:: jinja - - {{ dump(user, categories) }} - -If you don't pass any value, all variables from the current context are -dumped: - -.. code-block:: jinja - - {{ dump() }} - -.. note:: - - Internally, Twig uses the PHP `var_dump`_ function. - -Arguments ---------- - -* ``context``: The context to dump - -.. _`XDebug`: http://xdebug.org/docs/display -.. _`var_dump`: http://php.net/var_dump diff --git a/vendor/twig/twig/doc/functions/include.rst b/vendor/twig/twig/doc/functions/include.rst deleted file mode 100644 index 33bd56d..0000000 --- a/vendor/twig/twig/doc/functions/include.rst +++ /dev/null @@ -1,80 +0,0 @@ -``include`` -=========== - -.. versionadded:: 1.12 - The ``include`` function was added in Twig 1.12. - -The ``include`` function returns the rendered content of a template: - -.. code-block:: jinja - - {{ include('template.html') }} - {{ include(some_var) }} - -Included templates have access to the variables of the active context. - -If you are using the filesystem loader, the templates are looked for in the -paths defined by it. - -The context is passed by default to the template but you can also pass -additional variables: - -.. code-block:: jinja - - {# template.html will have access to the variables from the current context and the additional ones provided #} - {{ include('template.html', {foo: 'bar'}) }} - -You can disable access to the context by setting ``with_context`` to -``false``: - -.. code-block:: jinja - - {# only the foo variable will be accessible #} - {{ include('template.html', {foo: 'bar'}, with_context = false) }} - -.. code-block:: jinja - - {# no variables will be accessible #} - {{ include('template.html', with_context = false) }} - -And if the expression evaluates to a ``Twig_Template`` object, Twig will use it -directly:: - - // {{ include(template) }} - - $template = $twig->loadTemplate('some_template.twig'); - - $twig->loadTemplate('template.twig')->display(array('template' => $template)); - -When you set the ``ignore_missing`` flag, Twig will return an empty string if -the template does not exist: - -.. code-block:: jinja - - {{ include('sidebar.html', ignore_missing = true) }} - -You can also provide a list of templates that are checked for existence before -inclusion. The first template that exists will be rendered: - -.. code-block:: jinja - - {{ include(['page_detailed.html', 'page.html']) }} - -If ``ignore_missing`` is set, it will fall back to rendering nothing if none -of the templates exist, otherwise it will throw an exception. - -When including a template created by an end user, you should consider -sandboxing it: - -.. code-block:: jinja - - {{ include('page.html', sandboxed = true) }} - -Arguments ---------- - -* ``template``: The template to render -* ``variables``: The variables to pass to the template -* ``with_context``: Whether to pass the current context variables or not -* ``ignore_missing``: Whether to ignore missing templates or not -* ``sandboxed``: Whether to sandbox the template or not diff --git a/vendor/twig/twig/doc/functions/index.rst b/vendor/twig/twig/doc/functions/index.rst deleted file mode 100644 index 07214a7..0000000 --- a/vendor/twig/twig/doc/functions/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -Functions -========= - -.. toctree:: - :maxdepth: 1 - - attribute - block - constant - cycle - date - dump - include - max - min - parent - random - range - source - template_from_string diff --git a/vendor/twig/twig/doc/functions/max.rst b/vendor/twig/twig/doc/functions/max.rst deleted file mode 100644 index 6f3cfc5..0000000 --- a/vendor/twig/twig/doc/functions/max.rst +++ /dev/null @@ -1,20 +0,0 @@ -``max`` -======= - -.. versionadded:: 1.15 - The ``max`` function was added in Twig 1.15. - -``max`` returns the biggest value of a sequence or a set of values: - -.. code-block:: jinja - - {{ max(1, 3, 2) }} - {{ max([1, 3, 2]) }} - -When called with a mapping, max ignores keys and only compares values: - -.. code-block:: jinja - - {{ max({2: "e", 1: "a", 3: "b", 5: "d", 4: "c"}) }} - {# returns "e" #} - diff --git a/vendor/twig/twig/doc/functions/min.rst b/vendor/twig/twig/doc/functions/min.rst deleted file mode 100644 index 7b6a65e..0000000 --- a/vendor/twig/twig/doc/functions/min.rst +++ /dev/null @@ -1,20 +0,0 @@ -``min`` -======= - -.. versionadded:: 1.15 - The ``min`` function was added in Twig 1.15. - -``min`` returns the lowest value of a sequence or a set of values: - -.. code-block:: jinja - - {{ min(1, 3, 2) }} - {{ min([1, 3, 2]) }} - -When called with a mapping, min ignores keys and only compares values: - -.. code-block:: jinja - - {{ min({2: "e", 3: "a", 1: "b", 5: "d", 4: "c"}) }} - {# returns "a" #} - diff --git a/vendor/twig/twig/doc/functions/parent.rst b/vendor/twig/twig/doc/functions/parent.rst deleted file mode 100644 index f5bd200..0000000 --- a/vendor/twig/twig/doc/functions/parent.rst +++ /dev/null @@ -1,20 +0,0 @@ -``parent`` -========== - -When a template uses inheritance, it's possible to render the contents of the -parent block when overriding a block by using the ``parent`` function: - -.. code-block:: jinja - - {% extends "base.html" %} - - {% block sidebar %} -

Table Of Contents

- ... - {{ parent() }} - {% endblock %} - -The ``parent()`` call will return the content of the ``sidebar`` block as -defined in the ``base.html`` template. - -.. seealso:: :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>` diff --git a/vendor/twig/twig/doc/functions/random.rst b/vendor/twig/twig/doc/functions/random.rst deleted file mode 100644 index 168e74f..0000000 --- a/vendor/twig/twig/doc/functions/random.rst +++ /dev/null @@ -1,29 +0,0 @@ -``random`` -========== - -.. versionadded:: 1.5 - The ``random`` function was added in Twig 1.5. - -.. versionadded:: 1.6 - String and integer handling was added in Twig 1.6. - -The ``random`` function returns a random value depending on the supplied -parameter type: - -* a random item from a sequence; -* a random character from a string; -* a random integer between 0 and the integer parameter (inclusive). - -.. code-block:: jinja - - {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #} - {{ random('ABC') }} {# example output: C #} - {{ random() }} {# example output: 15386094 (works as the native PHP mt_rand function) #} - {{ random(5) }} {# example output: 3 #} - -Arguments ---------- - -* ``values``: The values - -.. _`mt_rand`: http://php.net/mt_rand diff --git a/vendor/twig/twig/doc/functions/range.rst b/vendor/twig/twig/doc/functions/range.rst deleted file mode 100644 index b7cd011..0000000 --- a/vendor/twig/twig/doc/functions/range.rst +++ /dev/null @@ -1,45 +0,0 @@ -``range`` -========= - -Returns a list containing an arithmetic progression of integers: - -.. code-block:: jinja - - {% for i in range(0, 3) %} - {{ i }}, - {% endfor %} - - {# outputs 0, 1, 2, 3, #} - -When step is given (as the third parameter), it specifies the increment (or -decrement): - -.. code-block:: jinja - - {% for i in range(0, 6, 2) %} - {{ i }}, - {% endfor %} - - {# outputs 0, 2, 4, 6, #} - -The Twig built-in ``..`` operator is just syntactic sugar for the ``range`` -function (with a step of 1): - -.. code-block:: jinja - - {% for i in 0..3 %} - {{ i }}, - {% endfor %} - -.. tip:: - - The ``range`` function works as the native PHP `range`_ function. - -Arguments ---------- - -* ``low``: The first value of the sequence. -* ``high``: The highest possible value of the sequence. -* ``step``: The increment between elements of the sequence. - -.. _`range`: http://php.net/range diff --git a/vendor/twig/twig/doc/functions/source.rst b/vendor/twig/twig/doc/functions/source.rst deleted file mode 100644 index 3c921b1..0000000 --- a/vendor/twig/twig/doc/functions/source.rst +++ /dev/null @@ -1,32 +0,0 @@ -``source`` -========== - -.. versionadded:: 1.15 - The ``source`` function was added in Twig 1.15. - -.. versionadded:: 1.18.3 - The ``ignore_missing`` flag was added in Twig 1.18.3. - -The ``source`` function returns the content of a template without rendering it: - -.. code-block:: jinja - - {{ source('template.html') }} - {{ source(some_var) }} - -When you set the ``ignore_missing`` flag, Twig will return an empty string if -the template does not exist: - -.. code-block:: jinja - - {{ source('template.html', ignore_missing = true) }} - -The function uses the same template loaders as the ones used to include -templates. So, if you are using the filesystem loader, the templates are looked -for in the paths defined by it. - -Arguments ---------- - -* ``name``: The name of the template to read -* ``ignore_missing``: Whether to ignore missing templates or not diff --git a/vendor/twig/twig/doc/functions/template_from_string.rst b/vendor/twig/twig/doc/functions/template_from_string.rst deleted file mode 100644 index ce6a60d..0000000 --- a/vendor/twig/twig/doc/functions/template_from_string.rst +++ /dev/null @@ -1,32 +0,0 @@ -``template_from_string`` -======================== - -.. versionadded:: 1.11 - The ``template_from_string`` function was added in Twig 1.11. - -The ``template_from_string`` function loads a template from a string: - -.. code-block:: jinja - - {{ include(template_from_string("Hello {{ name }}")) }} - {{ include(template_from_string(page.template)) }} - -.. note:: - - The ``template_from_string`` function is not available by default. You - must add the ``Twig_Extension_StringLoader`` extension explicitly when - creating your Twig environment:: - - $twig = new Twig_Environment(...); - $twig->addExtension(new Twig_Extension_StringLoader()); - -.. note:: - - Even if you will probably always use the ``template_from_string`` function - with the ``include`` function, you can use it with any tag or function that - takes a template as an argument (like the ``embed`` or ``extends`` tags). - -Arguments ---------- - -* ``template``: The template diff --git a/vendor/twig/twig/doc/index.rst b/vendor/twig/twig/doc/index.rst deleted file mode 100644 index 358bd73..0000000 --- a/vendor/twig/twig/doc/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -Twig -==== - -.. toctree:: - :maxdepth: 2 - - intro - installation - templates - api - advanced - internals - deprecated - recipes - coding_standards - tags/index - filters/index - functions/index - tests/index diff --git a/vendor/twig/twig/doc/installation.rst b/vendor/twig/twig/doc/installation.rst deleted file mode 100644 index afdcf16..0000000 --- a/vendor/twig/twig/doc/installation.rst +++ /dev/null @@ -1,116 +0,0 @@ -Installation -============ - -You have multiple ways to install Twig. - -Installing the Twig PHP package -------------------------------- - -Installing via Composer (recommended) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Install `Composer`_ and run the following command to get the latest version: - -.. code-block:: bash - - composer require twig/twig:~1.0 - -Installing from the tarball release -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -1. Download the most recent tarball from the `download page`_ -2. Verify the integrity of the tarball http://fabien.potencier.org/article/73/signing-project-releases -3. Unpack the tarball -4. Move the files somewhere in your project - -Installing the development version -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: bash - - git clone git://github.com/twigphp/Twig.git - -Installing the PEAR package -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. note:: - - Using PEAR for installing Twig is deprecated and Twig 1.15.1 was the last - version published on the PEAR channel; use Composer instead. - -.. code-block:: bash - - pear channel-discover pear.twig-project.org - pear install twig/Twig - -Installing the C extension --------------------------- - -.. versionadded:: 1.4 - The C extension was added in Twig 1.4. - -.. note:: - - The C extension is **optional** but it brings some nice performance - improvements. Note that the extension is not a replacement for the PHP - code; it only implements a small part of the PHP code to improve the - performance at runtime; you must still install the regular PHP code. - -Twig comes with a C extension that enhances the performance of the Twig -runtime engine; install it like any other PHP extensions: - -.. code-block:: bash - - cd ext/twig - phpize - ./configure - make - make install - -.. note:: - - You can also install the C extension via PEAR (note that this method is - deprecated and newer versions of Twig are not available on the PEAR - channel): - - .. code-block:: bash - - pear channel-discover pear.twig-project.org - pear install twig/CTwig - -For Windows: - -1. Setup the build environment following the `PHP documentation`_ -2. Put Twig's C extension source code into ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\ext\twig`` -3. Use the ``configure --disable-all --enable-cli --enable-twig=shared`` command instead of step 14 -4. ``nmake`` -5. Copy the ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\Release_TS\php_twig.dll`` file to your PHP setup. - -.. tip:: - - For Windows ZendServer, ZTS is not enabled as mentioned in `Zend Server - FAQ`_. - - You have to use ``configure --disable-all --disable-zts --enable-cli - --enable-twig=shared`` to be able to build the twig C extension for - ZendServer. - - The built DLL will be available in - ``C:\\php-sdk\\phpdev\\vcXX\\x86\\php-source-directory\\Release`` - -Finally, enable the extension in your ``php.ini`` configuration file: - -.. code-block:: ini - - extension=twig.so #For Unix systems - extension=php_twig.dll #For Windows systems - -And from now on, Twig will automatically compile your templates to take -advantage of the C extension. Note that this extension does not replace the -PHP code but only provides an optimized version of the -``Twig_Template::getAttribute()`` method. - -.. _`download page`: https://github.com/twigphp/Twig/tags -.. _`Composer`: https://getcomposer.org/download/ -.. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild -.. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6 diff --git a/vendor/twig/twig/doc/internals.rst b/vendor/twig/twig/doc/internals.rst deleted file mode 100644 index ef1174d..0000000 --- a/vendor/twig/twig/doc/internals.rst +++ /dev/null @@ -1,138 +0,0 @@ -Twig Internals -============== - -Twig is very extensible and you can easily hack it. Keep in mind that you -should probably try to create an extension before hacking the core, as most -features and enhancements can be handled with extensions. This chapter is also -useful for people who want to understand how Twig works under the hood. - -How does Twig work? -------------------- - -The rendering of a Twig template can be summarized into four key steps: - -* **Load** the template: If the template is already compiled, load it and go - to the *evaluation* step, otherwise: - - * First, the **lexer** tokenizes the template source code into small pieces - for easier processing; - * Then, the **parser** converts the token stream into a meaningful tree - of nodes (the Abstract Syntax Tree); - * Eventually, the *compiler* transforms the AST into PHP code. - -* **Evaluate** the template: It basically means calling the ``display()`` - method of the compiled template and passing it the context. - -The Lexer ---------- - -The lexer tokenizes a template source code into a token stream (each token is -an instance of ``Twig_Token``, and the stream is an instance of -``Twig_TokenStream``). The default lexer recognizes 13 different token types: - -* ``Twig_Token::BLOCK_START_TYPE``, ``Twig_Token::BLOCK_END_TYPE``: Delimiters for blocks (``{% %}``) -* ``Twig_Token::VAR_START_TYPE``, ``Twig_Token::VAR_END_TYPE``: Delimiters for variables (``{{ }}``) -* ``Twig_Token::TEXT_TYPE``: A text outside an expression; -* ``Twig_Token::NAME_TYPE``: A name in an expression; -* ``Twig_Token::NUMBER_TYPE``: A number in an expression; -* ``Twig_Token::STRING_TYPE``: A string in an expression; -* ``Twig_Token::OPERATOR_TYPE``: An operator; -* ``Twig_Token::PUNCTUATION_TYPE``: A punctuation sign; -* ``Twig_Token::INTERPOLATION_START_TYPE``, ``Twig_Token::INTERPOLATION_END_TYPE`` (as of Twig 1.5): Delimiters for string interpolation; -* ``Twig_Token::EOF_TYPE``: Ends of template. - -You can manually convert a source code into a token stream by calling the -``tokenize()`` method of an environment:: - - $stream = $twig->tokenize($source, $identifier); - -As the stream has a ``__toString()`` method, you can have a textual -representation of it by echoing the object:: - - echo $stream."\n"; - -Here is the output for the ``Hello {{ name }}`` template: - -.. code-block:: text - - TEXT_TYPE(Hello ) - VAR_START_TYPE() - NAME_TYPE(name) - VAR_END_TYPE() - EOF_TYPE() - -.. note:: - - The default lexer (``Twig_Lexer``) can be changed by calling - the ``setLexer()`` method:: - - $twig->setLexer($lexer); - -The Parser ----------- - -The parser converts the token stream into an AST (Abstract Syntax Tree), or a -node tree (an instance of ``Twig_Node_Module``). The core extension defines -the basic nodes like: ``for``, ``if``, ... and the expression nodes. - -You can manually convert a token stream into a node tree by calling the -``parse()`` method of an environment:: - - $nodes = $twig->parse($stream); - -Echoing the node object gives you a nice representation of the tree:: - - echo $nodes."\n"; - -Here is the output for the ``Hello {{ name }}`` template: - -.. code-block:: text - - Twig_Node_Module( - Twig_Node_Text(Hello ) - Twig_Node_Print( - Twig_Node_Expression_Name(name) - ) - ) - -.. note:: - - The default parser (``Twig_TokenParser``) can be changed by calling the - ``setParser()`` method:: - - $twig->setParser($parser); - -The Compiler ------------- - -The last step is done by the compiler. It takes a node tree as an input and -generates PHP code usable for runtime execution of the template. - -You can manually compile a node tree to PHP code with the ``compile()`` method -of an environment:: - - $php = $twig->compile($nodes); - -The generated template for a ``Hello {{ name }}`` template reads as follows -(the actual output can differ depending on the version of Twig you are -using):: - - /* Hello {{ name }} */ - class __TwigTemplate_1121b6f109fe93ebe8c6e22e3712bceb extends Twig_Template - { - protected function doDisplay(array $context, array $blocks = array()) - { - // line 1 - echo "Hello "; - echo twig_escape_filter($this->env, isset($context["name"]) ? $context["name"] : null), "html", null, true); - } - - // some more code - } - -.. note:: - - The default compiler (``Twig_Compiler``) can be changed by calling the - ``setCompiler()`` method:: - - $twig->setCompiler($compiler); diff --git a/vendor/twig/twig/doc/intro.rst b/vendor/twig/twig/doc/intro.rst deleted file mode 100644 index 9b38c97..0000000 --- a/vendor/twig/twig/doc/intro.rst +++ /dev/null @@ -1,85 +0,0 @@ -Introduction -============ - -This is the documentation for Twig, the flexible, fast, and secure template -engine for PHP. - -If you have any exposure to other text-based template languages, such as -Smarty, Django, or Jinja, you should feel right at home with Twig. It's both -designer and developer friendly by sticking to PHP's principles and adding -functionality useful for templating environments. - -The key-features are... - -* *Fast*: Twig compiles templates down to plain optimized PHP code. The - overhead compared to regular PHP code was reduced to the very minimum. - -* *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This - allows Twig to be used as a template language for applications where users - may modify the template design. - -* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the - developer to define its own custom tags and filters, and create its own DSL. - -Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish, -phpBB, Piwik, OroCRM, and many frameworks have support for it as well like -Slim, Yii, Laravel, Codeigniter, and Kohana, just to name a few. - -Prerequisites -------------- - -Twig needs at least **PHP 5.2.7** to run. - -Installation ------------- - -The recommended way to install Twig is via Composer: - -.. code-block:: bash - - composer require "twig/twig:~1.0" - -.. note:: - - To learn more about the other installation methods, read the - :doc:`installation` chapter; it also explains how to install - the Twig C extension. - -Basic API Usage ---------------- - -This section gives you a brief introduction to the PHP API for Twig. - -.. code-block:: php - - require_once '/path/to/vendor/autoload.php'; - - $loader = new Twig_Loader_Array(array( - 'index' => 'Hello {{ name }}!', - )); - $twig = new Twig_Environment($loader); - - echo $twig->render('index', array('name' => 'Fabien')); - -Twig uses a loader (``Twig_Loader_Array``) to locate templates, and an -environment (``Twig_Environment``) to store the configuration. - -The ``render()`` method loads the template passed as a first argument and -renders it with the variables passed as a second argument. - -As templates are generally stored on the filesystem, Twig also comes with a -filesystem loader:: - - $loader = new Twig_Loader_Filesystem('/path/to/templates'); - $twig = new Twig_Environment($loader, array( - 'cache' => '/path/to/compilation_cache', - )); - - echo $twig->render('index.html', array('name' => 'Fabien')); - -.. tip:: - - If you are not using Composer, use the Twig built-in autoloader:: - - require_once '/path/to/lib/Twig/Autoloader.php'; - Twig_Autoloader::register(); diff --git a/vendor/twig/twig/doc/recipes.rst b/vendor/twig/twig/doc/recipes.rst deleted file mode 100644 index 6ad5327..0000000 --- a/vendor/twig/twig/doc/recipes.rst +++ /dev/null @@ -1,518 +0,0 @@ -Recipes -======= - -.. _deprecation-notices: - -Displaying Deprecation Notices ------------------------------- - -.. versionadded:: 1.21 - This works as of Twig 1.21. - -Deprecated features generate deprecation notices (via a call to the -``trigger_error()`` PHP function). By default, they are silenced and never -displayed nor logged. - -To easily remove all deprecated feature usages from your templates, write and -run a script along the lines of the following:: - - require_once __DIR__.'/vendor/autoload.php'; - - $twig = create_your_twig_env(); - - $deprecations = new Twig_Util_DeprecationCollector($twig); - - print_r($deprecations->collectDir(__DIR__.'/templates')); - -The ``collectDir()`` method compiles all templates found in a directory, -catches deprecation notices, and return them. - -.. tip:: - - If your templates are not stored on the filesystem, use the ``collect()`` - method instead which takes an ``Iterator``; the iterator must return - template names as keys and template contents as values (as done by - ``Twig_Util_TemplateDirIterator``). - -However, this code won't find all deprecations (like using deprecated some Twig -classes). To catch all notices, register a custom error handler like the one -below:: - - $deprecations = array(); - set_error_handler(function ($type, $msg) use (&$deprecations) { - if (E_USER_DEPRECATED === $type) { - $deprecations[] = $msg; - } - }); - - // run your application - - print_r($deprecations); - -Note that most deprecation notices are triggered during **compilation**, so -they won't be generated when templates are already cached. - -.. tip:: - - If you want to manage the deprecation notices from your PHPUnit tests, have - a look at the `symfony/phpunit-bridge - `_ package, which eases the - process a lot. - -Making a Layout conditional ---------------------------- - -Working with Ajax means that the same content is sometimes displayed as is, -and sometimes decorated with a layout. As Twig layout template names can be -any valid expression, you can pass a variable that evaluates to ``true`` when -the request is made via Ajax and choose the layout accordingly: - -.. code-block:: jinja - - {% extends request.ajax ? "base_ajax.html" : "base.html" %} - - {% block content %} - This is the content to be displayed. - {% endblock %} - -Making an Include dynamic -------------------------- - -When including a template, its name does not need to be a string. For -instance, the name can depend on the value of a variable: - -.. code-block:: jinja - - {% include var ~ '_foo.html' %} - -If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be -rendered. - -As a matter of fact, the template name can be any valid expression, such as -the following: - -.. code-block:: jinja - - {% include var|default('index') ~ '_foo.html' %} - -Overriding a Template that also extends itself ----------------------------------------------- - -A template can be customized in two different ways: - -* *Inheritance*: A template *extends* a parent template and overrides some - blocks; - -* *Replacement*: If you use the filesystem loader, Twig loads the first - template it finds in a list of configured directories; a template found in a - directory *replaces* another one from a directory further in the list. - -But how do you combine both: *replace* a template that also extends itself -(aka a template in a directory further in the list)? - -Let's say that your templates are loaded from both ``.../templates/mysite`` -and ``.../templates/default`` in this order. The ``page.twig`` template, -stored in ``.../templates/default`` reads as follows: - -.. code-block:: jinja - - {# page.twig #} - {% extends "layout.twig" %} - - {% block content %} - {% endblock %} - -You can replace this template by putting a file with the same name in -``.../templates/mysite``. And if you want to extend the original template, you -might be tempted to write the following: - -.. code-block:: jinja - - {# page.twig in .../templates/mysite #} - {% extends "page.twig" %} {# from .../templates/default #} - -Of course, this will not work as Twig will always load the template from -``.../templates/mysite``. - -It turns out it is possible to get this to work, by adding a directory right -at the end of your template directories, which is the parent of all of the -other directories: ``.../templates`` in our case. This has the effect of -making every template file within our system uniquely addressable. Most of the -time you will use the "normal" paths, but in the special case of wanting to -extend a template with an overriding version of itself we can reference its -parent's full, unambiguous template path in the extends tag: - -.. code-block:: jinja - - {# page.twig in .../templates/mysite #} - {% extends "default/page.twig" %} {# from .../templates #} - -.. note:: - - This recipe was inspired by the following Django wiki page: - http://code.djangoproject.com/wiki/ExtendingTemplates - -Customizing the Syntax ----------------------- - -Twig allows some syntax customization for the block delimiters. It's not -recommended to use this feature as templates will be tied with your custom -syntax. But for specific projects, it can make sense to change the defaults. - -To change the block delimiters, you need to create your own lexer object:: - - $twig = new Twig_Environment(); - - $lexer = new Twig_Lexer($twig, array( - 'tag_comment' => array('{#', '#}'), - 'tag_block' => array('{%', '%}'), - 'tag_variable' => array('{{', '}}'), - 'interpolation' => array('#{', '}'), - )); - $twig->setLexer($lexer); - -Here are some configuration example that simulates some other template engines -syntax:: - - // Ruby erb syntax - $lexer = new Twig_Lexer($twig, array( - 'tag_comment' => array('<%#', '%>'), - 'tag_block' => array('<%', '%>'), - 'tag_variable' => array('<%=', '%>'), - )); - - // SGML Comment Syntax - $lexer = new Twig_Lexer($twig, array( - 'tag_comment' => array(''), - 'tag_block' => array(''), - 'tag_variable' => array('${', '}'), - )); - - // Smarty like - $lexer = new Twig_Lexer($twig, array( - 'tag_comment' => array('{*', '*}'), - 'tag_block' => array('{', '}'), - 'tag_variable' => array('{$', '}'), - )); - -Using dynamic Object Properties -------------------------------- - -When Twig encounters a variable like ``article.title``, it tries to find a -``title`` public property in the ``article`` object. - -It also works if the property does not exist but is rather defined dynamically -thanks to the magic ``__get()`` method; you just need to also implement the -``__isset()`` magic method like shown in the following snippet of code:: - - class Article - { - public function __get($name) - { - if ('title' == $name) { - return 'The title'; - } - - // throw some kind of error - } - - public function __isset($name) - { - if ('title' == $name) { - return true; - } - - return false; - } - } - -Accessing the parent Context in Nested Loops --------------------------------------------- - -Sometimes, when using nested loops, you need to access the parent context. The -parent context is always accessible via the ``loop.parent`` variable. For -instance, if you have the following template data:: - - $data = array( - 'topics' => array( - 'topic1' => array('Message 1 of topic 1', 'Message 2 of topic 1'), - 'topic2' => array('Message 1 of topic 2', 'Message 2 of topic 2'), - ), - ); - -And the following template to display all messages in all topics: - -.. code-block:: jinja - - {% for topic, messages in topics %} - * {{ loop.index }}: {{ topic }} - {% for message in messages %} - - {{ loop.parent.loop.index }}.{{ loop.index }}: {{ message }} - {% endfor %} - {% endfor %} - -The output will be similar to: - -.. code-block:: text - - * 1: topic1 - - 1.1: The message 1 of topic 1 - - 1.2: The message 2 of topic 1 - * 2: topic2 - - 2.1: The message 1 of topic 2 - - 2.2: The message 2 of topic 2 - -In the inner loop, the ``loop.parent`` variable is used to access the outer -context. So, the index of the current ``topic`` defined in the outer for loop -is accessible via the ``loop.parent.loop.index`` variable. - -Defining undefined Functions and Filters on the Fly ---------------------------------------------------- - -When a function (or a filter) is not defined, Twig defaults to throw a -``Twig_Error_Syntax`` exception. However, it can also call a `callback`_ (any -valid PHP callable) which should return a function (or a filter). - -For filters, register callbacks with ``registerUndefinedFilterCallback()``. -For functions, use ``registerUndefinedFunctionCallback()``:: - - // auto-register all native PHP functions as Twig functions - // don't try this at home as it's not secure at all! - $twig->registerUndefinedFunctionCallback(function ($name) { - if (function_exists($name)) { - return new Twig_Function_Function($name); - } - - return false; - }); - -If the callable is not able to return a valid function (or filter), it must -return ``false``. - -If you register more than one callback, Twig will call them in turn until one -does not return ``false``. - -.. tip:: - - As the resolution of functions and filters is done during compilation, - there is no overhead when registering these callbacks. - -Validating the Template Syntax ------------------------------- - -When template code is provided by a third-party (through a web interface for -instance), it might be interesting to validate the template syntax before -saving it. If the template code is stored in a `$template` variable, here is -how you can do it:: - - try { - $twig->parse($twig->tokenize($template)); - - // the $template is valid - } catch (Twig_Error_Syntax $e) { - // $template contains one or more syntax errors - } - -If you iterate over a set of files, you can pass the filename to the -``tokenize()`` method to get the filename in the exception message:: - - foreach ($files as $file) { - try { - $twig->parse($twig->tokenize($template, $file)); - - // the $template is valid - } catch (Twig_Error_Syntax $e) { - // $template contains one or more syntax errors - } - } - -.. note:: - - This method won't catch any sandbox policy violations because the policy - is enforced during template rendering (as Twig needs the context for some - checks like allowed methods on objects). - -Refreshing modified Templates when OPcache or APC is enabled ------------------------------------------------------------- - -When using OPcache with ``opcache.validate_timestamps`` set to ``0`` or APC -with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template -cache won't update the cache. - -To get around this, force Twig to invalidate the bytecode cache:: - - $twig = new Twig_Environment($loader, array( - 'cache' => new Twig_Cache_Filesystem('/some/cache/path', Twig_Cache_Filesystem::FORCE_BYTECODE_INVALIDATION), - // ... - )); - -.. note:: - - Before Twig 1.22, you should extend ``Twig_Environment`` instead:: - - class OpCacheAwareTwigEnvironment extends Twig_Environment - { - protected function writeCacheFile($file, $content) - { - parent::writeCacheFile($file, $content); - - // Compile cached file into bytecode cache - if (function_exists('opcache_invalidate')) { - opcache_invalidate($file, true); - } elseif (function_exists('apc_compile_file')) { - apc_compile_file($file); - } - } - } - -Reusing a stateful Node Visitor -------------------------------- - -When attaching a visitor to a ``Twig_Environment`` instance, Twig uses it to -visit *all* templates it compiles. If you need to keep some state information -around, you probably want to reset it when visiting a new template. - -This can be easily achieved with the following code:: - - protected $someTemplateState = array(); - - public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Module) { - // reset the state as we are entering a new template - $this->someTemplateState = array(); - } - - // ... - - return $node; - } - -Using a Database to store Templates ------------------------------------ - -If you are developing a CMS, templates are usually stored in a database. This -recipe gives you a simple PDO template loader you can use as a starting point -for your own. - -First, let's create a temporary in-memory SQLite3 database to work with:: - - $dbh = new PDO('sqlite::memory:'); - $dbh->exec('CREATE TABLE templates (name STRING, source STRING, last_modified INTEGER)'); - $base = '{% block content %}{% endblock %}'; - $index = ' - {% extends "base.twig" %} - {% block content %}Hello {{ name }}{% endblock %} - '; - $now = time(); - $dbh->exec("INSERT INTO templates (name, source, last_modified) VALUES ('base.twig', '$base', $now)"); - $dbh->exec("INSERT INTO templates (name, source, last_modified) VALUES ('index.twig', '$index', $now)"); - -We have created a simple ``templates`` table that hosts two templates: -``base.twig`` and ``index.twig``. - -Now, let's define a loader able to use this database:: - - class DatabaseTwigLoader implements Twig_LoaderInterface, Twig_ExistsLoaderInterface - { - protected $dbh; - - public function __construct(PDO $dbh) - { - $this->dbh = $dbh; - } - - public function getSource($name) - { - if (false === $source = $this->getValue('source', $name)) { - throw new Twig_Error_Loader(sprintf('Template "%s" does not exist.', $name)); - } - - return $source; - } - - // Twig_ExistsLoaderInterface as of Twig 1.11 - public function exists($name) - { - return $name === $this->getValue('name', $name); - } - - public function getCacheKey($name) - { - return $name; - } - - public function isFresh($name, $time) - { - if (false === $lastModified = $this->getValue('last_modified', $name)) { - return false; - } - - return $lastModified <= $time; - } - - protected function getValue($column, $name) - { - $sth = $this->dbh->prepare('SELECT '.$column.' FROM templates WHERE name = :name'); - $sth->execute(array(':name' => (string) $name)); - - return $sth->fetchColumn(); - } - } - -Finally, here is an example on how you can use it:: - - $loader = new DatabaseTwigLoader($dbh); - $twig = new Twig_Environment($loader); - - echo $twig->render('index.twig', array('name' => 'Fabien')); - -Using different Template Sources --------------------------------- - -This recipe is the continuation of the previous one. Even if you store the -contributed templates in a database, you might want to keep the original/base -templates on the filesystem. When templates can be loaded from different -sources, you need to use the ``Twig_Loader_Chain`` loader. - -As you can see in the previous recipe, we reference the template in the exact -same way as we would have done it with a regular filesystem loader. This is -the key to be able to mix and match templates coming from the database, the -filesystem, or any other loader for that matter: the template name should be a -logical name, and not the path from the filesystem:: - - $loader1 = new DatabaseTwigLoader($dbh); - $loader2 = new Twig_Loader_Array(array( - 'base.twig' => '{% block content %}{% endblock %}', - )); - $loader = new Twig_Loader_Chain(array($loader1, $loader2)); - - $twig = new Twig_Environment($loader); - - echo $twig->render('index.twig', array('name' => 'Fabien')); - -Now that the ``base.twig`` templates is defined in an array loader, you can -remove it from the database, and everything else will still work as before. - -Loading a Template from a String --------------------------------- - -From a template, you can easily load a template stored in a string via the -``template_from_string`` function (available as of Twig 1.11 via the -``Twig_Extension_StringLoader`` extension):: - -.. code-block:: jinja - - {{ include(template_from_string("Hello {{ name }}")) }} - -From PHP, it's also possible to load a template stored in a string via -``Twig_Environment::createTemplate()`` (available as of Twig 1.18):: - - $template = $twig->createTemplate('hello {{ name }}'); - echo $template->render(array('name' => 'Fabien')); - -.. note:: - - Never use the ``Twig_Loader_String`` loader, which has severe limitations. - -.. _callback: http://www.php.net/manual/en/function.is-callable.php diff --git a/vendor/twig/twig/doc/tags/autoescape.rst b/vendor/twig/twig/doc/tags/autoescape.rst deleted file mode 100644 index 4208d1a..0000000 --- a/vendor/twig/twig/doc/tags/autoescape.rst +++ /dev/null @@ -1,83 +0,0 @@ -``autoescape`` -============== - -Whether automatic escaping is enabled or not, you can mark a section of a -template to be escaped or not by using the ``autoescape`` tag: - -.. code-block:: jinja - - {# The following syntax works as of Twig 1.8 -- see the note below for previous versions #} - - {% autoescape %} - Everything will be automatically escaped in this block - using the HTML strategy - {% endautoescape %} - - {% autoescape 'html' %} - Everything will be automatically escaped in this block - using the HTML strategy - {% endautoescape %} - - {% autoescape 'js' %} - Everything will be automatically escaped in this block - using the js escaping strategy - {% endautoescape %} - - {% autoescape false %} - Everything will be outputted as is in this block - {% endautoescape %} - -.. note:: - - Before Twig 1.8, the syntax was different: - - .. code-block:: jinja - - {% autoescape true %} - Everything will be automatically escaped in this block - using the HTML strategy - {% endautoescape %} - - {% autoescape false %} - Everything will be outputted as is in this block - {% endautoescape %} - - {% autoescape true js %} - Everything will be automatically escaped in this block - using the js escaping strategy - {% endautoescape %} - -When automatic escaping is enabled everything is escaped by default except for -values explicitly marked as safe. Those can be marked in the template by using -the :doc:`raw<../filters/raw>` filter: - -.. code-block:: jinja - - {% autoescape %} - {{ safe_value|raw }} - {% endautoescape %} - -Functions returning template data (like :doc:`macros` and -:doc:`parent<../functions/parent>`) always return safe markup. - -.. note:: - - Twig is smart enough to not escape an already escaped value by the - :doc:`escape<../filters/escape>` filter. - -.. note:: - - Twig does not escape static expressions: - - .. code-block:: jinja - - {% set hello = "Hello" %} - {{ hello }} - {{ "world" }} - - Will be rendered "Hello **world**". - -.. note:: - - The chapter :doc:`Twig for Developers<../api>` gives more information - about when and how automatic escaping is applied. diff --git a/vendor/twig/twig/doc/tags/block.rst b/vendor/twig/twig/doc/tags/block.rst deleted file mode 100644 index e380482..0000000 --- a/vendor/twig/twig/doc/tags/block.rst +++ /dev/null @@ -1,11 +0,0 @@ -``block`` -========= - -Blocks are used for inheritance and act as placeholders and replacements at -the same time. They are documented in detail in the documentation for the -:doc:`extends<../tags/extends>` tag. - -Block names should consist of alphanumeric characters, and underscores. Dashes -are not permitted. - -.. seealso:: :doc:`block<../functions/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`, :doc:`extends<../tags/extends>` diff --git a/vendor/twig/twig/doc/tags/do.rst b/vendor/twig/twig/doc/tags/do.rst deleted file mode 100644 index 1c344e3..0000000 --- a/vendor/twig/twig/doc/tags/do.rst +++ /dev/null @@ -1,12 +0,0 @@ -``do`` -====== - -.. versionadded:: 1.5 - The ``do`` tag was added in Twig 1.5. - -The ``do`` tag works exactly like the regular variable expression (``{{ ... -}}``) just that it doesn't print anything: - -.. code-block:: jinja - - {% do 1 + 2 %} diff --git a/vendor/twig/twig/doc/tags/embed.rst b/vendor/twig/twig/doc/tags/embed.rst deleted file mode 100644 index 5a6a029..0000000 --- a/vendor/twig/twig/doc/tags/embed.rst +++ /dev/null @@ -1,178 +0,0 @@ -``embed`` -========= - -.. versionadded:: 1.8 - The ``embed`` tag was added in Twig 1.8. - -The ``embed`` tag combines the behaviour of :doc:`include` and -:doc:`extends`. -It allows you to include another template's contents, just like ``include`` -does. But it also allows you to override any block defined inside the -included template, like when extending a template. - -Think of an embedded template as a "micro layout skeleton". - -.. code-block:: jinja - - {% embed "teasers_skeleton.twig" %} - {# These blocks are defined in "teasers_skeleton.twig" #} - {# and we override them right here: #} - {% block left_teaser %} - Some content for the left teaser box - {% endblock %} - {% block right_teaser %} - Some content for the right teaser box - {% endblock %} - {% endembed %} - -The ``embed`` tag takes the idea of template inheritance to the level of -content fragments. While template inheritance allows for "document skeletons", -which are filled with life by child templates, the ``embed`` tag allows you to -create "skeletons" for smaller units of content and re-use and fill them -anywhere you like. - -Since the use case may not be obvious, let's look at a simplified example. -Imagine a base template shared by multiple HTML pages, defining a single block -named "content": - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ │ │ - │ │ │ │ - │ │ (child template to │ │ - │ │ put content here) │ │ - │ │ │ │ - │ │ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -Some pages ("foo" and "bar") share the same content structure - -two vertically stacked boxes: - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ ┌─ block "top" ───┐ │ │ - │ │ │ │ │ │ - │ │ └─────────────────┘ │ │ - │ │ ┌─ block "bottom" ┐ │ │ - │ │ │ │ │ │ - │ │ └─────────────────┘ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -While other pages ("boom" and "baz") share a different content structure - -two boxes side by side: - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ │ │ - │ │ ┌ block ┐ ┌ block ┐ │ │ - │ │ │"left" │ │"right"│ │ │ - │ │ │ │ │ │ │ │ - │ │ │ │ │ │ │ │ - │ │ └───────┘ └───────┘ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -Without the ``embed`` tag, you have two ways to design your templates: - - * Create two "intermediate" base templates that extend the master layout - template: one with vertically stacked boxes to be used by the "foo" and - "bar" pages and another one with side-by-side boxes for the "boom" and - "baz" pages. - - * Embed the markup for the top/bottom and left/right boxes into each page - template directly. - -These two solutions do not scale well because they each have a major drawback: - - * The first solution may indeed work for this simplified example. But imagine - we add a sidebar, which may again contain different, recurring structures - of content. Now we would need to create intermediate base templates for - all occurring combinations of content structure and sidebar structure... - and so on. - - * The second solution involves duplication of common code with all its negative - consequences: any change involves finding and editing all affected copies - of the structure, correctness has to be verified for each copy, copies may - go out of sync by careless modifications etc. - -In such a situation, the ``embed`` tag comes in handy. The common layout -code can live in a single base template, and the two different content structures, -let's call them "micro layouts" go into separate templates which are embedded -as necessary: - -Page template ``foo.twig``: - -.. code-block:: jinja - - {% extends "layout_skeleton.twig" %} - - {% block content %} - {% embed "vertical_boxes_skeleton.twig" %} - {% block top %} - Some content for the top box - {% endblock %} - - {% block bottom %} - Some content for the bottom box - {% endblock %} - {% endembed %} - {% endblock %} - -And here is the code for ``vertical_boxes_skeleton.twig``: - -.. code-block:: html+jinja - -
- {% block top %} - Top box default content - {% endblock %} -
- -
- {% block bottom %} - Bottom box default content - {% endblock %} -
- -The goal of the ``vertical_boxes_skeleton.twig`` template being to factor -out the HTML markup for the boxes. - -The ``embed`` tag takes the exact same arguments as the ``include`` tag: - -.. code-block:: jinja - - {% embed "base" with {'foo': 'bar'} %} - ... - {% endembed %} - - {% embed "base" with {'foo': 'bar'} only %} - ... - {% endembed %} - - {% embed "base" ignore missing %} - ... - {% endembed %} - -.. warning:: - - As embedded templates do not have "names", auto-escaping strategies based - on the template "filename" won't work as expected if you change the - context (for instance, if you embed a CSS/JavaScript template into an HTML - one). In that case, explicitly set the default auto-escaping strategy with - the ``autoescape`` tag. - -.. seealso:: :doc:`include<../tags/include>` diff --git a/vendor/twig/twig/doc/tags/extends.rst b/vendor/twig/twig/doc/tags/extends.rst deleted file mode 100644 index 1ad2b12..0000000 --- a/vendor/twig/twig/doc/tags/extends.rst +++ /dev/null @@ -1,268 +0,0 @@ -``extends`` -=========== - -The ``extends`` tag can be used to extend a template from another one. - -.. note:: - - Like PHP, Twig does not support multiple inheritance. So you can only have - one extends tag called per rendering. However, Twig supports horizontal - :doc:`reuse`. - -Let's define a base template, ``base.html``, which defines a simple HTML -skeleton document: - -.. code-block:: html+jinja - - - - - {% block head %} - - {% block title %}{% endblock %} - My Webpage - {% endblock %} - - -
{% block content %}{% endblock %}
- - - - -In this example, the :doc:`block` tags define four blocks that child -templates can fill in. - -All the ``block`` tag does is to tell the template engine that a child -template may override those portions of the template. - -Child Template --------------- - -A child template might look like this: - -.. code-block:: jinja - - {% extends "base.html" %} - - {% block title %}Index{% endblock %} - {% block head %} - {{ parent() }} - - {% endblock %} - {% block content %} -

Index

-

- Welcome on my awesome homepage. -

- {% endblock %} - -The ``extends`` tag is the key here. It tells the template engine that this -template "extends" another template. When the template system evaluates this -template, first it locates the parent. The extends tag should be the first tag -in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -You can't define multiple ``block`` tags with the same name in the same -template. This limitation exists because a block tag works in "both" -directions. That is, a block tag doesn't just provide a hole to fill - it also -defines the content that fills the hole in the *parent*. If there were two -similarly-named ``block`` tags in a template, that template's parent wouldn't -know which one of the blocks' content to use. - -If you want to print a block multiple times you can however use the -``block`` function: - -.. code-block:: jinja - - {% block title %}{% endblock %} -

{{ block('title') }}

- {% block body %}{% endblock %} - -Parent Blocks -------------- - -It's possible to render the contents of the parent block by using the -:doc:`parent<../functions/parent>` function. This gives back the results of -the parent block: - -.. code-block:: jinja - - {% block sidebar %} -

Table Of Contents

- ... - {{ parent() }} - {% endblock %} - -Named Block End-Tags --------------------- - -Twig allows you to put the name of the block after the end tag for better -readability: - -.. code-block:: jinja - - {% block sidebar %} - {% block inner_sidebar %} - ... - {% endblock inner_sidebar %} - {% endblock sidebar %} - -Of course, the name after the ``endblock`` word must match the block name. - -Block Nesting and Scope ------------------------ - -Blocks can be nested for more complex layouts. Per default, blocks have access -to variables from outer scopes: - -.. code-block:: jinja - - {% for item in seq %} -
  • {% block loop_item %}{{ item }}{% endblock %}
  • - {% endfor %} - -Block Shortcuts ---------------- - -For blocks with few content, it's possible to use a shortcut syntax. The -following constructs do the same: - -.. code-block:: jinja - - {% block title %} - {{ page_title|title }} - {% endblock %} - -.. code-block:: jinja - - {% block title page_title|title %} - -Dynamic Inheritance -------------------- - -Twig supports dynamic inheritance by using a variable as the base template: - -.. code-block:: jinja - - {% extends some_var %} - -If the variable evaluates to a ``Twig_Template`` object, Twig will use it as -the parent template:: - - // {% extends layout %} - - $layout = $twig->loadTemplate('some_layout_template.twig'); - - $twig->display('template.twig', array('layout' => $layout)); - -.. versionadded:: 1.2 - The possibility to pass an array of templates has been added in Twig 1.2. - -You can also provide a list of templates that are checked for existence. The -first template that exists will be used as a parent: - -.. code-block:: jinja - - {% extends ['layout.html', 'base_layout.html'] %} - -Conditional Inheritance ------------------------ - -As the template name for the parent can be any valid Twig expression, it's -possible to make the inheritance mechanism conditional: - -.. code-block:: jinja - - {% extends standalone ? "minimum.html" : "base.html" %} - -In this example, the template will extend the "minimum.html" layout template -if the ``standalone`` variable evaluates to ``true``, and "base.html" -otherwise. - -How do blocks work? -------------------- - -A block provides a way to change how a certain part of a template is rendered -but it does not interfere in any way with the logic around it. - -Let's take the following example to illustrate how a block works and more -importantly, how it does not work: - -.. code-block:: jinja - - {# base.twig #} - - {% for post in posts %} - {% block post %} -

    {{ post.title }}

    -

    {{ post.body }}

    - {% endblock %} - {% endfor %} - -If you render this template, the result would be exactly the same with or -without the ``block`` tag. The ``block`` inside the ``for`` loop is just a way -to make it overridable by a child template: - -.. code-block:: jinja - - {# child.twig #} - - {% extends "base.twig" %} - - {% block post %} -
    -
    {{ post.title }}
    -
    {{ post.text }}
    -
    - {% endblock %} - -Now, when rendering the child template, the loop is going to use the block -defined in the child template instead of the one defined in the base one; the -executed template is then equivalent to the following one: - -.. code-block:: jinja - - {% for post in posts %} -
    -
    {{ post.title }}
    -
    {{ post.text }}
    -
    - {% endfor %} - -Let's take another example: a block included within an ``if`` statement: - -.. code-block:: jinja - - {% if posts is empty %} - {% block head %} - {{ parent() }} - - - {% endblock head %} - {% endif %} - -Contrary to what you might think, this template does not define a block -conditionally; it just makes overridable by a child template the output of -what will be rendered when the condition is ``true``. - -If you want the output to be displayed conditionally, use the following -instead: - -.. code-block:: jinja - - {% block head %} - {{ parent() }} - - {% if posts is empty %} - - {% endif %} - {% endblock head %} - -.. seealso:: :doc:`block<../functions/block>`, :doc:`block<../tags/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>` diff --git a/vendor/twig/twig/doc/tags/filter.rst b/vendor/twig/twig/doc/tags/filter.rst deleted file mode 100644 index 82ca5c6..0000000 --- a/vendor/twig/twig/doc/tags/filter.rst +++ /dev/null @@ -1,21 +0,0 @@ -``filter`` -========== - -Filter sections allow you to apply regular Twig filters on a block of template -data. Just wrap the code in the special ``filter`` section: - -.. code-block:: jinja - - {% filter upper %} - This text becomes uppercase - {% endfilter %} - -You can also chain filters: - -.. code-block:: jinja - - {% filter lower|escape %} - SOME TEXT - {% endfilter %} - - {# outputs "<strong>some text</strong>" #} diff --git a/vendor/twig/twig/doc/tags/flush.rst b/vendor/twig/twig/doc/tags/flush.rst deleted file mode 100644 index 55ef593..0000000 --- a/vendor/twig/twig/doc/tags/flush.rst +++ /dev/null @@ -1,17 +0,0 @@ -``flush`` -========= - -.. versionadded:: 1.5 - The flush tag was added in Twig 1.5. - -The ``flush`` tag tells Twig to flush the output buffer: - -.. code-block:: jinja - - {% flush %} - -.. note:: - - Internally, Twig uses the PHP `flush`_ function. - -.. _`flush`: http://php.net/flush diff --git a/vendor/twig/twig/doc/tags/for.rst b/vendor/twig/twig/doc/tags/for.rst deleted file mode 100644 index 0673b55..0000000 --- a/vendor/twig/twig/doc/tags/for.rst +++ /dev/null @@ -1,172 +0,0 @@ -``for`` -======= - -Loop over each item in a sequence. For example, to display a list of users -provided in a variable called ``users``: - -.. code-block:: jinja - -

    Members

    -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -.. note:: - - A sequence can be either an array or an object implementing the - ``Traversable`` interface. - -If you do need to iterate over a sequence of numbers, you can use the ``..`` -operator: - -.. code-block:: jinja - - {% for i in 0..10 %} - * {{ i }} - {% endfor %} - -The above snippet of code would print all numbers from 0 to 10. - -It can be also useful with letters: - -.. code-block:: jinja - - {% for letter in 'a'..'z' %} - * {{ letter }} - {% endfor %} - -The ``..`` operator can take any expression at both sides: - -.. code-block:: jinja - - {% for letter in 'a'|upper..'z'|upper %} - * {{ letter }} - {% endfor %} - -.. tip: - - If you need a step different from 1, you can use the ``range`` function - instead. - -The `loop` variable -------------------- - -Inside of a ``for`` loop block you can access some special variables: - -===================== ============================================================= -Variable Description -===================== ============================================================= -``loop.index`` The current iteration of the loop. (1 indexed) -``loop.index0`` The current iteration of the loop. (0 indexed) -``loop.revindex`` The number of iterations from the end of the loop (1 indexed) -``loop.revindex0`` The number of iterations from the end of the loop (0 indexed) -``loop.first`` True if first iteration -``loop.last`` True if last iteration -``loop.length`` The number of items in the sequence -``loop.parent`` The parent context -===================== ============================================================= - -.. code-block:: jinja - - {% for user in users %} - {{ loop.index }} - {{ user.username }} - {% endfor %} - -.. note:: - - The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and - ``loop.last`` variables are only available for PHP arrays, or objects that - implement the ``Countable`` interface. They are also not available when - looping with a condition. - -.. versionadded:: 1.2 - The ``if`` modifier support has been added in Twig 1.2. - -Adding a condition ------------------- - -Unlike in PHP, it's not possible to ``break`` or ``continue`` in a loop. You -can however filter the sequence during iteration which allows you to skip -items. The following example skips all the users which are not active: - -.. code-block:: jinja - -
      - {% for user in users if user.active %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -The advantage is that the special loop variable will count correctly thus not -counting the users not iterated over. Keep in mind that properties like -``loop.last`` will not be defined when using loop conditions. - -.. note:: - - Using the ``loop`` variable within the condition is not recommended as it - will probably not be doing what you expect it to. For instance, adding a - condition like ``loop.index > 4`` won't work as the index is only - incremented when the condition is true (so the condition will never - match). - -The `else` Clause ------------------ - -If no iteration took place because the sequence was empty, you can render a -replacement block by using ``else``: - -.. code-block:: jinja - -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% else %} -
    • no user found
    • - {% endfor %} -
    - -Iterating over Keys -------------------- - -By default, a loop iterates over the values of the sequence. You can iterate -on keys by using the ``keys`` filter: - -.. code-block:: jinja - -

    Members

    -
      - {% for key in users|keys %} -
    • {{ key }}
    • - {% endfor %} -
    - -Iterating over Keys and Values ------------------------------- - -You can also access both keys and values: - -.. code-block:: jinja - -

    Members

    -
      - {% for key, user in users %} -
    • {{ key }}: {{ user.username|e }}
    • - {% endfor %} -
    - -Iterating over a Subset ------------------------ - -You might want to iterate over a subset of values. This can be achieved using -the :doc:`slice <../filters/slice>` filter: - -.. code-block:: jinja - -

    Top Ten Members

    -
      - {% for user in users|slice(0, 10) %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    diff --git a/vendor/twig/twig/doc/tags/from.rst b/vendor/twig/twig/doc/tags/from.rst deleted file mode 100644 index 39334fd..0000000 --- a/vendor/twig/twig/doc/tags/from.rst +++ /dev/null @@ -1,8 +0,0 @@ -``from`` -======== - -The ``from`` tag imports :doc:`macro<../tags/macro>` names into the current -namespace. The tag is documented in detail in the documentation for the -:doc:`import<../tags/import>` tag. - -.. seealso:: :doc:`macro<../tags/macro>`, :doc:`import<../tags/import>` diff --git a/vendor/twig/twig/doc/tags/if.rst b/vendor/twig/twig/doc/tags/if.rst deleted file mode 100644 index 12edf98..0000000 --- a/vendor/twig/twig/doc/tags/if.rst +++ /dev/null @@ -1,76 +0,0 @@ -``if`` -====== - -The ``if`` statement in Twig is comparable with the if statements of PHP. - -In the simplest form you can use it to test if an expression evaluates to -``true``: - -.. code-block:: jinja - - {% if online == false %} -

    Our website is in maintenance mode. Please, come back later.

    - {% endif %} - -You can also test if an array is not empty: - -.. code-block:: jinja - - {% if users %} -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - {% endif %} - -.. note:: - - If you want to test if the variable is defined, use ``if users is - defined`` instead. - -You can also use ``not`` to check for values that evaluate to ``false``: - -.. code-block:: jinja - - {% if not user.subscribed %} -

    You are not subscribed to our mailing list.

    - {% endif %} - -For multiple conditions, ``and`` and ``or`` can be used: - -.. code-block:: jinja - - {% if temperature > 18 and temperature < 27 %} -

    It's a nice day for a walk in the park.

    - {% endif %} - -For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can -use more complex ``expressions`` there too: - -.. code-block:: jinja - - {% if kenny.sick %} - Kenny is sick. - {% elseif kenny.dead %} - You killed Kenny! You bastard!!! - {% else %} - Kenny looks okay --- so far - {% endif %} - -.. note:: - - The rules to determine if an expression is ``true`` or ``false`` are the - same as in PHP; here are the edge cases rules: - - ====================== ==================== - Value Boolean evaluation - ====================== ==================== - empty string false - numeric zero false - whitespace-only string true - empty array false - null false - non-empty array true - object true - ====================== ==================== diff --git a/vendor/twig/twig/doc/tags/import.rst b/vendor/twig/twig/doc/tags/import.rst deleted file mode 100644 index 21a1e19..0000000 --- a/vendor/twig/twig/doc/tags/import.rst +++ /dev/null @@ -1,57 +0,0 @@ -``import`` -========== - -Twig supports putting often used code into :doc:`macros<../tags/macro>`. These -macros can go into different templates and get imported from there. - -There are two ways to import templates. You can import the complete template -into a variable or request specific macros from it. - -Imagine we have a helper module that renders forms (called ``forms.html``): - -.. code-block:: jinja - - {% macro input(name, value, type, size) %} - - {% endmacro %} - - {% macro textarea(name, value, rows, cols) %} - - {% endmacro %} - -The easiest and most flexible is importing the whole module into a variable. -That way you can access the attributes: - -.. code-block:: jinja - - {% import 'forms.html' as forms %} - -
    -
    Username
    -
    {{ forms.input('username') }}
    -
    Password
    -
    {{ forms.input('password', null, 'password') }}
    -
    -

    {{ forms.textarea('comment') }}

    - -Alternatively you can import names from the template into the current -namespace: - -.. code-block:: jinja - - {% from 'forms.html' import input as input_field, textarea %} - -
    -
    Username
    -
    {{ input_field('username') }}
    -
    Password
    -
    {{ input_field('password', '', 'password') }}
    -
    -

    {{ textarea('comment') }}

    - -.. tip:: - - To import macros from the current file, use the special ``_self`` variable - for the source. - -.. seealso:: :doc:`macro<../tags/macro>`, :doc:`from<../tags/from>` diff --git a/vendor/twig/twig/doc/tags/include.rst b/vendor/twig/twig/doc/tags/include.rst deleted file mode 100644 index da18dc6..0000000 --- a/vendor/twig/twig/doc/tags/include.rst +++ /dev/null @@ -1,86 +0,0 @@ -``include`` -=========== - -The ``include`` statement includes a template and returns the rendered content -of that file into the current namespace: - -.. code-block:: jinja - - {% include 'header.html' %} - Body - {% include 'footer.html' %} - -Included templates have access to the variables of the active context. - -If you are using the filesystem loader, the templates are looked for in the -paths defined by it. - -You can add additional variables by passing them after the ``with`` keyword: - -.. code-block:: jinja - - {# template.html will have access to the variables from the current context and the additional ones provided #} - {% include 'template.html' with {'foo': 'bar'} %} - - {% set vars = {'foo': 'bar'} %} - {% include 'template.html' with vars %} - -You can disable access to the context by appending the ``only`` keyword: - -.. code-block:: jinja - - {# only the foo variable will be accessible #} - {% include 'template.html' with {'foo': 'bar'} only %} - -.. code-block:: jinja - - {# no variables will be accessible #} - {% include 'template.html' only %} - -.. tip:: - - When including a template created by an end user, you should consider - sandboxing it. More information in the :doc:`Twig for Developers<../api>` - chapter and in the :doc:`sandbox<../tags/sandbox>` tag documentation. - -The template name can be any valid Twig expression: - -.. code-block:: jinja - - {% include some_var %} - {% include ajax ? 'ajax.html' : 'not_ajax.html' %} - -And if the expression evaluates to a ``Twig_Template`` object, Twig will use it -directly:: - - // {% include template %} - - $template = $twig->loadTemplate('some_template.twig'); - - $twig->loadTemplate('template.twig')->display(array('template' => $template)); - -.. versionadded:: 1.2 - The ``ignore missing`` feature has been added in Twig 1.2. - -You can mark an include with ``ignore missing`` in which case Twig will ignore -the statement if the template to be included does not exist. It has to be -placed just after the template name. Here some valid examples: - -.. code-block:: jinja - - {% include 'sidebar.html' ignore missing %} - {% include 'sidebar.html' ignore missing with {'foo': 'bar'} %} - {% include 'sidebar.html' ignore missing only %} - -.. versionadded:: 1.2 - The possibility to pass an array of templates has been added in Twig 1.2. - -You can also provide a list of templates that are checked for existence before -inclusion. The first template that exists will be included: - -.. code-block:: jinja - - {% include ['page_detailed.html', 'page.html'] %} - -If ``ignore missing`` is given, it will fall back to rendering nothing if none -of the templates exist, otherwise it will throw an exception. diff --git a/vendor/twig/twig/doc/tags/index.rst b/vendor/twig/twig/doc/tags/index.rst deleted file mode 100644 index e6a632b..0000000 --- a/vendor/twig/twig/doc/tags/index.rst +++ /dev/null @@ -1,24 +0,0 @@ -Tags -==== - -.. toctree:: - :maxdepth: 1 - - autoescape - block - do - embed - extends - filter - flush - for - from - if - import - include - macro - sandbox - set - spaceless - use - verbatim diff --git a/vendor/twig/twig/doc/tags/macro.rst b/vendor/twig/twig/doc/tags/macro.rst deleted file mode 100644 index 60a1567..0000000 --- a/vendor/twig/twig/doc/tags/macro.rst +++ /dev/null @@ -1,86 +0,0 @@ -``macro`` -========= - -Macros are comparable with functions in regular programming languages. They -are useful to put often used HTML idioms into reusable elements to not repeat -yourself. - -Here is a small example of a macro that renders a form element: - -.. code-block:: jinja - - {% macro input(name, value, type, size) %} - - {% endmacro %} - -Macros differs from native PHP functions in a few ways: - -* Default argument values are defined by using the ``default`` filter in the - macro body; - -* Arguments of a macro are always optional. - -* If extra positional arguments are passed to a macro, they end up in the - special ``varargs`` variable as a list of values. - -But as with PHP functions, macros don't have access to the current template -variables. - -.. tip:: - - You can pass the whole context as an argument by using the special - ``_context`` variable. - -Macros can be defined in any template, and need to be "imported" before being -used (see the documentation for the :doc:`import<../tags/import>` tag for more -information): - -.. code-block:: jinja - - {% import "forms.html" as forms %} - -The above ``import`` call imports the "forms.html" file (which can contain only -macros, or a template and some macros), and import the functions as items of -the ``forms`` variable. - -The macro can then be called at will: - -.. code-block:: jinja - -

    {{ forms.input('username') }}

    -

    {{ forms.input('password', null, 'password') }}

    - -If macros are defined and used in the same template, you can use the -special ``_self`` variable to import them: - -.. code-block:: jinja - - {% import _self as forms %} - -

    {{ forms.input('username') }}

    - -.. warning:: - - When you define a macro in the template where you are going to use it, you - might be tempted to call the macro directly via ``_self.input()`` instead - of importing it; even if seems to work, this is just a side-effect of the - current implementation and it won't work anymore in Twig 2.x. - -When you want to use a macro in another macro from the same file, you need to -import it locally: - -.. code-block:: jinja - - {% macro input(name, value, type, size) %} - - {% endmacro %} - - {% macro wrapped_input(name, value, type, size) %} - {% import _self as forms %} - -
    - {{ forms.input(name, value, type, size) }} -
    - {% endmacro %} - -.. seealso:: :doc:`from<../tags/from>`, :doc:`import<../tags/import>` diff --git a/vendor/twig/twig/doc/tags/sandbox.rst b/vendor/twig/twig/doc/tags/sandbox.rst deleted file mode 100644 index e186726..0000000 --- a/vendor/twig/twig/doc/tags/sandbox.rst +++ /dev/null @@ -1,30 +0,0 @@ -``sandbox`` -=========== - -The ``sandbox`` tag can be used to enable the sandboxing mode for an included -template, when sandboxing is not enabled globally for the Twig environment: - -.. code-block:: jinja - - {% sandbox %} - {% include 'user.html' %} - {% endsandbox %} - -.. warning:: - - The ``sandbox`` tag is only available when the sandbox extension is - enabled (see the :doc:`Twig for Developers<../api>` chapter). - -.. note:: - - The ``sandbox`` tag can only be used to sandbox an include tag and it - cannot be used to sandbox a section of a template. The following example - won't work: - - .. code-block:: jinja - - {% sandbox %} - {% for i in 1..2 %} - {{ i }} - {% endfor %} - {% endsandbox %} diff --git a/vendor/twig/twig/doc/tags/set.rst b/vendor/twig/twig/doc/tags/set.rst deleted file mode 100644 index 3eba239..0000000 --- a/vendor/twig/twig/doc/tags/set.rst +++ /dev/null @@ -1,78 +0,0 @@ -``set`` -======= - -Inside code blocks you can also assign values to variables. Assignments use -the ``set`` tag and can have multiple targets. - -Here is how you can assign the ``bar`` value to the ``foo`` variable: - -.. code-block:: jinja - - {% set foo = 'bar' %} - -After the ``set`` call, the ``foo`` variable is available in the template like -any other ones: - -.. code-block:: jinja - - {# displays bar #} - {{ foo }} - -The assigned value can be any valid :ref:`Twig expressions -`: - -.. code-block:: jinja - - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - {% set foo = 'foo' ~ 'bar' %} - -Several variables can be assigned in one block: - -.. code-block:: jinja - - {% set foo, bar = 'foo', 'bar' %} - - {# is equivalent to #} - - {% set foo = 'foo' %} - {% set bar = 'bar' %} - -The ``set`` tag can also be used to 'capture' chunks of text: - -.. code-block:: jinja - - {% set foo %} - - {% endset %} - -.. caution:: - - If you enable automatic output escaping, Twig will only consider the - content to be safe when capturing chunks of text. - -.. note:: - - Note that loops are scoped in Twig; therefore a variable declared inside a - ``for`` loop is not accessible outside the loop itself: - - .. code-block:: jinja - - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is NOT available #} - - If you want to access the variable, just declare it before the loop: - - .. code-block:: jinja - - {% set foo = "" %} - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is available #} diff --git a/vendor/twig/twig/doc/tags/spaceless.rst b/vendor/twig/twig/doc/tags/spaceless.rst deleted file mode 100644 index b39cb27..0000000 --- a/vendor/twig/twig/doc/tags/spaceless.rst +++ /dev/null @@ -1,37 +0,0 @@ -``spaceless`` -============= - -Use the ``spaceless`` tag to remove whitespace *between HTML tags*, not -whitespace within HTML tags or whitespace in plain text: - -.. code-block:: jinja - - {% spaceless %} -
    - foo -
    - {% endspaceless %} - - {# output will be
    foo
    #} - -This tag is not meant to "optimize" the size of the generated HTML content but -merely to avoid extra whitespace between HTML tags to avoid browser rendering -quirks under some circumstances. - -.. tip:: - - If you want to optimize the size of the generated HTML content, gzip - compress the output instead. - -.. tip:: - - If you want to create a tag that actually removes all extra whitespace in - an HTML string, be warned that this is not as easy as it seems to be - (think of ``textarea`` or ``pre`` tags for instance). Using a third-party - library like Tidy is probably a better idea. - -.. tip:: - - For more information on whitespace control, read the - :ref:`dedicated section ` of the documentation and learn how - you can also use the whitespace control modifier on your tags. diff --git a/vendor/twig/twig/doc/tags/use.rst b/vendor/twig/twig/doc/tags/use.rst deleted file mode 100644 index 071b197..0000000 --- a/vendor/twig/twig/doc/tags/use.rst +++ /dev/null @@ -1,124 +0,0 @@ -``use`` -======= - -.. versionadded:: 1.1 - Horizontal reuse was added in Twig 1.1. - -.. note:: - - Horizontal reuse is an advanced Twig feature that is hardly ever needed in - regular templates. It is mainly used by projects that need to make - template blocks reusable without using inheritance. - -Template inheritance is one of the most powerful Twig's feature but it is -limited to single inheritance; a template can only extend one other template. -This limitation makes template inheritance simple to understand and easy to -debug: - -.. code-block:: jinja - - {% extends "base.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -Horizontal reuse is a way to achieve the same goal as multiple inheritance, -but without the associated complexity: - -.. code-block:: jinja - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -The ``use`` statement tells Twig to import the blocks defined in -``blocks.html`` into the current template (it's like macros, but for blocks): - -.. code-block:: jinja - - {# blocks.html #} - - {% block sidebar %}{% endblock %} - -In this example, the ``use`` statement imports the ``sidebar`` block into the -main template. The code is mostly equivalent to the following one (the -imported blocks are not outputted automatically): - -.. code-block:: jinja - - {% extends "base.html" %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -.. note:: - - The ``use`` tag only imports a template if it does not extend another - template, if it does not define macros, and if the body is empty. But it - can *use* other templates. - -.. note:: - - Because ``use`` statements are resolved independently of the context - passed to the template, the template reference cannot be an expression. - -The main template can also override any imported block. If the template -already defines the ``sidebar`` block, then the one defined in ``blocks.html`` -is ignored. To avoid name conflicts, you can rename imported blocks: - -.. code-block:: jinja - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as base_sidebar, title as base_title %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -.. versionadded:: 1.3 - The ``parent()`` support was added in Twig 1.3. - -The ``parent()`` function automatically determines the correct inheritance -tree, so it can be used when overriding a block defined in an imported -template: - -.. code-block:: jinja - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block sidebar %} - {{ parent() }} - {% endblock %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -In this example, ``parent()`` will correctly call the ``sidebar`` block from -the ``blocks.html`` template. - -.. tip:: - - In Twig 1.2, renaming allows you to simulate inheritance by calling the - "parent" block: - - .. code-block:: jinja - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as parent_sidebar %} - - {% block sidebar %} - {{ block('parent_sidebar') }} - {% endblock %} - -.. note:: - - You can use as many ``use`` statements as you want in any given template. - If two imported templates define the same block, the latest one wins. diff --git a/vendor/twig/twig/doc/tags/verbatim.rst b/vendor/twig/twig/doc/tags/verbatim.rst deleted file mode 100644 index fe61ca1..0000000 --- a/vendor/twig/twig/doc/tags/verbatim.rst +++ /dev/null @@ -1,24 +0,0 @@ -``verbatim`` -============ - -.. versionadded:: 1.12 - The ``verbatim`` tag was added in Twig 1.12 (it was named ``raw`` before). - -The ``verbatim`` tag marks sections as being raw text that should not be -parsed. For example to put Twig syntax as example into a template you can use -this snippet: - -.. code-block:: jinja - - {% verbatim %} -
      - {% for item in seq %} -
    • {{ item }}
    • - {% endfor %} -
    - {% endverbatim %} - -.. note:: - - The ``verbatim`` tag works in the exact same way as the old ``raw`` tag, - but was renamed to avoid confusion with the ``raw`` filter. \ No newline at end of file diff --git a/vendor/twig/twig/doc/templates.rst b/vendor/twig/twig/doc/templates.rst deleted file mode 100644 index 2d59b1a..0000000 --- a/vendor/twig/twig/doc/templates.rst +++ /dev/null @@ -1,888 +0,0 @@ -Twig for Template Designers -=========================== - -This document describes the syntax and semantics of the template engine and -will be most useful as reference to those creating Twig templates. - -Synopsis --------- - -A template is simply a text file. It can generate any text-based format (HTML, -XML, CSV, LaTeX, etc.). It doesn't have a specific extension, ``.html`` or -``.xml`` are just fine. - -A template contains **variables** or **expressions**, which get replaced with -values when the template is evaluated, and **tags**, which control the logic -of the template. - -Below is a minimal template that illustrates a few basics. We will cover further -details later on: - -.. code-block:: html+jinja - - - - - My Webpage - - - - -

    My Webpage

    - {{ a_variable }} - - - -There are two kinds of delimiters: ``{% ... %}`` and ``{{ ... }}``. The first -one is used to execute statements such as for-loops, the latter prints the -result of an expression to the template. - -IDEs Integration ----------------- - -Many IDEs support syntax highlighting and auto-completion for Twig: - -* *Textmate* via the `Twig bundle`_ -* *Vim* via the `Jinja syntax plugin`_ or the `vim-twig plugin`_ -* *Netbeans* via the `Twig syntax plugin`_ (until 7.1, native as of 7.2) -* *PhpStorm* (native as of 2.1) -* *Eclipse* via the `Twig plugin`_ -* *Sublime Text* via the `Twig bundle`_ -* *GtkSourceView* via the `Twig language definition`_ (used by gedit and other projects) -* *Coda* and *SubEthaEdit* via the `Twig syntax mode`_ -* *Coda 2* via the `other Twig syntax mode`_ -* *Komodo* and *Komodo Edit* via the Twig highlight/syntax check mode -* *Notepad++* via the `Notepad++ Twig Highlighter`_ -* *Emacs* via `web-mode.el`_ -* *Atom* via the `PHP-twig for atom`_ - -Also, `TwigFiddle`_ is an online service that allows you to execute Twig templates -from a browser; it supports all versions of Twig. - -Variables ---------- - -The application passes variables to the templates for manipulation in the -template. Variables may have attributes or elements you can access, -too. The visual representation of a variable depends heavily on the application providing -it. - -You can use a dot (``.``) to access attributes of a variable (methods or -properties of a PHP object, or items of a PHP array), or the so-called -"subscript" syntax (``[]``): - -.. code-block:: jinja - - {{ foo.bar }} - {{ foo['bar'] }} - -When the attribute contains special characters (like ``-`` that would be -interpreted as the minus operator), use the ``attribute`` function instead to -access the variable attribute: - -.. code-block:: jinja - - {# equivalent to the non-working foo.data-foo #} - {{ attribute(foo, 'data-foo') }} - -.. note:: - - It's important to know that the curly braces are *not* part of the - variable but the print statement. When accessing variables inside tags, - don't put the braces around them. - -If a variable or attribute does not exist, you will receive a ``null`` value -when the ``strict_variables`` option is set to ``false``; alternatively, if ``strict_variables`` -is set, Twig will throw an error (see :ref:`environment options`). - -.. sidebar:: Implementation - - For convenience's sake ``foo.bar`` does the following things on the PHP - layer: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid property; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid method - (even if ``bar`` is the constructor - use ``__construct()`` instead); - * if not, and if ``foo`` is an object, check that ``getBar`` is a valid method; - * if not, and if ``foo`` is an object, check that ``isBar`` is a valid method; - * if not, return a ``null`` value. - - ``foo['bar']`` on the other hand only works with PHP arrays: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, return a ``null`` value. - -.. note:: - - If you want to access a dynamic attribute of a variable, use the - :doc:`attribute` function instead. - -Global Variables -~~~~~~~~~~~~~~~~ - -The following variables are always available in templates: - -* ``_self``: references the current template (deprecated since Twig 1.20); -* ``_context``: references the current context; -* ``_charset``: references the current charset. - -Setting Variables -~~~~~~~~~~~~~~~~~ - -You can assign values to variables inside code blocks. Assignments use the -:doc:`set` tag: - -.. code-block:: jinja - - {% set foo = 'foo' %} - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - -Filters -------- - -Variables can be modified by **filters**. Filters are separated from the -variable by a pipe symbol (``|``) and may have optional arguments in -parentheses. Multiple filters can be chained. The output of one filter is -applied to the next. - -The following example removes all HTML tags from the ``name`` and title-cases -it: - -.. code-block:: jinja - - {{ name|striptags|title }} - -Filters that accept arguments have parentheses around the arguments. This -example will join a list by commas: - -.. code-block:: jinja - - {{ list|join(', ') }} - -To apply a filter on a section of code, wrap it in the -:doc:`filter` tag: - -.. code-block:: jinja - - {% filter upper %} - This text becomes uppercase - {% endfilter %} - -Go to the :doc:`filters` page to learn more about built-in -filters. - -Functions ---------- - -Functions can be called to generate content. Functions are called by their -name followed by parentheses (``()``) and may have arguments. - -For instance, the ``range`` function returns a list containing an arithmetic -progression of integers: - -.. code-block:: jinja - - {% for i in range(0, 3) %} - {{ i }}, - {% endfor %} - -Go to the :doc:`functions` page to learn more about the -built-in functions. - -Named Arguments ---------------- - -.. versionadded:: 1.12 - Support for named arguments was added in Twig 1.12. - -.. code-block:: jinja - - {% for i in range(low=1, high=10, step=2) %} - {{ i }}, - {% endfor %} - -Using named arguments makes your templates more explicit about the meaning of -the values you pass as arguments: - -.. code-block:: jinja - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - - {# versus #} - - {{ data|convert_encoding(from='iso-2022-jp', to='UTF-8') }} - -Named arguments also allow you to skip some arguments for which you don't want -to change the default value: - -.. code-block:: jinja - - {# the first argument is the date format, which defaults to the global date format if null is passed #} - {{ "now"|date(null, "Europe/Paris") }} - - {# or skip the format value by using a named argument for the time zone #} - {{ "now"|date(timezone="Europe/Paris") }} - -You can also use both positional and named arguments in one call, in which -case positional arguments must always come before named arguments: - -.. code-block:: jinja - - {{ "now"|date('d/m/Y H:i', timezone="Europe/Paris") }} - -.. tip:: - - Each function and filter documentation page has a section where the names - of all arguments are listed when supported. - -Control Structure ------------------ - -A control structure refers to all those things that control the flow of a -program - conditionals (i.e. ``if``/``elseif``/``else``), ``for``-loops, as -well as things like blocks. Control structures appear inside ``{% ... %}`` -blocks. - -For example, to display a list of users provided in a variable called -``users``, use the :doc:`for` tag: - -.. code-block:: jinja - -

    Members

    -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -The :doc:`if` tag can be used to test an expression: - -.. code-block:: jinja - - {% if users|length > 0 %} -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - {% endif %} - -Go to the :doc:`tags` page to learn more about the built-in tags. - -Comments --------- - -To comment-out part of a line in a template, use the comment syntax ``{# ... -#}``. This is useful for debugging or to add information for other template -designers or yourself: - -.. code-block:: jinja - - {# note: disabled template because we no longer use this - {% for user in users %} - ... - {% endfor %} - #} - -Including other Templates -------------------------- - -The :doc:`include` tag is useful to include a template and -return the rendered content of that template into the current one: - -.. code-block:: jinja - - {% include 'sidebar.html' %} - -Per default included templates are passed the current context. - -The context that is passed to the included template includes variables defined -in the template: - -.. code-block:: jinja - - {% for box in boxes %} - {% include "render_box.html" %} - {% endfor %} - -The included template ``render_box.html`` is able to access ``box``. - -The filename of the template depends on the template loader. For instance, the -``Twig_Loader_Filesystem`` allows you to access other templates by giving the -filename. You can access templates in subdirectories with a slash: - -.. code-block:: jinja - - {% include "sections/articles/sidebar.html" %} - -This behavior depends on the application embedding Twig. - -Template Inheritance --------------------- - -The most powerful part of Twig is template inheritance. Template inheritance -allows you to build a base "skeleton" template that contains all the common -elements of your site and defines **blocks** that child templates can -override. - -Sounds complicated but it is very basic. It's easier to understand it by -starting with an example. - -Let's define a base template, ``base.html``, which defines a simple HTML -skeleton document that you might use for a simple two-column page: - -.. code-block:: html+jinja - - - - - {% block head %} - - {% block title %}{% endblock %} - My Webpage - {% endblock %} - - -
    {% block content %}{% endblock %}
    - - - - -In this example, the :doc:`block` tags define four blocks that -child templates can fill in. All the ``block`` tag does is to tell the -template engine that a child template may override those portions of the -template. - -A child template might look like this: - -.. code-block:: jinja - - {% extends "base.html" %} - - {% block title %}Index{% endblock %} - {% block head %} - {{ parent() }} - - {% endblock %} - {% block content %} -

    Index

    -

    - Welcome to my awesome homepage. -

    - {% endblock %} - -The :doc:`extends` tag is the key here. It tells the template -engine that this template "extends" another template. When the template system -evaluates this template, first it locates the parent. The extends tag should -be the first tag in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -It's possible to render the contents of the parent block by using the -:doc:`parent` function. This gives back the results of the -parent block: - -.. code-block:: jinja - - {% block sidebar %} -

    Table Of Contents

    - ... - {{ parent() }} - {% endblock %} - -.. tip:: - - The documentation page for the :doc:`extends` tag describes - more advanced features like block nesting, scope, dynamic inheritance, and - conditional inheritance. - -.. note:: - - Twig also supports multiple inheritance with the so called horizontal reuse - with the help of the :doc:`use` tag. This is an advanced feature - hardly ever needed in regular templates. - -HTML Escaping -------------- - -When generating HTML from templates, there's always a risk that a variable -will include characters that affect the resulting HTML. There are two -approaches: manually escaping each variable or automatically escaping -everything by default. - -Twig supports both, automatic escaping is enabled by default. - -.. note:: - - Automatic escaping is only supported if the *escaper* extension has been - enabled (which is the default). - -Working with Manual Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If manual escaping is enabled, it is **your** responsibility to escape -variables if needed. What to escape? Any variable you don't trust. - -Escaping works by piping the variable through the -:doc:`escape` or ``e`` filter: - -.. code-block:: jinja - - {{ user.username|e }} - -By default, the ``escape`` filter uses the ``html`` strategy, but depending on -the escaping context, you might want to explicitly use any other available -strategies: - -.. code-block:: jinja - - {{ user.username|e('js') }} - {{ user.username|e('css') }} - {{ user.username|e('url') }} - {{ user.username|e('html_attr') }} - -Working with Automatic Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Whether automatic escaping is enabled or not, you can mark a section of a -template to be escaped or not by using the :doc:`autoescape` -tag: - -.. code-block:: jinja - - {% autoescape %} - Everything will be automatically escaped in this block (using the HTML strategy) - {% endautoescape %} - -By default, auto-escaping uses the ``html`` escaping strategy. If you output -variables in other contexts, you need to explicitly escape them with the -appropriate escaping strategy: - -.. code-block:: jinja - - {% autoescape 'js' %} - Everything will be automatically escaped in this block (using the JS strategy) - {% endautoescape %} - -Escaping --------- - -It is sometimes desirable or even necessary to have Twig ignore parts it would -otherwise handle as variables or blocks. For example if the default syntax is -used and you want to use ``{{`` as raw string in the template and not start a -variable you have to use a trick. - -The easiest way is to output the variable delimiter (``{{``) by using a variable -expression: - -.. code-block:: jinja - - {{ '{{' }} - -For bigger sections it makes sense to mark a block -:doc:`verbatim`. - -Macros ------- - -.. versionadded:: 1.12 - Support for default argument values was added in Twig 1.12. - -Macros are comparable with functions in regular programming languages. They -are useful to reuse often used HTML fragments to not repeat yourself. - -A macro is defined via the :doc:`macro` tag. Here is a small example -(subsequently called ``forms.html``) of a macro that renders a form element: - -.. code-block:: jinja - - {% macro input(name, value, type, size) %} - - {% endmacro %} - -Macros can be defined in any template, and need to be "imported" via the -:doc:`import` tag before being used: - -.. code-block:: jinja - - {% import "forms.html" as forms %} - -

    {{ forms.input('username') }}

    - -Alternatively, you can import individual macro names from a template into the -current namespace via the :doc:`from` tag and optionally alias them: - -.. code-block:: jinja - - {% from 'forms.html' import input as input_field %} - -
    -
    Username
    -
    {{ input_field('username') }}
    -
    Password
    -
    {{ input_field('password', '', 'password') }}
    -
    - -A default value can also be defined for macro arguments when not provided in a -macro call: - -.. code-block:: jinja - - {% macro input(name, value = "", type = "text", size = 20) %} - - {% endmacro %} - -If extra positional arguments are passed to a macro call, they end up in the -special ``varargs`` variable as a list of values. - -.. _twig-expressions: - -Expressions ------------ - -Twig allows expressions everywhere. These work very similar to regular PHP and -even if you're not working with PHP you should feel comfortable with it. - -.. note:: - - The operator precedence is as follows, with the lowest-precedence - operators listed first: ``b-and``, ``b-xor``, ``b-or``, ``or``, ``and``, - ``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``, ``in``, ``matches``, - ``starts with``, ``ends with``, ``..``, ``+``, ``-``, ``~``, ``*``, ``/``, - ``//``, ``%``, ``is``, ``**``, ``|``, ``[]``, and ``.``: - - .. code-block:: jinja - - {% set greeting = 'Hello ' %} - {% set name = 'Fabien' %} - - {{ greeting ~ name|lower }} {# Hello fabien #} - - {# use parenthesis to change precedence #} - {{ (greeting ~ name)|lower }} {# hello fabien #} - -Literals -~~~~~~~~ - -.. versionadded:: 1.5 - Support for hash keys as names and expressions was added in Twig 1.5. - -The simplest form of expressions are literals. Literals are representations -for PHP types such as strings, numbers, and arrays. The following literals -exist: - -* ``"Hello World"``: Everything between two double or single quotes is a - string. They are useful whenever you need a string in the template (for - example as arguments to function calls, filters or just to extend or include - a template). A string can contain a delimiter if it is preceded by a - backslash (``\``) -- like in ``'It\'s good'``. - -* ``42`` / ``42.23``: Integers and floating point numbers are created by just - writing the number down. If a dot is present the number is a float, - otherwise an integer. - -* ``["foo", "bar"]``: Arrays are defined by a sequence of expressions - separated by a comma (``,``) and wrapped with squared brackets (``[]``). - -* ``{"foo": "bar"}``: Hashes are defined by a list of keys and values - separated by a comma (``,``) and wrapped with curly braces (``{}``): - - .. code-block:: jinja - - {# keys as string #} - { 'foo': 'foo', 'bar': 'bar' } - - {# keys as names (equivalent to the previous hash) -- as of Twig 1.5 #} - { foo: 'foo', bar: 'bar' } - - {# keys as integer #} - { 2: 'foo', 4: 'bar' } - - {# keys as expressions (the expression must be enclosed into parentheses) -- as of Twig 1.5 #} - { (1 + 1): 'foo', (a ~ 'b'): 'bar' } - -* ``true`` / ``false``: ``true`` represents the true value, ``false`` - represents the false value. - -* ``null``: ``null`` represents no specific value. This is the value returned - when a variable does not exist. ``none`` is an alias for ``null``. - -Arrays and hashes can be nested: - -.. code-block:: jinja - - {% set foo = [1, {"foo": "bar"}] %} - -.. tip:: - - Using double-quoted or single-quoted strings has no impact on performance - but string interpolation is only supported in double-quoted strings. - -Math -~~~~ - -Twig allows you to calculate with values. This is rarely useful in templates -but exists for completeness' sake. The following operators are supported: - -* ``+``: Adds two objects together (the operands are casted to numbers). ``{{ - 1 + 1 }}`` is ``2``. - -* ``-``: Subtracts the second number from the first one. ``{{ 3 - 2 }}`` is - ``1``. - -* ``/``: Divides two numbers. The returned value will be a floating point - number. ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``. - -* ``%``: Calculates the remainder of an integer division. ``{{ 11 % 7 }}`` is - ``4``. - -* ``//``: Divides two numbers and returns the floored integer result. ``{{ 20 - // 7 }}`` is ``2``, ``{{ -20 // 7 }}`` is ``-3`` (this is just syntactic - sugar for the :doc:`round` filter). - -* ``*``: Multiplies the left operand with the right one. ``{{ 2 * 2 }}`` would - return ``4``. - -* ``**``: Raises the left operand to the power of the right operand. ``{{ 2 ** - 3 }}`` would return ``8``. - -Logic -~~~~~ - -You can combine multiple expressions with the following operators: - -* ``and``: Returns true if the left and the right operands are both true. - -* ``or``: Returns true if the left or the right operand is true. - -* ``not``: Negates a statement. - -* ``(expr)``: Groups an expression. - -.. note:: - - Twig also support bitwise operators (``b-and``, ``b-xor``, and ``b-or``). - -.. note:: - - Operators are case sensitive. - -Comparisons -~~~~~~~~~~~ - -The following comparison operators are supported in any expression: ``==``, -``!=``, ``<``, ``>``, ``>=``, and ``<=``. - -You can also check if a string ``starts with`` or ``ends with`` another -string: - -.. code-block:: jinja - - {% if 'Fabien' starts with 'F' %} - {% endif %} - - {% if 'Fabien' ends with 'n' %} - {% endif %} - -.. note:: - - For complex string comparisons, the ``matches`` operator allows you to use - `regular expressions`_: - - .. code-block:: jinja - - {% if phone matches '/^[\\d\\.]+$/' %} - {% endif %} - -Containment Operator -~~~~~~~~~~~~~~~~~~~~ - -The ``in`` operator performs containment test. - -It returns ``true`` if the left operand is contained in the right: - -.. code-block:: jinja - - {# returns true #} - - {{ 1 in [1, 2, 3] }} - - {{ 'cd' in 'abcde' }} - -.. tip:: - - You can use this filter to perform a containment test on strings, arrays, - or objects implementing the ``Traversable`` interface. - -To perform a negative test, use the ``not in`` operator: - -.. code-block:: jinja - - {% if 1 not in [1, 2, 3] %} - - {# is equivalent to #} - {% if not (1 in [1, 2, 3]) %} - -Test Operator -~~~~~~~~~~~~~ - -The ``is`` operator performs tests. Tests can be used to test a variable against -a common expression. The right operand is name of the test: - -.. code-block:: jinja - - {# find out if a variable is odd #} - - {{ name is odd }} - -Tests can accept arguments too: - -.. code-block:: jinja - - {% if post.status is constant('Post::PUBLISHED') %} - -Tests can be negated by using the ``is not`` operator: - -.. code-block:: jinja - - {% if post.status is not constant('Post::PUBLISHED') %} - - {# is equivalent to #} - {% if not (post.status is constant('Post::PUBLISHED')) %} - -Go to the :doc:`tests` page to learn more about the built-in -tests. - -Other Operators -~~~~~~~~~~~~~~~ - -.. versionadded:: 1.12.0 - Support for the extended ternary operator was added in Twig 1.12.0. - -The following operators are very useful but don't fit into any of the other -categories: - -* ``..``: Creates a sequence based on the operand before and after the - operator (this is just syntactic sugar for the :doc:`range` - function). - -* ``|``: Applies a filter. - -* ``~``: Converts all operands into strings and concatenates them. ``{{ "Hello - " ~ name ~ "!" }}`` would return (assuming ``name`` is ``'John'``) ``Hello - John!``. - -* ``.``, ``[]``: Gets an attribute of an object. - -* ``?:``: The ternary operator: - - .. code-block:: jinja - - {{ foo ? 'yes' : 'no' }} - - {# as of Twig 1.12.0 #} - {{ foo ?: 'no' }} is the same as {{ foo ? foo : 'no' }} - {{ foo ? 'yes' }} is the same as {{ foo ? 'yes' : '' }} - -String Interpolation -~~~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 1.5 - String interpolation was added in Twig 1.5. - -String interpolation (`#{expression}`) allows any valid expression to appear -within a *double-quoted string*. The result of evaluating that expression is -inserted into the string: - -.. code-block:: jinja - - {{ "foo #{bar} baz" }} - {{ "foo #{1 + 2} baz" }} - -.. _templates-whitespace-control: - -Whitespace Control ------------------- - -.. versionadded:: 1.1 - Tag level whitespace control was added in Twig 1.1. - -The first newline after a template tag is removed automatically (like in PHP.) -Whitespace is not further modified by the template engine, so each whitespace -(spaces, tabs, newlines etc.) is returned unchanged. - -Use the ``spaceless`` tag to remove whitespace *between HTML tags*: - -.. code-block:: jinja - - {% spaceless %} -
    - foo bar -
    - {% endspaceless %} - - {# output will be
    foo bar
    #} - -In addition to the spaceless tag you can also control whitespace on a per tag -level. By using the whitespace control modifier on your tags, you can trim -leading and or trailing whitespace: - -.. code-block:: jinja - - {% set value = 'no spaces' %} - {#- No leading/trailing whitespace -#} - {%- if true -%} - {{- value -}} - {%- endif -%} - - {# output 'no spaces' #} - -The above sample shows the default whitespace control modifier, and how you can -use it to remove whitespace around tags. Trimming space will consume all whitespace -for that side of the tag. It is possible to use whitespace trimming on one side -of a tag: - -.. code-block:: jinja - - {% set value = 'no spaces' %} -
  • {{- value }}
  • - - {# outputs '
  • no spaces
  • ' #} - -Extensions ----------- - -Twig can be easily extended. - -If you are looking for new tags, filters, or functions, have a look at the Twig official -`extension repository`_. - -If you want to create your own, read the :ref:`Creating an -Extension` chapter. - -.. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle -.. _`Jinja syntax plugin`: http://jinja.pocoo.org/docs/integration/#vim -.. _`vim-twig plugin`: https://github.com/evidens/vim-twig -.. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig -.. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin -.. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language -.. _`extension repository`: http://github.com/twigphp/Twig-extensions -.. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode -.. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode -.. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig -.. _`web-mode.el`: http://web-mode.org/ -.. _`regular expressions`: http://php.net/manual/en/pcre.pattern.php -.. _`PHP-twig for atom`: https://github.com/reesef/php-twig -.. _`TwigFiddle`: http://twigfiddle.com/ diff --git a/vendor/twig/twig/doc/tests/constant.rst b/vendor/twig/twig/doc/tests/constant.rst deleted file mode 100644 index 8d0724a..0000000 --- a/vendor/twig/twig/doc/tests/constant.rst +++ /dev/null @@ -1,22 +0,0 @@ -``constant`` -============ - -.. versionadded: 1.13.1 - constant now accepts object instances as the second argument. - -``constant`` checks if a variable has the exact same value as a constant. You -can use either global constants or class constants: - -.. code-block:: jinja - - {% if post.status is constant('Post::PUBLISHED') %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} - -You can test constants from object instances as well: - -.. code-block:: jinja - - {% if post.status is constant('PUBLISHED', post) %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} diff --git a/vendor/twig/twig/doc/tests/defined.rst b/vendor/twig/twig/doc/tests/defined.rst deleted file mode 100644 index 702ce72..0000000 --- a/vendor/twig/twig/doc/tests/defined.rst +++ /dev/null @@ -1,30 +0,0 @@ -``defined`` -=========== - -``defined`` checks if a variable is defined in the current context. This is very -useful if you use the ``strict_variables`` option: - -.. code-block:: jinja - - {# defined works with variable names #} - {% if foo is defined %} - ... - {% endif %} - - {# and attributes on variables names #} - {% if foo.bar is defined %} - ... - {% endif %} - - {% if foo['bar'] is defined %} - ... - {% endif %} - -When using the ``defined`` test on an expression that uses variables in some -method calls, be sure that they are all defined first: - -.. code-block:: jinja - - {% if var is defined and foo.method(var) is defined %} - ... - {% endif %} diff --git a/vendor/twig/twig/doc/tests/divisibleby.rst b/vendor/twig/twig/doc/tests/divisibleby.rst deleted file mode 100644 index 6c693b2..0000000 --- a/vendor/twig/twig/doc/tests/divisibleby.rst +++ /dev/null @@ -1,14 +0,0 @@ -``divisible by`` -================ - -.. versionadded:: 1.14.2 - The ``divisible by`` test was added in Twig 1.14.2 as an alias for - ``divisibleby``. - -``divisible by`` checks if a variable is divisible by a number: - -.. code-block:: jinja - - {% if loop.index is divisible by(3) %} - ... - {% endif %} diff --git a/vendor/twig/twig/doc/tests/empty.rst b/vendor/twig/twig/doc/tests/empty.rst deleted file mode 100644 index e5b5599..0000000 --- a/vendor/twig/twig/doc/tests/empty.rst +++ /dev/null @@ -1,11 +0,0 @@ -``empty`` -========= - -``empty`` checks if a variable is empty: - -.. code-block:: jinja - - {# evaluates to true if the foo variable is null, false, an empty array, or the empty string #} - {% if foo is empty %} - ... - {% endif %} diff --git a/vendor/twig/twig/doc/tests/even.rst b/vendor/twig/twig/doc/tests/even.rst deleted file mode 100644 index 6ab5cc3..0000000 --- a/vendor/twig/twig/doc/tests/even.rst +++ /dev/null @@ -1,10 +0,0 @@ -``even`` -======== - -``even`` returns ``true`` if the given number is even: - -.. code-block:: jinja - - {{ var is even }} - -.. seealso:: :doc:`odd<../tests/odd>` diff --git a/vendor/twig/twig/doc/tests/index.rst b/vendor/twig/twig/doc/tests/index.rst deleted file mode 100644 index c63208e..0000000 --- a/vendor/twig/twig/doc/tests/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -Tests -===== - -.. toctree:: - :maxdepth: 1 - - constant - defined - divisibleby - empty - even - iterable - null - odd - sameas diff --git a/vendor/twig/twig/doc/tests/iterable.rst b/vendor/twig/twig/doc/tests/iterable.rst deleted file mode 100644 index 89a172f..0000000 --- a/vendor/twig/twig/doc/tests/iterable.rst +++ /dev/null @@ -1,19 +0,0 @@ -``iterable`` -============ - -.. versionadded:: 1.7 - The iterable test was added in Twig 1.7. - -``iterable`` checks if a variable is an array or a traversable object: - -.. code-block:: jinja - - {# evaluates to true if the foo variable is iterable #} - {% if users is iterable %} - {% for user in users %} - Hello {{ user }}! - {% endfor %} - {% else %} - {# users is probably a string #} - Hello {{ users }}! - {% endif %} diff --git a/vendor/twig/twig/doc/tests/null.rst b/vendor/twig/twig/doc/tests/null.rst deleted file mode 100644 index 44eec62..0000000 --- a/vendor/twig/twig/doc/tests/null.rst +++ /dev/null @@ -1,12 +0,0 @@ -``null`` -======== - -``null`` returns ``true`` if the variable is ``null``: - -.. code-block:: jinja - - {{ var is null }} - -.. note:: - - ``none`` is an alias for ``null``. diff --git a/vendor/twig/twig/doc/tests/odd.rst b/vendor/twig/twig/doc/tests/odd.rst deleted file mode 100644 index 9eece77..0000000 --- a/vendor/twig/twig/doc/tests/odd.rst +++ /dev/null @@ -1,10 +0,0 @@ -``odd`` -======= - -``odd`` returns ``true`` if the given number is odd: - -.. code-block:: jinja - - {{ var is odd }} - -.. seealso:: :doc:`even<../tests/even>` diff --git a/vendor/twig/twig/doc/tests/sameas.rst b/vendor/twig/twig/doc/tests/sameas.rst deleted file mode 100644 index 16f904d..0000000 --- a/vendor/twig/twig/doc/tests/sameas.rst +++ /dev/null @@ -1,14 +0,0 @@ -``same as`` -=========== - -.. versionadded:: 1.14.2 - The ``same as`` test was added in Twig 1.14.2 as an alias for ``sameas``. - -``same as`` checks if a variable is the same as another variable. -This is the equivalent to ``===`` in PHP: - -.. code-block:: jinja - - {% if foo.attribute is same as(false) %} - the foo attribute really is the 'false' PHP value - {% endif %} diff --git a/vendor/twig/twig/ext/twig/.gitignore b/vendor/twig/twig/ext/twig/.gitignore deleted file mode 100644 index 56ea76c..0000000 --- a/vendor/twig/twig/ext/twig/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -*.sw* -.deps -Makefile -Makefile.fragments -Makefile.global -Makefile.objects -acinclude.m4 -aclocal.m4 -build/ -config.cache -config.guess -config.h -config.h.in -config.log -config.nice -config.status -config.sub -configure -configure.in -install-sh -libtool -ltmain.sh -missing -mkinstalldirs -run-tests.php -twig.loT -.libs/ -modules/ -twig.la -twig.lo diff --git a/vendor/twig/twig/ext/twig/config.m4 b/vendor/twig/twig/ext/twig/config.m4 deleted file mode 100644 index 83486be..0000000 --- a/vendor/twig/twig/ext/twig/config.m4 +++ /dev/null @@ -1,8 +0,0 @@ -dnl config.m4 for extension twig - -PHP_ARG_ENABLE(twig, whether to enable twig support, -[ --enable-twig Enable twig support]) - -if test "$PHP_TWIG" != "no"; then - PHP_NEW_EXTENSION(twig, twig.c, $ext_shared) -fi diff --git a/vendor/twig/twig/ext/twig/config.w32 b/vendor/twig/twig/ext/twig/config.w32 deleted file mode 100644 index cb287b9..0000000 --- a/vendor/twig/twig/ext/twig/config.w32 +++ /dev/null @@ -1,8 +0,0 @@ -// vim:ft=javascript - -ARG_ENABLE("twig", "Twig support", "no"); - -if (PHP_TWIG != "no") { - AC_DEFINE('HAVE_TWIG', 1); - EXTENSION('twig', 'twig.c'); -} diff --git a/vendor/twig/twig/ext/twig/php_twig.h b/vendor/twig/twig/ext/twig/php_twig.h deleted file mode 100644 index 359cd43..0000000 --- a/vendor/twig/twig/ext/twig/php_twig.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Twig Extension | - +----------------------------------------------------------------------+ - | Copyright (c) 2011 Derick Rethans | - +----------------------------------------------------------------------+ - | Redistribution and use in source and binary forms, with or without | - | modification, are permitted provided that the conditions mentioned | - | in the accompanying LICENSE file are met (BSD-3-Clause). | - +----------------------------------------------------------------------+ - | Author: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_TWIG_H -#define PHP_TWIG_H - -#define PHP_TWIG_VERSION "1.22.2" - -#include "php.h" - -extern zend_module_entry twig_module_entry; -#define phpext_twig_ptr &twig_module_entry -#ifndef PHP_WIN32 -zend_module_entry *get_module(void); -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_FUNCTION(twig_template_get_attributes); -PHP_RSHUTDOWN_FUNCTION(twig); - -#endif diff --git a/vendor/twig/twig/ext/twig/twig.c b/vendor/twig/twig/ext/twig/twig.c deleted file mode 100644 index 92d1add..0000000 --- a/vendor/twig/twig/ext/twig/twig.c +++ /dev/null @@ -1,1127 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Twig Extension | - +----------------------------------------------------------------------+ - | Copyright (c) 2011 Derick Rethans | - +----------------------------------------------------------------------+ - | Redistribution and use in source and binary forms, with or without | - | modification, are permitted provided that the conditions mentioned | - | in the accompanying LICENSE file are met (BSD-3-Clause). | - +----------------------------------------------------------------------+ - | Author: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_twig.h" -#include "ext/standard/php_var.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_smart_str.h" -#include "ext/spl/spl_exceptions.h" - -#include "Zend/zend_object_handlers.h" -#include "Zend/zend_interfaces.h" -#include "Zend/zend_exceptions.h" - -#ifndef Z_ADDREF_P -#define Z_ADDREF_P(pz) (pz)->refcount++ -#endif - -#define FREE_DTOR(z) \ - zval_dtor(z); \ - efree(z); - -#if PHP_VERSION_ID >= 50300 - #define APPLY_TSRMLS_DC TSRMLS_DC - #define APPLY_TSRMLS_CC TSRMLS_CC - #define APPLY_TSRMLS_FETCH() -#else - #define APPLY_TSRMLS_DC - #define APPLY_TSRMLS_CC - #define APPLY_TSRMLS_FETCH() TSRMLS_FETCH() -#endif - -ZEND_BEGIN_ARG_INFO_EX(twig_template_get_attribute_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 6) - ZEND_ARG_INFO(0, template) - ZEND_ARG_INFO(0, object) - ZEND_ARG_INFO(0, item) - ZEND_ARG_INFO(0, arguments) - ZEND_ARG_INFO(0, type) - ZEND_ARG_INFO(0, isDefinedTest) -ZEND_END_ARG_INFO() - -#ifndef PHP_FE_END -#define PHP_FE_END { NULL, NULL, NULL} -#endif - -static const zend_function_entry twig_functions[] = { - PHP_FE(twig_template_get_attributes, twig_template_get_attribute_args) - PHP_FE_END -}; - -PHP_RSHUTDOWN_FUNCTION(twig) -{ -#if ZEND_DEBUG - CG(unclean_shutdown) = 0; /* get rid of PHPUnit's exit() and report memleaks */ -#endif - return SUCCESS; -} - -zend_module_entry twig_module_entry = { - STANDARD_MODULE_HEADER, - "twig", - twig_functions, - NULL, - NULL, - NULL, - PHP_RSHUTDOWN(twig), - NULL, - PHP_TWIG_VERSION, - STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_TWIG -ZEND_GET_MODULE(twig) -#endif - -static int TWIG_ARRAY_KEY_EXISTS(zval *array, zval *key) -{ - if (Z_TYPE_P(array) != IS_ARRAY) { - return 0; - } - - switch (Z_TYPE_P(key)) { - case IS_NULL: - return zend_hash_exists(Z_ARRVAL_P(array), "", 1); - - case IS_BOOL: - case IS_DOUBLE: - convert_to_long(key); - case IS_LONG: - return zend_hash_index_exists(Z_ARRVAL_P(array), Z_LVAL_P(key)); - - default: - convert_to_string(key); - return zend_symtable_exists(Z_ARRVAL_P(array), Z_STRVAL_P(key), Z_STRLEN_P(key) + 1); - } -} - -static int TWIG_INSTANCE_OF(zval *object, zend_class_entry *interface TSRMLS_DC) -{ - if (Z_TYPE_P(object) != IS_OBJECT) { - return 0; - } - return instanceof_function(Z_OBJCE_P(object), interface TSRMLS_CC); -} - -static int TWIG_INSTANCE_OF_USERLAND(zval *object, char *interface TSRMLS_DC) -{ - zend_class_entry **pce; - if (Z_TYPE_P(object) != IS_OBJECT) { - return 0; - } - if (zend_lookup_class(interface, strlen(interface), &pce TSRMLS_CC) == FAILURE) { - return 0; - } - return instanceof_function(Z_OBJCE_P(object), *pce TSRMLS_CC); -} - -static zval *TWIG_GET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - - if (Z_TYPE_P(object) == IS_OBJECT) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); - - zval_ptr_dtor(&offset); - - if (!retval) { - if (!EG(exception)) { - zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name); - } - return NULL; - } - - return retval; - } - return NULL; -} - -static int TWIG_ISSET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - - if (Z_TYPE_P(object) == IS_OBJECT) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset); - - zval_ptr_dtor(&offset); - - if (!retval) { - if (!EG(exception)) { - zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name); - } - return 0; - } - - return (retval && Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval)); - } - return 0; -} - -static char *TWIG_STRTOLOWER(const char *str, int str_len) -{ - char *item_dup; - - item_dup = estrndup(str, str_len); - php_strtolower(item_dup, str_len); - return item_dup; -} - -static zval *TWIG_CALL_USER_FUNC_ARRAY(zval *object, char *function, zval *arguments TSRMLS_DC) -{ - zend_fcall_info fci; - zval ***args = NULL; - int arg_count = 0; - HashTable *table; - HashPosition pos; - int i = 0; - zval *retval_ptr; - zval *zfunction; - - if (arguments) { - table = HASH_OF(arguments); - args = safe_emalloc(sizeof(zval **), table->nNumOfElements, 0); - - zend_hash_internal_pointer_reset_ex(table, &pos); - - while (zend_hash_get_current_data_ex(table, (void **)&args[i], &pos) == SUCCESS) { - i++; - zend_hash_move_forward_ex(table, &pos); - } - arg_count = table->nNumOfElements; - } - - MAKE_STD_ZVAL(zfunction); - ZVAL_STRING(zfunction, function, 1); - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = zfunction; - fci.symbol_table = NULL; -#if PHP_VERSION_ID >= 50300 - fci.object_ptr = object; -#else - fci.object_pp = &object; -#endif - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = arg_count; - fci.params = args; - fci.no_separation = 0; - - if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { - ALLOC_INIT_ZVAL(retval_ptr); - ZVAL_BOOL(retval_ptr, 0); - } - - if (args) { - efree(fci.params); - } - FREE_DTOR(zfunction); - return retval_ptr; -} - -static int TWIG_CALL_BOOLEAN(zval *object, char *functionName TSRMLS_DC) -{ - zval *ret; - int res; - - ret = TWIG_CALL_USER_FUNC_ARRAY(object, functionName, NULL TSRMLS_CC); - res = Z_LVAL_P(ret); - zval_ptr_dtor(&ret); - return res; -} - -static zval *TWIG_GET_STATIC_PROPERTY(zval *class, char *prop_name TSRMLS_DC) -{ - zval **tmp_zval; - zend_class_entry *ce; - - if (class == NULL || Z_TYPE_P(class) != IS_OBJECT) { - return NULL; - } - - ce = zend_get_class_entry(class TSRMLS_CC); -#if PHP_VERSION_ID >= 50400 - tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0, NULL TSRMLS_CC); -#else - tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0 TSRMLS_CC); -#endif - return *tmp_zval; -} - -static zval *TWIG_GET_ARRAY_ELEMENT_ZVAL(zval *class, zval *prop_name TSRMLS_DC) -{ - zval **tmp_zval; - - if (class == NULL || Z_TYPE_P(class) != IS_ARRAY) { - if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) { - // array access object - return TWIG_GET_ARRAYOBJECT_ELEMENT(class, prop_name TSRMLS_CC); - } - return NULL; - } - - switch(Z_TYPE_P(prop_name)) { - case IS_NULL: - zend_hash_find(HASH_OF(class), "", 1, (void**) &tmp_zval); - return *tmp_zval; - - case IS_BOOL: - case IS_DOUBLE: - convert_to_long(prop_name); - case IS_LONG: - zend_hash_index_find(HASH_OF(class), Z_LVAL_P(prop_name), (void **) &tmp_zval); - return *tmp_zval; - - case IS_STRING: - zend_symtable_find(HASH_OF(class), Z_STRVAL_P(prop_name), Z_STRLEN_P(prop_name) + 1, (void**) &tmp_zval); - return *tmp_zval; - } - - return NULL; -} - -static zval *TWIG_GET_ARRAY_ELEMENT(zval *class, char *prop_name, int prop_name_length TSRMLS_DC) -{ - zval **tmp_zval; - - if (class == NULL/* || Z_TYPE_P(class) != IS_ARRAY*/) { - return NULL; - } - - if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) { - // array access object - zval *tmp_name_zval; - zval *tmp_ret_zval; - - ALLOC_INIT_ZVAL(tmp_name_zval); - ZVAL_STRING(tmp_name_zval, prop_name, 1); - tmp_ret_zval = TWIG_GET_ARRAYOBJECT_ELEMENT(class, tmp_name_zval TSRMLS_CC); - FREE_DTOR(tmp_name_zval); - return tmp_ret_zval; - } - - if (zend_symtable_find(HASH_OF(class), prop_name, prop_name_length+1, (void**)&tmp_zval) == SUCCESS) { - return *tmp_zval; - } - return NULL; -} - -static zval *TWIG_PROPERTY(zval *object, zval *propname TSRMLS_DC) -{ - zval *tmp = NULL; - - if (Z_OBJ_HT_P(object)->read_property) { -#if PHP_VERSION_ID >= 50400 - tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS, NULL TSRMLS_CC); -#else - tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS TSRMLS_CC); -#endif - if (tmp == EG(uninitialized_zval_ptr)) { - ZVAL_NULL(tmp); - } - } - return tmp; -} - -static int TWIG_HAS_PROPERTY(zval *object, zval *propname TSRMLS_DC) -{ - if (Z_OBJ_HT_P(object)->has_property) { -#if PHP_VERSION_ID >= 50400 - return Z_OBJ_HT_P(object)->has_property(object, propname, 0, NULL TSRMLS_CC); -#else - return Z_OBJ_HT_P(object)->has_property(object, propname, 0 TSRMLS_CC); -#endif - } - return 0; -} - -static int TWIG_HAS_DYNAMIC_PROPERTY(zval *object, char *prop, int prop_len TSRMLS_DC) -{ - if (Z_OBJ_HT_P(object)->get_properties) { - return zend_hash_quick_exists( - Z_OBJ_HT_P(object)->get_properties(object TSRMLS_CC), // the properties hash - prop, // property name - prop_len + 1, // property length - zend_get_hash_value(prop, prop_len + 1) // hash value - ); - } - return 0; -} - -static zval *TWIG_PROPERTY_CHAR(zval *object, char *propname TSRMLS_DC) -{ - zval *tmp_name_zval, *tmp; - - ALLOC_INIT_ZVAL(tmp_name_zval); - ZVAL_STRING(tmp_name_zval, propname, 1); - tmp = TWIG_PROPERTY(object, tmp_name_zval TSRMLS_CC); - FREE_DTOR(tmp_name_zval); - return tmp; -} - -static zval *TWIG_CALL_S(zval *object, char *method, char *arg0 TSRMLS_DC) -{ - zend_fcall_info fci; - zval **args[1]; - zval *argument; - zval *zfunction; - zval *retval_ptr; - - MAKE_STD_ZVAL(argument); - ZVAL_STRING(argument, arg0, 1); - args[0] = &argument; - - MAKE_STD_ZVAL(zfunction); - ZVAL_STRING(zfunction, method, 1); - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = zfunction; - fci.symbol_table = NULL; -#if PHP_VERSION_ID >= 50300 - fci.object_ptr = object; -#else - fci.object_pp = &object; -#endif - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 1; - fci.params = args; - fci.no_separation = 0; - - if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { - FREE_DTOR(zfunction); - zval_ptr_dtor(&argument); - return 0; - } - FREE_DTOR(zfunction); - zval_ptr_dtor(&argument); - return retval_ptr; -} - -static int TWIG_CALL_SB(zval *object, char *method, char *arg0 TSRMLS_DC) -{ - zval *retval_ptr; - int success; - - retval_ptr = TWIG_CALL_S(object, method, arg0 TSRMLS_CC); - success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr)); - - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - return success; -} - -static int TWIG_CALL_ZZ(zval *object, char *method, zval *arg1, zval *arg2 TSRMLS_DC) -{ - zend_fcall_info fci; - zval **args[2]; - zval *zfunction; - zval *retval_ptr; - int success; - - args[0] = &arg1; - args[1] = &arg2; - - MAKE_STD_ZVAL(zfunction); - ZVAL_STRING(zfunction, method, 1); - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = zfunction; - fci.symbol_table = NULL; -#if PHP_VERSION_ID >= 50300 - fci.object_ptr = object; -#else - fci.object_pp = &object; -#endif - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 2; - fci.params = args; - fci.no_separation = 0; - - if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { - FREE_DTOR(zfunction); - return 0; - } - - FREE_DTOR(zfunction); - - success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr)); - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - return success; -} - -#ifndef Z_SET_REFCOUNT_P -# define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc -# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0 -#endif - -static void TWIG_NEW(zval *object, char *class, zval *arg0, zval *arg1 TSRMLS_DC) -{ - zend_class_entry **pce; - - if (zend_lookup_class(class, strlen(class), &pce TSRMLS_CC) == FAILURE) { - return; - } - - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, *pce); - Z_SET_REFCOUNT_P(object, 1); - Z_UNSET_ISREF_P(object); - - TWIG_CALL_ZZ(object, "__construct", arg0, arg1 TSRMLS_CC); -} - -static int twig_add_array_key_to_string(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) -{ - smart_str *buf; - char *joiner; - APPLY_TSRMLS_FETCH(); - - buf = va_arg(args, smart_str*); - joiner = va_arg(args, char*); - - if (buf->len != 0) { - smart_str_appends(buf, joiner); - } - - if (hash_key->nKeyLength == 0) { - smart_str_append_long(buf, (long) hash_key->h); - } else { - char *key, *tmp_str; - int key_len, tmp_len; - key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC); - tmp_str = php_str_to_str_ex(key, key_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len, 0, NULL); - - smart_str_appendl(buf, tmp_str, tmp_len); - efree(key); - efree(tmp_str); - } - - return 0; -} - -static char *TWIG_IMPLODE_ARRAY_KEYS(char *joiner, zval *array TSRMLS_DC) -{ - smart_str collector = { 0, 0, 0 }; - - smart_str_appendl(&collector, "", 0); - zend_hash_apply_with_arguments(HASH_OF(array) APPLY_TSRMLS_CC, twig_add_array_key_to_string, 2, &collector, joiner); - smart_str_0(&collector); - - return collector.c; -} - -static void TWIG_RUNTIME_ERROR(zval *template TSRMLS_DC, char *message, ...) -{ - char *buffer; - va_list args; - zend_class_entry **pce; - zval *ex; - zval *constructor; - zval *zmessage; - zval *lineno; - zval *filename_func; - zval *filename; - zval *constructor_args[3]; - zval *constructor_retval; - - if (zend_lookup_class("Twig_Error_Runtime", strlen("Twig_Error_Runtime"), &pce TSRMLS_CC) == FAILURE) { - return; - } - - va_start(args, message); - vspprintf(&buffer, 0, message, args); - va_end(args); - - MAKE_STD_ZVAL(ex); - object_init_ex(ex, *pce); - - // Call Twig_Error constructor - MAKE_STD_ZVAL(constructor); - MAKE_STD_ZVAL(zmessage); - MAKE_STD_ZVAL(lineno); - MAKE_STD_ZVAL(filename); - MAKE_STD_ZVAL(filename_func); - MAKE_STD_ZVAL(constructor_retval); - - ZVAL_STRINGL(constructor, "__construct", sizeof("__construct")-1, 1); - ZVAL_STRING(zmessage, buffer, 1); - ZVAL_LONG(lineno, -1); - - // Get template filename - ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1); - call_user_function(EG(function_table), &template, filename_func, filename, 0, 0 TSRMLS_CC); - - constructor_args[0] = zmessage; - constructor_args[1] = lineno; - constructor_args[2] = filename; - call_user_function(EG(function_table), &ex, constructor, constructor_retval, 3, constructor_args TSRMLS_CC); - - zval_ptr_dtor(&constructor_retval); - zval_ptr_dtor(&zmessage); - zval_ptr_dtor(&lineno); - zval_ptr_dtor(&filename); - FREE_DTOR(constructor); - FREE_DTOR(filename_func); - efree(buffer); - - zend_throw_exception_object(ex TSRMLS_CC); -} - -static char *TWIG_GET_CLASS_NAME(zval *object TSRMLS_DC) -{ - char *class_name; - zend_uint class_name_len; - - if (Z_TYPE_P(object) != IS_OBJECT) { - return ""; - } -#if PHP_API_VERSION >= 20100412 - zend_get_object_classname(object, (const char **) &class_name, &class_name_len TSRMLS_CC); -#else - zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); -#endif - return class_name; -} - -static int twig_add_method_to_class(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) -{ - zend_class_entry *ce; - zval *retval; - char *item; - size_t item_len; - zend_function *mptr = (zend_function *) pDest; - APPLY_TSRMLS_FETCH(); - - if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC)) { - return 0; - } - - ce = *va_arg(args, zend_class_entry**); - retval = va_arg(args, zval*); - - item_len = strlen(mptr->common.function_name); - item = estrndup(mptr->common.function_name, item_len); - php_strtolower(item, item_len); - - if (strcmp("getenvironment", item) == 0) { - zend_class_entry **twig_template_ce; - if (zend_lookup_class("Twig_Template", strlen("Twig_Template"), &twig_template_ce TSRMLS_CC) == FAILURE) { - return 0; - } - if (instanceof_function(ce, *twig_template_ce TSRMLS_CC)) { - return 0; - } - } - - add_assoc_stringl_ex(retval, item, item_len+1, item, item_len, 0); - - return 0; -} - -static int twig_add_property_to_class(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) -{ - zend_class_entry *ce; - zval *retval; - char *class_name, *prop_name; - zend_property_info *pptr = (zend_property_info *) pDest; - APPLY_TSRMLS_FETCH(); - - if (!(pptr->flags & ZEND_ACC_PUBLIC) || (pptr->flags & ZEND_ACC_STATIC)) { - return 0; - } - - ce = *va_arg(args, zend_class_entry**); - retval = va_arg(args, zval*); - -#if PHP_API_VERSION >= 20100412 - zend_unmangle_property_name(pptr->name, pptr->name_length, (const char **) &class_name, (const char **) &prop_name); -#else - zend_unmangle_property_name(pptr->name, pptr->name_length, &class_name, &prop_name); -#endif - - add_assoc_string(retval, prop_name, prop_name, 1); - - return 0; -} - -static void twig_add_class_to_cache(zval *cache, zval *object, char *class_name TSRMLS_DC) -{ - zval *class_info, *class_methods, *class_properties; - zend_class_entry *class_ce; - - class_ce = zend_get_class_entry(object TSRMLS_CC); - - ALLOC_INIT_ZVAL(class_info); - ALLOC_INIT_ZVAL(class_methods); - ALLOC_INIT_ZVAL(class_properties); - array_init(class_info); - array_init(class_methods); - array_init(class_properties); - // add all methods to self::cache[$class]['methods'] - zend_hash_apply_with_arguments(&class_ce->function_table APPLY_TSRMLS_CC, twig_add_method_to_class, 2, &class_ce, class_methods); - zend_hash_apply_with_arguments(&class_ce->properties_info APPLY_TSRMLS_CC, twig_add_property_to_class, 2, &class_ce, class_properties); - - add_assoc_zval(class_info, "methods", class_methods); - add_assoc_zval(class_info, "properties", class_properties); - add_assoc_zval(cache, class_name, class_info); -} - -/* {{{ proto mixed twig_template_get_attributes(TwigTemplate template, mixed object, mixed item, array arguments, string type, boolean isDefinedTest, boolean ignoreStrictCheck) - A C implementation of TwigTemplate::getAttribute() */ -PHP_FUNCTION(twig_template_get_attributes) -{ - zval *template; - zval *object; - char *item; - int item_len; - zval *zitem, ztmpitem; - zval *arguments = NULL; - zval *ret = NULL; - char *type = NULL; - int type_len = 0; - zend_bool isDefinedTest = 0; - zend_bool ignoreStrictCheck = 0; - int free_ret = 0; - zval *tmp_self_cache; - char *class_name = NULL; - zval *tmp_class; - char *type_name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ozz|asbb", &template, &object, &zitem, &arguments, &type, &type_len, &isDefinedTest, &ignoreStrictCheck) == FAILURE) { - return; - } - - // convert the item to a string - ztmpitem = *zitem; - zval_copy_ctor(&ztmpitem); - convert_to_string(&ztmpitem); - item_len = Z_STRLEN(ztmpitem); - item = estrndup(Z_STRVAL(ztmpitem), item_len); - zval_dtor(&ztmpitem); - - if (!type) { - type = "any"; - } - -/* - // array - if (Twig_Template::METHOD_CALL !== $type) { - $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item; - - if ((is_array($object) && array_key_exists($arrayItem, $object)) - || ($object instanceof ArrayAccess && isset($object[$arrayItem])) - ) { - if ($isDefinedTest) { - return true; - } - - return $object[$arrayItem]; - } -*/ - - - if (strcmp("method", type) != 0) { - if ((TWIG_ARRAY_KEY_EXISTS(object, zitem)) - || (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess TSRMLS_CC) && TWIG_ISSET_ARRAYOBJECT_ELEMENT(object, zitem TSRMLS_CC)) - ) { - - if (isDefinedTest) { - efree(item); - RETURN_TRUE; - } - - ret = TWIG_GET_ARRAY_ELEMENT_ZVAL(object, zitem TSRMLS_CC); - - if (!ret) { - ret = &EG(uninitialized_zval); - } - RETVAL_ZVAL(ret, 1, 0); - if (free_ret) { - zval_ptr_dtor(&ret); - } - efree(item); - return; - } -/* - if (Twig_Template::ARRAY_CALL === $type) { - if ($isDefinedTest) { - return false; - } - if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; - } -*/ - if (strcmp("array", type) == 0 || Z_TYPE_P(object) != IS_OBJECT) { - if (isDefinedTest) { - efree(item); - RETURN_FALSE; - } - if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { - efree(item); - return; - } -/* - if ($object instanceof ArrayAccess) { - $message = sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist', $arrayItem, get_class($object)); - } elseif (is_object($object)) { - $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface', $item, get_class($object)); - } elseif (is_array($object)) { - if (empty($object)) { - $message = sprintf('Key "%s" does not exist as the array is empty', $arrayItem); - } else { - $message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))); - } - } elseif (Twig_Template::ARRAY_CALL === $type) { - if (null === $object) { - $message = sprintf('Impossible to access a key ("%s") on a null variable', $item); - } else { - $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object); - } - } elseif (null === $object) { - $message = sprintf('Impossible to access an attribute ("%s") on a null variable', $item); - } else { - $message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s")', $item, gettype($object), $object); - } - throw new Twig_Error_Runtime($message, -1, $this->getTemplateName()); - } - } -*/ - if (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess TSRMLS_CC)) { - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" in object with ArrayAccess of class \"%s\" does not exist", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); - } else if (Z_TYPE_P(object) == IS_OBJECT) { - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to access a key \"%s\" on an object of class \"%s\" that does not implement ArrayAccess interface", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); - } else if (Z_TYPE_P(object) == IS_ARRAY) { - if (0 == zend_hash_num_elements(Z_ARRVAL_P(object))) { - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" does not exist as the array is empty", item); - } else { - char *array_keys = TWIG_IMPLODE_ARRAY_KEYS(", ", object TSRMLS_CC); - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" for array with keys \"%s\" does not exist", item, array_keys); - efree(array_keys); - } - } else { - char *type_name = zend_zval_type_name(object); - Z_ADDREF_P(object); - if (Z_TYPE_P(object) == IS_NULL) { - convert_to_string(object); - TWIG_RUNTIME_ERROR(template TSRMLS_CC, - (strcmp("array", type) == 0) - ? "Impossible to access a key (\"%s\") on a %s variable" - : "Impossible to access an attribute (\"%s\") on a %s variable", - item, type_name); - } else { - convert_to_string(object); - TWIG_RUNTIME_ERROR(template TSRMLS_CC, - (strcmp("array", type) == 0) - ? "Impossible to access a key (\"%s\") on a %s variable (\"%s\")" - : "Impossible to access an attribute (\"%s\") on a %s variable (\"%s\")", - item, type_name, Z_STRVAL_P(object)); - } - zval_ptr_dtor(&object); - } - efree(item); - return; - } - } - -/* - if (!is_object($object)) { - if ($isDefinedTest) { - return false; - } -*/ - - if (Z_TYPE_P(object) != IS_OBJECT) { - if (isDefinedTest) { - efree(item); - RETURN_FALSE; - } -/* - if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; - } - - if (null === $object) { - $message = sprintf('Impossible to invoke a method ("%s") on a null variable', $item); - } else { - $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object); - } - - throw new Twig_Error_Runtime($message, -1, $this->getTemplateName()); - } -*/ - if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { - efree(item); - return; - } - - type_name = zend_zval_type_name(object); - Z_ADDREF_P(object); - if (Z_TYPE_P(object) == IS_NULL) { - convert_to_string_ex(&object); - - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a %s variable", item, type_name); - } else { - convert_to_string_ex(&object); - - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a %s variable (\"%s\")", item, type_name, Z_STRVAL_P(object)); - } - - zval_ptr_dtor(&object); - efree(item); - return; - } -/* - $class = get_class($object); -*/ - - class_name = TWIG_GET_CLASS_NAME(object TSRMLS_CC); - tmp_self_cache = TWIG_GET_STATIC_PROPERTY(template, "cache" TSRMLS_CC); - tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC); - - if (!tmp_class) { - twig_add_class_to_cache(tmp_self_cache, object, class_name TSRMLS_CC); - tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC); - } - efree(class_name); - -/* - // object property - if (Twig_Template::METHOD_CALL !== $type && !$object instanceof Twig_Template) { - if (isset($object->$item) || array_key_exists((string) $item, $object)) { - if ($isDefinedTest) { - return true; - } - - if ($this->env->hasExtension('sandbox')) { - $this->env->getExtension('sandbox')->checkPropertyAllowed($object, $item); - } - - return $object->$item; - } - } -*/ - if (strcmp("method", type) != 0 && !TWIG_INSTANCE_OF_USERLAND(object, "Twig_Template" TSRMLS_CC)) { - zval *tmp_properties, *tmp_item; - - tmp_properties = TWIG_GET_ARRAY_ELEMENT(tmp_class, "properties", strlen("properties") TSRMLS_CC); - tmp_item = TWIG_GET_ARRAY_ELEMENT(tmp_properties, item, item_len TSRMLS_CC); - - if (tmp_item || TWIG_HAS_PROPERTY(object, zitem TSRMLS_CC) || TWIG_HAS_DYNAMIC_PROPERTY(object, item, item_len TSRMLS_CC)) { - if (isDefinedTest) { - efree(item); - RETURN_TRUE; - } - if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "sandbox" TSRMLS_CC)) { - TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "sandbox" TSRMLS_CC), "checkPropertyAllowed", object, zitem TSRMLS_CC); - } - if (EG(exception)) { - efree(item); - return; - } - - ret = TWIG_PROPERTY(object, zitem TSRMLS_CC); - efree(item); - RETURN_ZVAL(ret, 1, 0); - } - } -/* - // object method - if (!isset(self::$cache[$class]['methods'])) { - if ($object instanceof self) { - $ref = new ReflectionClass($class); - $methods = array(); - - foreach ($ref->getMethods(ReflectionMethod::IS_PUBLIC) as $refMethod) { - $methodName = strtolower($refMethod->name); - - // Accessing the environment from templates is forbidden to prevent untrusted changes to the environment - if ('getenvironment' !== $methodName) { - $methods[$methodName] = true; - } - } - - self::$cache[$class]['methods'] = $methods; - } else { - self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object))); - } - } - - $call = false; - $lcItem = strtolower($item); - if (isset(self::$cache[$class]['methods'][$lcItem])) { - $method = (string) $item; - } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) { - $method = 'get'.$item; - } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) { - $method = 'is'.$item; - } elseif (isset(self::$cache[$class]['methods']['__call'])) { - $method = (string) $item; - $call = true; -*/ - { - int call = 0; - char *lcItem = TWIG_STRTOLOWER(item, item_len); - int lcItem_length; - char *method = NULL; - char *tmp_method_name_get; - char *tmp_method_name_is; - zval *zmethod; - zval *tmp_methods; - - lcItem_length = strlen(lcItem); - tmp_method_name_get = emalloc(4 + lcItem_length); - tmp_method_name_is = emalloc(3 + lcItem_length); - - sprintf(tmp_method_name_get, "get%s", lcItem); - sprintf(tmp_method_name_is, "is%s", lcItem); - - tmp_methods = TWIG_GET_ARRAY_ELEMENT(tmp_class, "methods", strlen("methods") TSRMLS_CC); - - if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, lcItem, lcItem_length TSRMLS_CC)) { - method = item; - } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_get, lcItem_length + 3 TSRMLS_CC)) { - method = tmp_method_name_get; - } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_is, lcItem_length + 2 TSRMLS_CC)) { - method = tmp_method_name_is; - } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, "__call", 6 TSRMLS_CC)) { - method = item; - call = 1; -/* - } else { - if ($isDefinedTest) { - return false; - } - - if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; - } - - throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName()); - } - - if ($isDefinedTest) { - return true; - } -*/ - } else { - efree(tmp_method_name_get); - efree(tmp_method_name_is); - efree(lcItem); - - if (isDefinedTest) { - efree(item); - RETURN_FALSE; - } - if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { - efree(item); - return; - } - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Method \"%s\" for object \"%s\" does not exist", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); - efree(item); - return; - } - - if (isDefinedTest) { - efree(tmp_method_name_get); - efree(tmp_method_name_is); - efree(lcItem);efree(item); - RETURN_TRUE; - } -/* - if ($this->env->hasExtension('sandbox')) { - $this->env->getExtension('sandbox')->checkMethodAllowed($object, $method); - } -*/ - MAKE_STD_ZVAL(zmethod); - ZVAL_STRING(zmethod, method, 1); - if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "sandbox" TSRMLS_CC)) { - TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "sandbox" TSRMLS_CC), "checkMethodAllowed", object, zmethod TSRMLS_CC); - } - zval_ptr_dtor(&zmethod); - if (EG(exception)) { - efree(tmp_method_name_get); - efree(tmp_method_name_is); - efree(lcItem);efree(item); - return; - } -/* - // Some objects throw exceptions when they have __call, and the method we try - // to call is not supported. If ignoreStrictCheck is true, we should return null. - try { - $ret = call_user_func_array(array($object, $method), $arguments); - } catch (BadMethodCallException $e) { - if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { - return null; - } - throw $e; - } -*/ - ret = TWIG_CALL_USER_FUNC_ARRAY(object, method, arguments TSRMLS_CC); - if (EG(exception) && TWIG_INSTANCE_OF(EG(exception), spl_ce_BadMethodCallException TSRMLS_CC)) { - if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { - efree(tmp_method_name_get); - efree(tmp_method_name_is); - efree(lcItem);efree(item); - zend_clear_exception(TSRMLS_C); - return; - } - } - free_ret = 1; - efree(tmp_method_name_get); - efree(tmp_method_name_is); - efree(lcItem); - } -/* - // useful when calling a template method from a template - // this is not supported but unfortunately heavily used in the Symfony profiler - if ($object instanceof Twig_TemplateInterface) { - return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset()); - } - - return $ret; -*/ - efree(item); - // ret can be null, if e.g. the called method throws an exception - if (ret) { - if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) { - if (Z_STRLEN_P(ret) != 0) { - zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset", NULL TSRMLS_CC); - TWIG_NEW(return_value, "Twig_Markup", ret, charset TSRMLS_CC); - zval_ptr_dtor(&charset); - if (ret) { - zval_ptr_dtor(&ret); - } - return; - } - } - - RETVAL_ZVAL(ret, 1, 0); - if (free_ret) { - zval_ptr_dtor(&ret); - } - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php b/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php deleted file mode 100644 index 52107c0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php +++ /dev/null @@ -1,24 +0,0 @@ -assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with Twig'); - - $autoloader = new Twig_Autoloader(); - $this->assertNull($autoloader->autoload('Foo'), '->autoload() returns false if it is not able to load a class'); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/CompilerTest.php b/vendor/twig/twig/test/Twig/Tests/CompilerTest.php deleted file mode 100644 index bc25f11..0000000 --- a/vendor/twig/twig/test/Twig/Tests/CompilerTest.php +++ /dev/null @@ -1,33 +0,0 @@ -getMock('Twig_LoaderInterface'))); - - $locale = setlocale(LC_NUMERIC, 0); - if (false === $locale) { - $this->markTestSkipped('Your platform does not support locales.'); - } - - $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); - if (false === setlocale(LC_NUMERIC, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); - } - - $this->assertEquals('1.2', $compiler->repr(1.2)->getSource()); - $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); - - setlocale(LC_NUMERIC, $locale); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php b/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php deleted file mode 100644 index 83a98ef..0000000 --- a/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php +++ /dev/null @@ -1,303 +0,0 @@ -render('test'); - } - - public function testAutoescapeOption() - { - $loader = new Twig_Loader_Array(array( - 'html' => '{{ foo }} {{ foo }}', - 'js' => '{{ bar }} {{ bar }}', - )); - - $twig = new Twig_Environment($loader, array( - 'debug' => true, - 'cache' => false, - 'autoescape' => array($this, 'escapingStrategyCallback'), - )); - - $this->assertEquals('foo<br/ > foo<br/ >', $twig->render('html', array('foo' => 'foo
    '))); - $this->assertEquals('foo\x3Cbr\x2F\x20\x3E foo\x3Cbr\x2F\x20\x3E', $twig->render('js', array('bar' => 'foo
    '))); - } - - public function escapingStrategyCallback($filename) - { - return $filename; - } - - public function testGlobals() - { - // globals can be added after calling getGlobals - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after runtime init - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->initRuntime(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions init - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions and runtime init - $twig = new Twig_Environment($loader = new Twig_Loader_Array(array('index' => '{{foo}}'))); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->initRuntime(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - $twig = new Twig_Environment($loader); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $template = $twig->loadTemplate('index'); - $this->assertEquals('bar', $template->render(array())); - - /* to be uncomment in Twig 2.0 - // globals cannot be added after runtime init - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->initRuntime(); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // globals cannot be added after extensions init - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // globals cannot be added after extensions and runtime init - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->initRuntime(); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // test adding globals after initRuntime without call to getGlobals - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->initRuntime(); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - */ - } - - public function testCompileSourceInlinesSource() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - - $source = "\r\nbar\n"; - $expected = "/* */\n/* bar*/\n/* */\n"; - $compiled = $twig->compileSource($source, 'index'); - - $this->assertContains($expected, $compiled); - $this->assertNotContains('/**', $compiled); - } - - public function testExtensionsAreNotInitializedWhenRenderingACompiledTemplate() - { - $cache = new Twig_Cache_Filesystem($dir = sys_get_temp_dir().'/twig'); - $options = array('cache' => $cache, 'auto_reload' => false, 'debug' => false); - - // force compilation - $twig = new Twig_Environment($loader = new Twig_Loader_Array(array('index' => '{{ foo }}')), $options); - - $key = $cache->generateKey('index', $twig->getTemplateClass('index')); - $cache->write($key, $twig->compileSource('{{ foo }}', 'index')); - - // check that extensions won't be initialized when rendering a template that is already in the cache - $twig = $this - ->getMockBuilder('Twig_Environment') - ->setConstructorArgs(array($loader, $options)) - ->setMethods(array('initExtensions')) - ->getMock() - ; - - $twig->expects($this->never())->method('initExtensions'); - - // render template - $output = $twig->render('index', array('foo' => 'bar')); - $this->assertEquals('bar', $output); - - unlink($key); - } - - public function testAddExtension() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); - - $this->assertArrayHasKey('test', $twig->getTags()); - $this->assertArrayHasKey('foo_filter', $twig->getFilters()); - $this->assertArrayHasKey('foo_function', $twig->getFunctions()); - $this->assertArrayHasKey('foo_test', $twig->getTests()); - $this->assertArrayHasKey('foo_unary', $twig->getUnaryOperators()); - $this->assertArrayHasKey('foo_binary', $twig->getBinaryOperators()); - $this->assertArrayHasKey('foo_global', $twig->getGlobals()); - $visitors = $twig->getNodeVisitors(); - $this->assertEquals('Twig_Tests_EnvironmentTest_NodeVisitor', get_class($visitors[2])); - } - - /** - * @group legacy - */ - public function testRemoveExtension() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); - $twig->removeExtension('environment_test'); - - $this->assertFalse(array_key_exists('test', $twig->getTags())); - $this->assertFalse(array_key_exists('foo_filter', $twig->getFilters())); - $this->assertFalse(array_key_exists('foo_function', $twig->getFunctions())); - $this->assertFalse(array_key_exists('foo_test', $twig->getTests())); - $this->assertFalse(array_key_exists('foo_unary', $twig->getUnaryOperators())); - $this->assertFalse(array_key_exists('foo_binary', $twig->getBinaryOperators())); - $this->assertFalse(array_key_exists('foo_global', $twig->getGlobals())); - $this->assertCount(2, $twig->getNodeVisitors()); - } -} - -class Twig_Tests_EnvironmentTest_Extension extends Twig_Extension -{ - public function getTokenParsers() - { - return array( - new Twig_Tests_EnvironmentTest_TokenParser(), - ); - } - - public function getNodeVisitors() - { - return array( - new Twig_Tests_EnvironmentTest_NodeVisitor(), - ); - } - - public function getFilters() - { - return array( - new Twig_SimpleFilter('foo_filter', 'foo_filter'), - ); - } - - public function getTests() - { - return array( - new Twig_SimpleTest('foo_test', 'foo_test'), - ); - } - - public function getFunctions() - { - return array( - new Twig_SimpleFunction('foo_function', 'foo_function'), - ); - } - - public function getOperators() - { - return array( - array('foo_unary' => array()), - array('foo_binary' => array()), - ); - } - - public function getGlobals() - { - return array( - 'foo_global' => 'foo_global', - ); - } - - public function getName() - { - return 'environment_test'; - } -} - -class Twig_Tests_EnvironmentTest_TokenParser extends Twig_TokenParser -{ - public function parse(Twig_Token $token) - { - } - - public function getTag() - { - return 'test'; - } -} - -class Twig_Tests_EnvironmentTest_NodeVisitor implements Twig_NodeVisitorInterface -{ - public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) - { - return $node; - } - - public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php b/vendor/twig/twig/test/Twig/Tests/ErrorTest.php deleted file mode 100644 index d58c40b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php +++ /dev/null @@ -1,144 +0,0 @@ -setTemplateFile(new SplFileInfo(__FILE__)); - - $this->assertContains('test'.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR.'ErrorTest.php', $error->getMessage()); - } - - public function testErrorWithArrayFilename() - { - $error = new Twig_Error('foo'); - $error->setTemplateFile(array('foo' => 'bar')); - - $this->assertEquals('foo in {"foo":"bar"}', $error->getMessage()); - } - - public function testTwigExceptionAddsFileAndLineWhenMissingWithInheritanceOnDisk() - { - $loader = new Twig_Loader_Filesystem(dirname(__FILE__).'/Fixtures/errors'); - $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); - - $template = $twig->loadTemplate('index.html'); - try { - $template->render(array()); - - $this->fail(); - } catch (Twig_Error_Runtime $e) { - $this->assertEquals('Variable "foo" does not exist in "index.html" at line 3', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getTemplateFile()); - } - - try { - $template->render(array('foo' => new Twig_Tests_ErrorTest_Foo())); - - $this->fail(); - } catch (Twig_Error_Runtime $e) { - $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index.html" at line 3.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getTemplateFile()); - } - } - - /** - * @dataProvider getErroredTemplates - */ - public function testTwigExceptionAddsFileAndLine($templates, $name, $line) - { - $loader = new Twig_Loader_Array($templates); - $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); - - $template = $twig->loadTemplate('index'); - - try { - $template->render(array()); - - $this->fail(); - } catch (Twig_Error_Runtime $e) { - $this->assertEquals(sprintf('Variable "foo" does not exist in "%s" at line %d', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getTemplateFile()); - } - - try { - $template->render(array('foo' => new Twig_Tests_ErrorTest_Foo())); - - $this->fail(); - } catch (Twig_Error_Runtime $e) { - $this->assertEquals(sprintf('An exception has been thrown during the rendering of a template ("Runtime error...") in "%s" at line %d.', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getTemplateFile()); - } - } - - public function getErroredTemplates() - { - return array( - // error occurs in a template - array( - array( - 'index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}", - ), - 'index', 3, - ), - - // error occurs in an included template - array( - array( - 'index' => "{% include 'partial' %}", - 'partial' => '{{ foo.bar }}', - ), - 'partial', 1, - ), - - // error occurs in a parent block when called via parent() - array( - array( - 'index' => "{% extends 'base' %} - {% block content %} - {{ parent() }} - {% endblock %}", - 'base' => '{% block content %}{{ foo.bar }}{% endblock %}', - ), - 'base', 1, - ), - - // error occurs in a block from the child - array( - array( - 'index' => "{% extends 'base' %} - {% block content %} - {{ foo.bar }} - {% endblock %} - {% block foo %} - {{ foo.bar }} - {% endblock %}", - 'base' => '{% block content %}{% endblock %}', - ), - 'index', 3, - ), - ); - } -} - -class Twig_Tests_ErrorTest_Foo -{ - public function bar() - { - throw new Exception('Runtime error...'); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php b/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php deleted file mode 100644 index ff263cf..0000000 --- a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php +++ /dev/null @@ -1,332 +0,0 @@ -getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize($template, 'index')); - } - - public function getFailingTestsForAssignment() - { - return array( - array('{% set false = "foo" %}'), - array('{% set true = "foo" %}'), - array('{% set none = "foo" %}'), - array('{% set 3 = "foo" %}'), - array('{% set 1 + 2 = "foo" %}'), - array('{% set "bar" = "foo" %}'), - array('{% set %}{% endset %}'), - ); - } - - /** - * @dataProvider getTestsForArray - */ - public function testArrayExpression($template, $expected) - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $stream = $env->tokenize($template, 'index'); - $parser = new Twig_Parser($env); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - /** - * @expectedException Twig_Error_Syntax - * @dataProvider getFailingTestsForArray - */ - public function testArraySyntaxError($template) - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize($template, 'index')); - } - - public function getFailingTestsForArray() - { - return array( - array('{{ [1, "a": "b"] }}'), - array('{{ {"a": "b", 2} }}'), - ); - } - - public function getTestsForArray() - { - return array( - // simple array - array('{{ [1, 2] }}', new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant(0, 1), - new Twig_Node_Expression_Constant(1, 1), - - new Twig_Node_Expression_Constant(1, 1), - new Twig_Node_Expression_Constant(2, 1), - ), 1), - ), - - // array with trailing , - array('{{ [1, 2, ] }}', new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant(0, 1), - new Twig_Node_Expression_Constant(1, 1), - - new Twig_Node_Expression_Constant(1, 1), - new Twig_Node_Expression_Constant(2, 1), - ), 1), - ), - - // simple hash - array('{{ {"a": "b", "b": "c"} }}', new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant('a', 1), - new Twig_Node_Expression_Constant('b', 1), - - new Twig_Node_Expression_Constant('b', 1), - new Twig_Node_Expression_Constant('c', 1), - ), 1), - ), - - // hash with trailing , - array('{{ {"a": "b", "b": "c", } }}', new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant('a', 1), - new Twig_Node_Expression_Constant('b', 1), - - new Twig_Node_Expression_Constant('b', 1), - new Twig_Node_Expression_Constant('c', 1), - ), 1), - ), - - // hash in an array - array('{{ [1, {"a": "b", "b": "c"}] }}', new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant(0, 1), - new Twig_Node_Expression_Constant(1, 1), - - new Twig_Node_Expression_Constant(1, 1), - new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant('a', 1), - new Twig_Node_Expression_Constant('b', 1), - - new Twig_Node_Expression_Constant('b', 1), - new Twig_Node_Expression_Constant('c', 1), - ), 1), - ), 1), - ), - - // array in a hash - array('{{ {"a": [1, 2], "b": "c"} }}', new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant('a', 1), - new Twig_Node_Expression_Array(array( - new Twig_Node_Expression_Constant(0, 1), - new Twig_Node_Expression_Constant(1, 1), - - new Twig_Node_Expression_Constant(1, 1), - new Twig_Node_Expression_Constant(2, 1), - ), 1), - new Twig_Node_Expression_Constant('b', 1), - new Twig_Node_Expression_Constant('c', 1), - ), 1), - ), - ); - } - - /** - * @expectedException Twig_Error_Syntax - */ - public function testStringExpressionDoesNotConcatenateTwoConsecutiveStrings() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); - $stream = $env->tokenize('{{ "a" "b" }}', 'index'); - $parser = new Twig_Parser($env); - - $parser->parse($stream); - } - - /** - * @dataProvider getTestsForString - */ - public function testStringExpression($template, $expected) - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); - $stream = $env->tokenize($template, 'index'); - $parser = new Twig_Parser($env); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - public function getTestsForString() - { - return array( - array( - '{{ "foo" }}', new Twig_Node_Expression_Constant('foo', 1), - ), - array( - '{{ "foo #{bar}" }}', new Twig_Node_Expression_Binary_Concat( - new Twig_Node_Expression_Constant('foo ', 1), - new Twig_Node_Expression_Name('bar', 1), - 1 - ), - ), - array( - '{{ "foo #{bar} baz" }}', new Twig_Node_Expression_Binary_Concat( - new Twig_Node_Expression_Binary_Concat( - new Twig_Node_Expression_Constant('foo ', 1), - new Twig_Node_Expression_Name('bar', 1), - 1 - ), - new Twig_Node_Expression_Constant(' baz', 1), - 1 - ), - ), - - array( - '{{ "foo #{"foo #{bar} baz"} baz" }}', new Twig_Node_Expression_Binary_Concat( - new Twig_Node_Expression_Binary_Concat( - new Twig_Node_Expression_Constant('foo ', 1), - new Twig_Node_Expression_Binary_Concat( - new Twig_Node_Expression_Binary_Concat( - new Twig_Node_Expression_Constant('foo ', 1), - new Twig_Node_Expression_Name('bar', 1), - 1 - ), - new Twig_Node_Expression_Constant(' baz', 1), - 1 - ), - 1 - ), - new Twig_Node_Expression_Constant(' baz', 1), - 1 - ), - ), - ); - } - - /** - * @expectedException Twig_Error_Syntax - */ - public function testAttributeCallDoesNotSupportNamedArguments() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize('{{ foo.bar(name="Foo") }}', 'index')); - } - - /** - * @expectedException Twig_Error_Syntax - */ - public function testMacroCallDoesNotSupportNamedArguments() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize('{% from _self import foo %}{% macro foo() %}{% endmacro %}{{ foo(name="Foo") }}', 'index')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1 - */ - public function testMacroDefinitionDoesNotSupportNonNameVariableName() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize('{% macro foo("a") %}{% endmacro %}', 'index')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage A default value for an argument must be a constant (a boolean, a string, a number, or an array) in "index" at line 1 - * @dataProvider getMacroDefinitionDoesNotSupportNonConstantDefaultValues - */ - public function testMacroDefinitionDoesNotSupportNonConstantDefaultValues($template) - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize($template, 'index')); - } - - public function getMacroDefinitionDoesNotSupportNonConstantDefaultValues() - { - return array( - array('{% macro foo(name = "a #{foo} a") %}{% endmacro %}'), - array('{% macro foo(name = [["b", "a #{foo} a"]]) %}{% endmacro %}'), - ); - } - - /** - * @dataProvider getMacroDefinitionSupportsConstantDefaultValues - */ - public function testMacroDefinitionSupportsConstantDefaultValues($template) - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize($template, 'index')); - } - - public function getMacroDefinitionSupportsConstantDefaultValues() - { - return array( - array('{% macro foo(name = "aa") %}{% endmacro %}'), - array('{% macro foo(name = 12) %}{% endmacro %}'), - array('{% macro foo(name = true) %}{% endmacro %}'), - array('{% macro foo(name = ["a"]) %}{% endmacro %}'), - array('{% macro foo(name = [["a"]]) %}{% endmacro %}'), - array('{% macro foo(name = {a: "a"}) %}{% endmacro %}'), - array('{% macro foo(name = {a: {b: "a"}}) %}{% endmacro %}'), - ); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage The function "cycl" does not exist. Did you mean "cycle" in "index" at line 1 - */ - public function testUnknownFunction() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize('{{ cycl() }}', 'index')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage The filter "lowe" does not exist. Did you mean "lower" in "index" at line 1 - */ - public function testUnknownFilter() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize('{{ 1|lowe }}', 'index')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage The test "nul" does not exist. Did you mean "null" in "index" at line 1 - */ - public function testUnknownTest() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $parser = new Twig_Parser($env); - - $parser->parse($env->tokenize('{{ 1 is nul }}', 'index')); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php b/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php deleted file mode 100644 index a4692c2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php +++ /dev/null @@ -1,156 +0,0 @@ -getMock('Twig_LoaderInterface')); - - for ($i = 0; $i < 100; ++$i) { - $this->assertTrue(in_array(twig_random($env, $value), $expectedInArray, true)); // assertContains() would not consider the type - } - } - - public function getRandomFunctionTestData() - { - return array( - array(// array - array('apple', 'orange', 'citrus'), - array('apple', 'orange', 'citrus'), - ), - array(// Traversable - new ArrayObject(array('apple', 'orange', 'citrus')), - array('apple', 'orange', 'citrus'), - ), - array(// unicode string - 'Ä€é', - array('Ä', '€', 'é'), - ), - array(// numeric but string - '123', - array('1', '2', '3'), - ), - array(// integer - 5, - range(0, 5, 1), - ), - array(// float - 5.9, - range(0, 5, 1), - ), - array(// negative - -2, - array(0, -1, -2), - ), - ); - } - - public function testRandomFunctionWithoutParameter() - { - $max = mt_getrandmax(); - - for ($i = 0; $i < 100; ++$i) { - $val = twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $this->assertTrue(is_int($val) && $val >= 0 && $val <= $max); - } - } - - public function testRandomFunctionReturnsAsIs() - { - $this->assertSame('', twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface')), '')); - $this->assertSame('', twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('charset' => null)), '')); - - $instance = new stdClass(); - $this->assertSame($instance, twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $instance)); - } - - /** - * @expectedException Twig_Error_Runtime - */ - public function testRandomFunctionOfEmptyArrayThrowsException() - { - twig_random(new Twig_Environment($this->getMock('Twig_LoaderInterface')), array()); - } - - public function testRandomFunctionOnNonUTF8String() - { - if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { - $this->markTestSkipped('needs iconv or mbstring'); - } - - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->setCharset('ISO-8859-1'); - - $text = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); - for ($i = 0; $i < 30; ++$i) { - $rand = twig_random($twig, $text); - $this->assertTrue(in_array(twig_convert_encoding($rand, 'UTF-8', 'ISO-8859-1'), array('Ä', 'é'), true)); - } - } - - public function testReverseFilterOnNonUTF8String() - { - if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { - $this->markTestSkipped('needs iconv or mbstring'); - } - - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->setCharset('ISO-8859-1'); - - $input = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); - $output = twig_convert_encoding(twig_reverse_filter($twig, $input), 'UTF-8', 'ISO-8859-1'); - - $this->assertEquals($output, 'éÄ'); - } - - public function testCustomEscaper() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $twig->getExtension('core')->setEscaper('foo', 'foo_escaper_for_test'); - - $this->assertEquals('fooUTF-8', twig_escape_filter($twig, 'foo', 'foo')); - } - - /** - * @expectedException Twig_Error_Runtime - */ - public function testUnknownCustomEscaper() - { - twig_escape_filter(new Twig_Environment($this->getMock('Twig_LoaderInterface')), 'foo', 'bar'); - } - - public function testTwigFirst() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $this->assertEquals('a', twig_first($twig, 'abc')); - $this->assertEquals(1, twig_first($twig, array(1, 2, 3))); - $this->assertSame('', twig_first($twig, null)); - $this->assertSame('', twig_first($twig, '')); - } - - public function testTwigLast() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $this->assertEquals('c', twig_last($twig, 'abc')); - $this->assertEquals(3, twig_last($twig, array(1, 2, 3))); - $this->assertSame('', twig_last($twig, null)); - $this->assertSame('', twig_last($twig, '')); - } -} - -function foo_escaper_for_test(Twig_Environment $env, $string, $charset) -{ - return $string.$charset; -} diff --git a/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php b/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php deleted file mode 100644 index d21fb23..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php +++ /dev/null @@ -1,220 +0,0 @@ - 'Fabien', - 'obj' => new FooObject(), - 'arr' => array('obj' => new FooObject()), - ); - - self::$templates = array( - '1_basic1' => '{{ obj.foo }}', - '1_basic2' => '{{ name|upper }}', - '1_basic3' => '{% if name %}foo{% endif %}', - '1_basic4' => '{{ obj.bar }}', - '1_basic5' => '{{ obj }}', - '1_basic6' => '{{ arr.obj }}', - '1_basic7' => '{{ cycle(["foo","bar"], 1) }}', - '1_basic8' => '{{ obj.getfoobar }}{{ obj.getFooBar }}', - '1_basic9' => '{{ obj.foobar }}{{ obj.fooBar }}', - '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - '1_layout' => '{% block content %}{% endblock %}', - '1_child' => "{% extends \"1_layout\" %}\n{% block content %}\n{{ \"a\"|json_encode }}\n{% endblock %}", - ); - } - - /** - * @expectedException Twig_Sandbox_SecurityError - * @expectedExceptionMessage Filter "json_encode" is not allowed in "1_child" at line 3. - */ - public function testSandboxWithInheritance() - { - $twig = $this->getEnvironment(true, array(), self::$templates, array('block')); - $twig->loadTemplate('1_child')->render(array()); - } - - public function testSandboxGloballySet() - { - $twig = $this->getEnvironment(false, array(), self::$templates); - $this->assertEquals('FOO', $twig->loadTemplate('1_basic')->render(self::$params), 'Sandbox does nothing if it is disabled globally'); - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('1_basic1')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method is called'); - } catch (Twig_Sandbox_SecurityError $e) { - } - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('1_basic2')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed filter is called'); - } catch (Twig_Sandbox_SecurityError $e) { - } - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('1_basic3')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed tag is used in the template'); - } catch (Twig_Sandbox_SecurityError $e) { - } - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('1_basic4')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed property is called in the template'); - } catch (Twig_Sandbox_SecurityError $e) { - } - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('1_basic5')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); - } catch (Twig_Sandbox_SecurityError $e) { - } - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('1_basic6')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); - } catch (Twig_Sandbox_SecurityError $e) { - } - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('1_basic7')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed function is called in the template'); - } catch (Twig_Sandbox_SecurityError $e) { - } - - $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => 'foo')); - FooObject::reset(); - $this->assertEquals('foo', $twig->loadTemplate('1_basic1')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['foo'], 'Sandbox only calls method once'); - - $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => '__toString')); - FooObject::reset(); - $this->assertEquals('foo', $twig->loadTemplate('1_basic5')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - - $twig = $this->getEnvironment(false, array(), self::$templates); - FooObject::reset(); - $this->assertEquals('foo', $twig->loadTemplate('1_basic5')->render(self::$params), 'Sandbox allows __toString when sandbox disabled'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - - $twig = $this->getEnvironment(true, array(), self::$templates, array(), array('upper')); - $this->assertEquals('FABIEN', $twig->loadTemplate('1_basic2')->render(self::$params), 'Sandbox allow some filters'); - - $twig = $this->getEnvironment(true, array(), self::$templates, array('if')); - $this->assertEquals('foo', $twig->loadTemplate('1_basic3')->render(self::$params), 'Sandbox allow some tags'); - - $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array(), array('FooObject' => 'bar')); - $this->assertEquals('bar', $twig->loadTemplate('1_basic4')->render(self::$params), 'Sandbox allow some properties'); - - $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array(), array(), array('cycle')); - $this->assertEquals('bar', $twig->loadTemplate('1_basic7')->render(self::$params), 'Sandbox allow some functions'); - - foreach (array('getfoobar', 'getFoobar', 'getFooBar') as $name) { - $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => $name)); - FooObject::reset(); - $this->assertEquals('foobarfoobar', $twig->loadTemplate('1_basic8')->render(self::$params), 'Sandbox allow methods in a case-insensitive way'); - $this->assertEquals(2, FooObject::$called['getFooBar'], 'Sandbox only calls method once'); - - $this->assertEquals('foobarfoobar', $twig->loadTemplate('1_basic9')->render(self::$params), 'Sandbox allow methods via shortcut names (ie. without get/set)'); - } - } - - public function testSandboxLocallySetForAnInclude() - { - self::$templates = array( - '2_basic' => '{{ obj.foo }}{% include "2_included" %}{{ obj.foo }}', - '2_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ); - - $twig = $this->getEnvironment(false, array(), self::$templates); - $this->assertEquals('fooFOOfoo', $twig->loadTemplate('2_basic')->render(self::$params), 'Sandbox does nothing if disabled globally and sandboxed not used for the include'); - - self::$templates = array( - '3_basic' => '{{ obj.foo }}{% sandbox %}{% include "3_included" %}{% endsandbox %}{{ obj.foo }}', - '3_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ); - - $twig = $this->getEnvironment(true, array(), self::$templates); - try { - $twig->loadTemplate('3_basic')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception when the included file is sandboxed'); - } catch (Twig_Sandbox_SecurityError $e) { - } - } - - public function testMacrosInASandbox() - { - $twig = $this->getEnvironment(true, array('autoescape' => 'html'), array('index' => <<{{ text }}

    {% endmacro %} - -{{- macros.test('username') }} -EOF - ), array('macro', 'import'), array('escape')); - - $this->assertEquals('

    username

    ', $twig->loadTemplate('index')->render(array())); - } - - protected function getEnvironment($sandboxed, $options, $templates, $tags = array(), $filters = array(), $methods = array(), $properties = array(), $functions = array()) - { - $loader = new Twig_Loader_Array($templates); - $twig = new Twig_Environment($loader, array_merge(array('debug' => true, 'cache' => false, 'autoescape' => false), $options)); - $policy = new Twig_Sandbox_SecurityPolicy($tags, $filters, $methods, $properties, $functions); - $twig->addExtension(new Twig_Extension_Sandbox($policy, $sandboxed)); - - return $twig; - } -} - -class FooObject -{ - public static $called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); - - public $bar = 'bar'; - - public static function reset() - { - self::$called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); - } - - public function __toString() - { - ++self::$called['__toString']; - - return 'foo'; - } - - public function foo() - { - ++self::$called['foo']; - - return 'foo'; - } - - public function getFooBar() - { - ++self::$called['getFooBar']; - - return 'foobar'; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php b/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php deleted file mode 100644 index 14e0144..0000000 --- a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php +++ /dev/null @@ -1,85 +0,0 @@ -tmpDir = sys_get_temp_dir().'/TwigTests'; - if (!file_exists($this->tmpDir)) { - @mkdir($this->tmpDir, 0777, true); - } - - if (!is_writable($this->tmpDir)) { - $this->markTestSkipped(sprintf('Unable to run the tests as "%s" is not writable.', $this->tmpDir)); - } - - $this->env = new Twig_Environment(new Twig_Loader_Array(array('index' => 'index', 'index2' => 'index2')), array('cache' => $this->tmpDir)); - } - - public function tearDown() - { - if ($this->fileName) { - unlink($this->fileName); - } - - $this->removeDir($this->tmpDir); - } - - /** - * @group legacy - */ - public function testWritingCacheFiles() - { - $name = 'index'; - $this->env->loadTemplate($name); - $cacheFileName = $this->env->getCacheFilename($name); - - $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); - $this->fileName = $cacheFileName; - } - - /** - * @group legacy - */ - public function testClearingCacheFiles() - { - $name = 'index2'; - $this->env->loadTemplate($name); - $cacheFileName = $this->env->getCacheFilename($name); - - $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); - $this->env->clearCacheFiles(); - $this->assertFalse(file_exists($cacheFileName), 'Cache file was not cleared.'); - } - - private function removeDir($target) - { - $fp = opendir($target); - while (false !== $file = readdir($fp)) { - if (in_array($file, array('.', '..'))) { - continue; - } - - if (is_dir($target.'/'.$file)) { - self::removeDir($target.'/'.$file); - } else { - unlink($target.'/'.$file); - } - } - closedir($fp); - rmdir($target); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php b/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php deleted file mode 100644 index b310a5b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertSame($strategy, Twig_FileExtensionEscapingStrategy::guess($filename)); - } - - public function getGuessData() - { - return array( - // default - array('html', 'foo.html'), - array('html', 'foo.html.twig'), - array('html', 'foo'), - array('html', 'foo.bar.twig'), - array('html', 'foo.txt/foo'), - array('html', 'foo.txt/foo.js/'), - - // css - array('css', 'foo.css'), - array('css', 'foo.css.twig'), - array('css', 'foo.twig.css'), - array('css', 'foo.js.css'), - array('css', 'foo.js.css.twig'), - - // js - array('js', 'foo.js'), - array('js', 'foo.js.twig'), - array('js', 'foo.txt/foo.js'), - array('js', 'foo.txt.twig/foo.js'), - - // txt - array(false, 'foo.txt'), - array(false, 'foo.txt.twig'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/filename.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/filename.test deleted file mode 100644 index b091ad3..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/filename.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"filename" autoescape strategy ---TEMPLATE-- -{{ br -}} -{{ include('index.html.twig') -}} -{{ include('index.txt.twig') -}} ---TEMPLATE(index.html.twig)-- -{{ br -}} ---TEMPLATE(index.txt.twig)-- -{{ br -}} ---DATA-- -return array('br' => '
    ') ---CONFIG-- -return array('autoescape' => 'filename') ---EXPECT-- -<br /> -<br /> -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html b/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html deleted file mode 100644 index cb0dbe4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html +++ /dev/null @@ -1 +0,0 @@ -{% block content %}{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html b/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html deleted file mode 100644 index df57c82..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'base.html' %} -{% block content %} - {{ foo.bar }} -{% endblock %} -{% block foo %} - {{ foo.bar }} -{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test deleted file mode 100644 index ce49165..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return array('foobar' => 'foobar') ---EXCEPTION-- -Twig_Error_Runtime: Variable "foo2" does not exist in "index.twig" at line 11 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test deleted file mode 100644 index e3c040f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Runtime: Variable "foobar" does not exist in "index.twig" at line 7 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test deleted file mode 100644 index d799a39..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multile function with undefined variable ---TEMPLATE-- -{{ include('foo', - with_context=with_context -) }} ---TEMPLATE(foo)-- -Foo ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Runtime: Variable "with_context" does not exist in "index.twig" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test deleted file mode 100644 index 64761fc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for multiline function with unknown argument ---TEMPLATE-- -{{ include('foo', - with_context=True, - invalid=False -) }} ---EXCEPTION-- -Twig_Error_Syntax: Unknown argument "invalid" for function "include(template, variables, with_context, ignore_missing, sandboxed)" in "index.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test deleted file mode 100644 index 096a5db..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multiline tag with undefined variable ---TEMPLATE-- -{% include 'foo' - with vars -%} ---TEMPLATE(foo)-- -Foo ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Runtime: Variable "vars" does not exist in "index.twig" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test deleted file mode 100644 index 5dd9f38..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Exception for syntax error in reused template ---TEMPLATE-- -{% use 'foo.twig' %} ---TEMPLATE(foo.twig)-- -{% block bar %} - {% do node.data = 5 %} -{% endblock %} ---EXCEPTION-- -Twig_Error_Syntax: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test deleted file mode 100644 index 02245e9..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Exception for an unclosed tag ---TEMPLATE-- -{% block foo %} - {% if foo %} - - - - - {% for i in fo %} - - - - {% endfor %} - - - -{% endblock %} ---EXCEPTION-- -Twig_Error_Syntax: Unexpected tag name "endblock" (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test deleted file mode 100644 index c8e7a09..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Exception for an undefined parent ---TEMPLATE-- -{% extends 'foo.html' %} - -{% set foo = "foo" %} ---EXCEPTION-- -Twig_Error_Loader: Template "foo.html" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test deleted file mode 100644 index 1992510..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception for an undefined template in a child template ---TEMPLATE-- -{% extends 'base.twig' %} - -{% block sidebar %} - {{ include('include.twig') }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block sidebar %} -{% endblock %} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Loader: Template "include.twig" is not defined in "index.twig" at line 5. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test deleted file mode 100644 index 6679fbe..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for an undefined trait ---TEMPLATE-- -{% use 'foo' with foobar as bar %} ---TEMPLATE(foo)-- -{% block bar %} -{% endblock %} ---EXCEPTION-- -Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test deleted file mode 100644 index c69b119..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Twig supports array notation ---TEMPLATE-- -{# empty array #} -{{ []|join(',') }} - -{{ [1, 2]|join(',') }} -{{ ['foo', "bar"]|join(',') }} -{{ {0: 1, 'foo': 'bar'}|join(',') }} -{{ {0: 1, 'foo': 'bar'}|keys|join(',') }} - -{{ {0: 1, foo: 'bar'}|join(',') }} -{{ {0: 1, foo: 'bar'}|keys|join(',') }} - -{# nested arrays #} -{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %} -{{ a[2]|join(',') }} -{{ a[3]["foo"]|join(',') }} - -{# works even if [] is used inside the array #} -{{ [foo[bar]]|join(',') }} - -{# elements can be any expression #} -{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }} - -{# arrays can have a trailing , like in PHP #} -{{ - [ - 1, - 2, - ]|join(',') -}} - -{# keys can be any expression #} -{% set a = 1 %} -{% set b = "foo" %} -{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %} -{{ ary|keys|join(',') }} -{{ ary|join(',') }} ---DATA-- -return array('bar' => 'bar', 'foo' => array('bar' => 'bar')) ---EXPECT-- -1,2 -foo,bar -1,bar -0,foo - -1,bar -0,foo - -1,2 -bar - -bar - -FOO,BAR, - -1,2 - -1,foo,c,1foo -a,b,c,d diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test deleted file mode 100644 index f3df328..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo }} -{{ items['foo'] }} -{{ items[foo] }} -{{ items[items[foo]] }} ---DATA-- -return array('foo' => 'bar', 'items' => array('foo' => 'bar', 'bar' => 'foo')) ---EXPECT-- -bar -bar -foo -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test deleted file mode 100644 index f5e6845..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Twig supports binary operations (+, -, *, /, ~, %, and, or) ---TEMPLATE-- -{{ 1 + 1 }} -{{ 2 - 1 }} -{{ 2 * 2 }} -{{ 2 / 2 }} -{{ 3 % 2 }} -{{ 1 and 1 }} -{{ 1 and 0 }} -{{ 0 and 1 }} -{{ 0 and 0 }} -{{ 1 or 1 }} -{{ 1 or 0 }} -{{ 0 or 1 }} -{{ 0 or 0 }} -{{ 0 or 1 and 0 }} -{{ 1 or 0 and 1 }} -{{ "foo" ~ "bar" }} -{{ foo ~ "bar" }} -{{ "foo" ~ bar }} -{{ foo ~ bar }} -{{ 20 // 7 }} ---DATA-- -return array('foo' => 'bar', 'bar' => 'foo') ---EXPECT-- -2 -1 -4 -1 -1 -1 - - - -1 -1 -1 - - -1 -foobar -barbar -foofoo -barfoo -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test deleted file mode 100644 index 74fe6ca..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports bitwise operations ---TEMPLATE-- -{{ 1 b-and 5 }} -{{ 1 b-or 5 }} -{{ 1 b-xor 5 }} -{{ (1 and 0 b-or 0) is same as(1 and (0 b-or 0)) ? 'ok' : 'ko' }} ---DATA-- -return array() ---EXPECT-- -1 -5 -4 -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test deleted file mode 100644 index 726b850..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports comparison operators (==, !=, <, >, >=, <=) ---TEMPLATE-- -{{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }} -{{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }} -{{ 1 == 1 }}/{{ 1 == 2 }} -{{ 1 != 1 }}/{{ 1 != 2 }} ---DATA-- -return array() ---EXPECT-- -///1 -1//1/1 -1/ -/1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test deleted file mode 100644 index 238dd27..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Twig supports the "divisible by" operator ---TEMPLATE-- -{{ 8 is divisible by(2) ? 'OK' }} -{{ 8 is not divisible by(3) ? 'OK' }} -{{ 8 is divisible by (2) ? 'OK' }} -{{ 8 is not - divisible - by - (3) ? 'OK' }} ---DATA-- -return array() ---EXPECT-- -OK -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test deleted file mode 100644 index 9cd0676..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Twig supports the .. operator ---TEMPLATE-- -{% for i in 0..10 %}{{ i }} {% endfor %} - -{% for letter in 'a'..'z' %}{{ letter }} {% endfor %} - -{% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %} - -{% for i in foo[0]..foo[1] %}{{ i }} {% endfor %} - -{% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %} ---DATA-- -return array('foo' => array(1, 10)) ---EXPECT-- -0 1 2 3 4 5 6 7 8 9 10 -a b c d e f g h i j k l m n o p q r s t u v w x y z -A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -1 2 3 4 5 6 7 8 9 10 -1 2 3 4 5 6 7 8 9 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test deleted file mode 100644 index 9ad5e5e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Twig supports the "ends with" operator ---TEMPLATE-- -{{ 'foo' ends with 'o' ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'f') ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' ends with '' ? 'OK' : 'KO' }} -{{ '1' ends with true ? 'OK' : 'KO' }} -{{ 1 ends with true ? 'OK' : 'KO' }} -{{ 0 ends with false ? 'OK' : 'KO' }} -{{ '' ends with false ? 'OK' : 'KO' }} -{{ false ends with false ? 'OK' : 'KO' }} -{{ false ends with '' ? 'OK' : 'KO' }} ---DATA-- -return array() ---EXPECT-- -OK -OK -OK -OK -KO -KO -KO -KO -KO -KO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test deleted file mode 100644 index 79f8e0b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig supports grouping of expressions ---TEMPLATE-- -{{ (2 + 2) / 2 }} ---DATA-- -return array() ---EXPECT-- -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test deleted file mode 100644 index 7ae3bae..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig supports literals ---TEMPLATE-- -1 {{ true }} -2 {{ TRUE }} -3 {{ false }} -4 {{ FALSE }} -5 {{ none }} -6 {{ NONE }} -7 {{ null }} -8 {{ NULL }} ---DATA-- -return array() ---EXPECT-- -1 1 -2 1 -3 -4 -5 -6 -7 -8 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test deleted file mode 100644 index 159db96..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports __call() for attributes ---TEMPLATE-- -{{ foo.foo }} -{{ foo.bar }} ---DATA-- -class TestClassForMagicCallAttributes -{ - public function getBar() - { - return 'bar_from_getbar'; - } - - public function __call($method, $arguments) - { - if ('foo' === $method) - { - return 'foo_from_call'; - } - - return false; - } -} -return array('foo' => new TestClassForMagicCallAttributes()) ---EXPECT-- -foo_from_call -bar_from_getbar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test deleted file mode 100644 index b6c7716..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports the "matches" operator ---TEMPLATE-- -{{ 'foo' matches '/o/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/^fo/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/O/i' ? 'OK' : 'KO' }} ---DATA-- -return array() ---EXPECT-- -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test deleted file mode 100644 index 5f801e6..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo.foo }} -{{ items.foo.getFoo() }} -{{ items.foo.bar }} -{{ items.foo['bar'] }} -{{ items.foo.bar('a', 43) }} -{{ items.foo.bar(foo) }} -{{ items.foo.self.foo() }} -{{ items.foo.is }} -{{ items.foo.in }} -{{ items.foo.not }} ---DATA-- -return array('foo' => 'bar', 'items' => array('foo' => new TwigTestFoo(), 'bar' => 'foo')) ---CONFIG-- -return array('strict_variables' => false) ---EXPECT-- -foo -foo -bar - -bar_a-43 -bar_bar -foo -is -in -not diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test deleted file mode 100644 index 1853b1b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig manages negative numbers correctly ---TEMPLATE-- -{{ -1 }} -{{ - 1 }} -{{ 5 - 1 }} -{{ 5-1 }} -{{ 5 + -1 }} -{{ 5 + - 1 }} ---DATA-- -return array() ---EXPECT-- --1 --1 -4 -4 -4 -4 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test deleted file mode 100644 index fe29d08..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Twig allows to use named operators as variable names ---TEMPLATE-- -{% for match in matches %} - {{- match }} -{% endfor %} -{{ in }} -{{ is }} ---DATA-- -return array('matches' => array(1, 2, 3), 'in' => 'in', 'is' => 'is') ---EXPECT-- -1 -2 -3 -in -is diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test deleted file mode 100644 index 542c350..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig parses postfix expressions ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo() %}foo{% endmacro %} - -{{ 'a' }} -{{ 'a'|upper }} -{{ ('a')|upper }} -{{ -1|upper }} -{{ macros.foo() }} -{{ (macros).foo() }} ---DATA-- -return array(); ---EXPECT-- -a -A -A --1 -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test deleted file mode 100644 index 601201d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Twig supports the "same as" operator ---TEMPLATE-- -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as (1) ? 'OK' }} -{{ 1 is not - same - as - (true) ? 'OK' }} ---DATA-- -return array() ---EXPECT-- -OK -OK -OK -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test deleted file mode 100644 index 75d331e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports the "starts with" operator ---TEMPLATE-- -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'oo') ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts -with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts with '' ? 'OK' : 'KO' }} -{{ '1' starts with true ? 'OK' : 'KO' }} -{{ '' starts with false ? 'OK' : 'KO' }} -{{ 'a' starts with false ? 'OK' : 'KO' }} -{{ false starts with '' ? 'OK' : 'KO' }} ---DATA-- -return array() ---EXPECT-- -OK -OK -OK -OK -OK -OK -KO -KO -KO -KO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test deleted file mode 100644 index a911661..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports string interpolation ---TEMPLATE-- -{{ "foo #{"foo #{bar} baz"} baz" }} -{{ "foo #{bar}#{bar} baz" }} ---DATA-- -return array('bar' => 'BAR'); ---EXPECT-- -foo foo BAR baz baz -foo BARBAR baz diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test deleted file mode 100644 index 0e6fa96..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }} -{{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }} -{{ 1 == 1 ? 'foo
    ':'' }} -{{ foo ~ (bar ? ('-' ~ bar) : '') }} ---DATA-- -return array('foo' => 'foo', 'bar' => 'bar') ---EXPECT-- -YES -NO -YES1 -NO1 -foo
    -foo-bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test deleted file mode 100644 index fdc660f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' }} -{{ 0 ? 'YES' }} ---DATA-- -return array() ---EXPECT-- -YES - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test deleted file mode 100644 index 9057e83..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 'YES' ?: 'NO' }} -{{ 0 ?: 'NO' }} ---DATA-- -return array() ---EXPECT-- -YES -NO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test deleted file mode 100644 index 47f37e4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not allow to use two-word named operators as variable names ---TEMPLATE-- -{{ starts with }} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Syntax: Unexpected token "operator" of value "starts with" in "index.twig" at line 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test deleted file mode 100644 index b79219a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports unary operators (not, -, +) ---TEMPLATE-- -{{ not 1 }}/{{ not 0 }} -{{ +1 + 1 }}/{{ -1 - 1 }} -{{ not (false or true) }} ---DATA-- -return array() ---EXPECT-- -/1 -2/-2 - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test deleted file mode 100644 index ad84a9c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig manages negative numbers as default parameters ---TEMPLATE-- -{% import _self as macros %} -{{ macros.negative_number1() }} -{{ macros.negative_number2() }} -{{ macros.negative_number3() }} -{{ macros.positive_number1() }} -{{ macros.positive_number2() }} -{% macro negative_number1(nb=-1) %}{{ nb }}{% endmacro %} -{% macro negative_number2(nb = --1) %}{{ nb }}{% endmacro %} -{% macro negative_number3(nb = - 1) %}{{ nb }}{% endmacro %} -{% macro positive_number1(nb = +1) %}{{ nb }}{% endmacro %} -{% macro positive_number2(nb = ++1) %}{{ nb }}{% endmacro %} ---DATA-- -return array() ---EXPECT-- --1 -1 --1 -1 -1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test deleted file mode 100644 index cc6eef8..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig unary operators precedence ---TEMPLATE-- -{{ -1 - 1 }} -{{ -1 - -1 }} -{{ -1 * -1 }} -{{ 4 / -1 * 5 }} ---DATA-- -return array() ---EXPECT-- --2 -0 -1 --20 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test deleted file mode 100644 index 27e93fd..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -"abs" filter ---TEMPLATE-- -{{ (-5.5)|abs }} -{{ (-5)|abs }} -{{ (-0)|abs }} -{{ 0|abs }} -{{ 5|abs }} -{{ 5.5|abs }} -{{ number1|abs }} -{{ number2|abs }} -{{ number3|abs }} -{{ number4|abs }} -{{ number5|abs }} -{{ number6|abs }} ---DATA-- -return array('number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5) ---EXPECT-- -5.5 -5 -0 -0 -5 -5.5 -5.5 -5 -0 -0 -5 -5.5 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test deleted file mode 100644 index cb6de7f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3) %} -
    - {% for column in row %} -
    {{ column }}
    - {% endfor %} -
    -{% endfor %} ---DATA-- -return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) ---EXPECT-- -
    -
    a
    -
    b
    -
    c
    -
    -
    -
    d
    -
    e
    -
    f
    -
    -
    -
    g
    -
    h
    -
    i
    -
    -
    -
    j
    -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test deleted file mode 100644 index e2ec4be..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3.1) %} -
    - {% for column in row %} -
    {{ column }}
    - {% endfor %} -
    -{% endfor %} ---DATA-- -return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) ---EXPECT-- -
    -
    a
    -
    b
    -
    c
    -
    d
    -
    -
    -
    e
    -
    f
    -
    g
    -
    h
    -
    -
    -
    i
    -
    j
    -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test deleted file mode 100644 index af996f2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- - -{% for row in items|batch(3, '') %} - - {% for column in row %} - - {% endfor %} - -{% endfor %} -
    {{ column }}
    ---DATA-- -return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) ---EXPECT-- - - - - - - - - - - - - - - - - - - - - - -
    abc
    def
    ghi
    j
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test deleted file mode 100644 index 72483f4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3, 'fill') %} -
    - {% for column in row %} -
    {{ column }}
    - {% endfor %} -
    -{% endfor %} ---DATA-- -return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l')) ---EXPECT-- -
    -
    a
    -
    b
    -
    c
    -
    -
    -
    d
    -
    e
    -
    f
    -
    -
    -
    g
    -
    h
    -
    i
    -
    -
    -
    j
    -
    k
    -
    l
    -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test deleted file mode 100644 index 746295f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- - -{% for row in items|batch(3, 'fill') %} - - {% for column in row %} - - {% endfor %} - -{% endfor %} -
    {{ column }}
    ---DATA-- -return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) ---EXPECT-- - - - - - - - - - - - - - - - - - - - - - -
    abc
    def
    ghi
    jfillfill
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test deleted file mode 100644 index 6015380..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter preserves array keys ---TEMPLATE-- -{{ {'foo': 'bar', 'key': 'value'}|batch(4)|first|keys|join(',') }} -{{ {'foo': 'bar', 'key': 'value'}|batch(4, 'fill')|first|keys|join(',') }} ---DATA-- -return array() ---EXPECT-- -foo,key -foo,key,0,1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test deleted file mode 100644 index b9c058d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter with zero elements ---TEMPLATE-- -{{ []|batch(3)|length }} -{{ []|batch(3, 'fill')|length }} ---DATA-- -return array() ---EXPECT-- -0 -0 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test deleted file mode 100644 index 380b04b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"convert_encoding" filter ---CONDITION-- -function_exists('iconv') || function_exists('mb_convert_encoding') ---TEMPLATE-- -{{ "愛していますか?"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }} ---DATA-- -return array() ---EXPECT-- -愛していますか? diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test deleted file mode 100644 index d17e5e2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }} -{{ date1|date('e') }} -{{ date1|date('d/m/Y H:i:s') }} - -{{ date2|date }} -{{ date2|date('d/m/Y') }} -{{ date2|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s', timezone1) }} -{{ date2|date('d/m/Y H:i:s') }} - -{{ date3|date }} -{{ date3|date('d/m/Y') }} - -{{ date4|date }} -{{ date4|date('d/m/Y') }} - -{{ date5|date }} -{{ date5|date('d/m/Y') }} - -{{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date6|date('d/m/Y H:i:s P', false) }} -{{ date6|date('e', 'Europe/Paris') }} -{{ date6|date('e', false) }} - -{{ date7|date }} -{{ date7|date(timezone='Europe/Paris') }} -{{ date7|date(timezone='Asia/Hong_Kong') }} -{{ date7|date(timezone=false) }} -{{ date7|date(timezone='Indian/Mauritius') }} - -{{ '2010-01-28 15:00:00'|date(timezone="Europe/Paris") }} -{{ '2010-01-28 15:00:00'|date(timezone="Asia/Hong_Kong") }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return array( - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(), - 'date6' => new DateTime('2010-10-04 13:45', new DateTimeZone('America/New_York')), - 'date7' => '2010-01-28T15:00:00+04:00', - 'timezone1' => new DateTimeZone('America/New_York'), -) ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 19:45:00 +08:00 -04/10/2010 06:45:00 -05:00 -Europe/Paris -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 - -October 4, 2010 15:45 -04/10/2010 - -January 2, 1964 04:04 -02/01/1964 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York - -January 28, 2010 12:00 -January 28, 2010 12:00 -January 28, 2010 19:00 -January 28, 2010 15:00 -January 28, 2010 15:00 - -January 28, 2010 15:00 -January 28, 2010 22:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test deleted file mode 100644 index 11a1ef4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours'); -return array( - 'date1' => mktime(13, 45, 0, 10, 4, 2010), -) ---EXPECT-- -2010-10-04 -04/10/2010 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test deleted file mode 100644 index e6d3707..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"date" filter (interval support as of PHP 5.3) ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ date2|date }} -{{ date2|date('%d days') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours'); -return array( - 'date2' => new DateInterval('P2D'), -) ---EXPECT-- -2 days 0 hours -2 days diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test deleted file mode 100644 index 4e18325..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"date" filter ---CONDITION-- -version_compare(phpversion(), '5.5.0', '>=') ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s', timezone1) }} -{{ date1|date('d/m/Y H:i:s') }} -{{ date1|date_modify('+1 hour')|date('d/m/Y H:i:s') }} - -{{ date2|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date2|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s P', false) }} -{{ date2|date('e', 'Europe/Paris') }} -{{ date2|date('e', false) }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return array( - 'date1' => new DateTimeImmutable('2010-10-04 13:45'), - 'date2' => new DateTimeImmutable('2010-10-04 13:45', new DateTimeZone('America/New_York')), - 'timezone1' => new DateTimeZone('America/New_York'), -) ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 -04/10/2010 14:45:00 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test deleted file mode 100644 index 0c8c6f1..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"date" filter (interval support as of PHP 5.3) ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('%d days %h hours') }} -{{ date1|date('%d days %h hours', timezone1) }} ---DATA-- -date_default_timezone_set('UTC'); -return array( - 'date1' => new DateInterval('P2D'), - // This should have no effect on DateInterval formatting - 'timezone1' => new DateTimeZone('America/New_York'), -) ---EXPECT-- -2 days -2 days 0 hours -2 days 0 hours diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test deleted file mode 100644 index 53d3a69..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date_modify" filter ---TEMPLATE-- -{{ date1|date_modify('-1day')|date('Y-m-d H:i:s') }} -{{ date2|date_modify('-1day')|date('Y-m-d H:i:s') }} ---DATA-- -date_default_timezone_set('UTC'); -return array( - 'date1' => '2010-10-04 13:45', - 'date2' => new DateTime('2010-10-04 13:45'), -) ---EXPECT-- -2010-10-03 13:45:00 -2010-10-03 13:45:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test deleted file mode 100644 index 4ecde8a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }} -{{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }} -{{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }} ---DATA-- -date_default_timezone_set('UTC'); -return array('date' => mktime(13, 45, 0, 10, 4, 2010)) ---EXPECT-- -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test deleted file mode 100644 index b8d1d66..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -"default" filter ---TEMPLATE-- -Variable: -{{ definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -Array access: -{{ nested.definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedVar'] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested['undefinedVar'] |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar.foo |default('default') is same as('default') ? 'ok' : 'ko' }} -Plain values: -{{ 'defined' |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ 0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ '' |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ null |default('default') is same as('default') ? 'ok' : 'ko' }} -Precedence: -{{ 'o' ~ nullVar |default('k') }} -{{ 'o' ~ nested.nullVar |default('k') }} -Object methods: -{{ object.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.getFoo() |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.getFoo('a') |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod() |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod('a') |default('default') is same as('default') ? 'ok' : 'ko' }} -Deep nested: -{{ nested.undefinedVar.foo.bar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.definedArray.0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedArray'][0] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.self.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.self.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod.self |default('default') is same as('default') ? 'ok' : 'ko' }} ---DATA-- -return array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => array(0), - ), - 'object' => new TwigTestFoo(), -) ---CONFIG-- -return array('strict_variables' => false) ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok ---DATA-- -return array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => array(0), - ), - 'object' => new TwigTestFoo(), -) ---CONFIG-- -return array('strict_variables' => true) ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test deleted file mode 100644 index 93c5913..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic filter ---TEMPLATE-- -{{ 'bar'|foo_path }} -{{ 'bar'|a_foo_b_bar }} ---DATA-- -return array() ---EXPECT-- -foo/bar -a/b/bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test deleted file mode 100644 index a606c10..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "foo
    "|e }} ---DATA-- -return array() ---EXPECT-- -foo <br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test deleted file mode 100644 index 009a245..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter does not escape with the html strategy when using the html_attr strategy ---TEMPLATE-- -{{ '
    '|escape('html_attr') }} ---DATA-- -return array() ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test deleted file mode 100644 index bba26a0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "愛していますか?
    "|e }} ---DATA-- -return array() ---EXPECT-- -愛していますか? <br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test deleted file mode 100644 index aa54645..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"first" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|first }} -{{ {a: 1, b: 2, c: 3, d: 4}|first }} -{{ '1234'|first }} -{{ arr|first }} -{{ 'Ä€é'|first }} -{{ ''|first }} ---DATA-- -return array('arr' => new ArrayObject(array(1, 2, 3, 4))) ---EXPECT-- -1 -1 -1 -1 -Ä diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test deleted file mode 100644 index 85a9b71..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{% set foo %} - foo
    -{% endset %} - -{{ foo|e('html') -}} -{{ foo|e('js') }} -{% autoescape true %} - {{ foo }} -{% endautoescape %} ---DATA-- -return array() ---EXPECT-- - foo<br /> -\x20\x20\x20\x20foo\x3Cbr\x20\x2F\x3E\x0A - foo
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test deleted file mode 100644 index 97221ff..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"format" filter ---TEMPLATE-- -{{ string|format(foo, 3) }} ---DATA-- -return array('string' => '%s/%d', 'foo' => 'bar') ---EXPECT-- -bar/3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test deleted file mode 100644 index b342c17..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"join" filter ---TEMPLATE-- -{{ ["foo", "bar"]|join(', ') }} -{{ foo|join(', ') }} -{{ bar|join(', ') }} ---DATA-- -return array('foo' => new TwigTestFoo(), 'bar' => new ArrayObject(array(3, 4))) ---EXPECT-- -foo, bar -1, 2 -3, 4 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test deleted file mode 100644 index 1738d40..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"json_encode" filter ---TEMPLATE-- -{{ "foo"|json_encode|raw }} -{{ foo|json_encode|raw }} -{{ [foo, "foo"]|json_encode|raw }} ---DATA-- -return array('foo' => new Twig_Markup('foo', 'UTF-8')) ---EXPECT-- -"foo" -"foo" -["foo","foo"] diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test deleted file mode 100644 index 1b8031e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"last" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|last }} -{{ {a: 1, b: 2, c: 3, d: 4}|last }} -{{ '1234'|last }} -{{ arr|last }} -{{ 'Ä€é'|last }} -{{ ''|last }} ---DATA-- -return array('arr' => new ArrayObject(array(1, 2, 3, 4))) ---EXPECT-- -4 -4 -4 -4 -é diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test deleted file mode 100644 index 3347474..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"length" filter ---TEMPLATE-- -{{ array|length }} -{{ string|length }} -{{ number|length }} -{{ markup|length }} ---DATA-- -return array('array' => array(1, 4), 'string' => 'foo', 'number' => 1000, 'markup' => new Twig_Markup('foo', 'UTF-8')) ---EXPECT-- -2 -3 -4 -3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test deleted file mode 100644 index 5d5e243..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"length" filter ---CONDITION-- -function_exists('mb_get_info') ---TEMPLATE-- -{{ string|length }} -{{ markup|length }} ---DATA-- -return array('string' => 'été', 'markup' => new Twig_Markup('foo', 'UTF-8')) ---EXPECT-- -3 -3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test deleted file mode 100644 index 81371a4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"merge" filter ---TEMPLATE-- -{{ items|merge({'bar': 'foo'})|join }} -{{ items|merge({'bar': 'foo'})|keys|join }} -{{ {'bar': 'foo'}|merge(items)|join }} -{{ {'bar': 'foo'}|merge(items)|keys|join }} -{{ numerics|merge([4, 5, 6])|join }} -{{ traversable.a|merge(traversable.b)|join }} ---DATA-- -return array('items' => array('foo' => 'bar'), 'numerics' => array(1, 2, 3), 'traversable' => array('a' => new ArrayObject(array(0 => 1, 1 => 2, 2 => 3)), 'b' => new ArrayObject(array('a' => 'b')))) ---EXPECT-- -barfoo -foobar -foobar -barfoo -123456 -123b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test deleted file mode 100644 index 6545a9b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"nl2br" filter ---TEMPLATE-- -{{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }} -{{ text|nl2br }} ---DATA-- -return array('text' => "If you have some HTML\nit will be escaped.") ---EXPECT-- -I like Twig.
    -You will like it too.
    -
    -Everybody like it! -If you have some <strong>HTML</strong>
    -it will be escaped. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test deleted file mode 100644 index 639a865..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"number_format" filter ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(2) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -return array(); ---EXPECT-- -20 -20 -20.25 -20,25 -1,020,25 -1.020,25 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test deleted file mode 100644 index c6903cc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"number_format" filter with defaults. ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(1) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -$twig->getExtension('core')->setNumberFormat(2, '!', '='); -return array(); ---EXPECT-- -20!00 -20!25 -20!3 -20,25 -1=020!25 -1=020,25 -1.020,25 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test deleted file mode 100644 index 06be7e2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"replace" filter ---TEMPLATE-- -{{ "I liké %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }} -{{ 'I like single replace operation only %that%'|replace({'%that%' : '%that%1'}) }} -{{ 'I like %this% and %that%.'|replace(traversable) }} ---DATA-- -return array('traversable' => new ArrayObject(array('%this%' => 'foo', '%that%' => 'bar'))) ---EXPECT-- -I liké foo and bar. -I like single replace operation only %that%1 -I like foo and bar. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test deleted file mode 100644 index 2143a86..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Exception for invalid argument type in replace call ---TEMPLATE-- -{{ 'test %foo%'|replace(stdClass) }} ---DATA-- -return array('stdClass' => new stdClass()) ---EXCEPTION-- -Twig_Error_Runtime: The "replace" filter expects an array or "Traversable" as replace values, got "stdClass" in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test deleted file mode 100644 index 7948ac4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"reverse" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|reverse|join('') }} -{{ '1234évènement'|reverse }} -{{ arr|reverse|join('') }} -{{ {'a': 'c', 'b': 'a'}|reverse()|join(',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserveKeys=true)|join(glue=',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserve_keys=true)|join(glue=',') }} ---DATA-- -return array('arr' => new ArrayObject(array(1, 2, 3, 4))) ---EXPECT-- -4321 -tnemenèvé4321 -4321 -a,c -a,c -a,c diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test deleted file mode 100644 index 57806b6..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"round" filter ---TEMPLATE-- -{{ 2.7|round }} -{{ 2.1|round }} -{{ 2.1234|round(3, 'floor') }} -{{ 2.1|round(0, 'ceil') }} - -{{ 21.3|round(-1)}} -{{ 21.3|round(-1, 'ceil')}} -{{ 21.3|round(-1, 'floor')}} ---DATA-- -return array() ---EXPECT-- -3 -2 -2.123 -3 - -20 -30 -20 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test deleted file mode 100644 index b49b89f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -"slice" filter ---TEMPLATE-- -{{ [1, 2, 3, 4][1:2]|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }} -{{ [1, 2, 3, 4][start:length]|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }} -{{ '1234'|slice(1, 2) }} -{{ '1234'[1:2] }} -{{ arr|slice(1, 2)|join('') }} -{{ arr[1:2]|join('') }} -{{ arr[4:1]|join('') }} -{{ arr[3:2]|join('') }} - -{{ [1, 2, 3, 4]|slice(1)|join('') }} -{{ [1, 2, 3, 4][1:]|join('') }} -{{ '1234'|slice(1) }} -{{ '1234'[1:] }} -{{ '1234'[:1] }} - -{{ arr|slice(3)|join('') }} -{{ arr[2:]|join('') }} -{{ xml|slice(1)|join('')}} ---DATA-- -return array('start' => 1, 'length' => 2, 'arr' => new ArrayObject(array(1, 2, 3, 4)), 'xml' => new SimpleXMLElement('12')) ---EXPECT-- -23 -23 -23 -23 -01 -12 -23 -bc -23 -23 -23 -23 - -4 - -234 -234 -234 -234 -1 - -4 -34 -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test deleted file mode 100644 index c67c18e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"sort" filter ---TEMPLATE-- -{{ array1|sort|join }} -{{ array2|sort|join }} -{{ traversable|sort|join }} ---DATA-- -return array('array1' => array(4, 1), 'array2' => array('foo', 'bar'), 'traversable' => new ArrayObject(array(0 => 3, 1 => 2, 2 => 1))) ---EXPECT-- -14 -barfoo -123 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test deleted file mode 100644 index dbaf7dc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom filter ---TEMPLATE-- -{{ 'foo'|§ }} ---DATA-- -return array() ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test deleted file mode 100644 index a093ed7..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"split" filter ---TEMPLATE-- -{{ "one,two,three,four,five"|split(',')|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} -{{ foo|split(',', -2)|join('-') }} ---DATA-- -return array('foo' => "one,two,three,four,five", 'baz' => '12345',) ---EXPECT-- -one-two-three-four-five -one-two-three-four-five -one-two-three,four,five -1-2-3-4-5 -1-2-3-4-5 -12-34-5 -one-two-three \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test deleted file mode 100644 index 305e162..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"split" filter ---CONDITION-- -function_exists('mb_get_info') ---TEMPLATE-- -{{ "é"|split('', 10)|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 1)|join('-') }} -{{ foo|split(',', 2)|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} ---DATA-- -return array('foo' => 'Ä,é,Äほ', 'baz' => 'éÄßごa',) ---EXPECT-- -é -Ä-é-Äほ -Ä,é,Äほ -Ä-é,Äほ -Ä-é-Äほ -é-Ä-ß-ご-a -é-Ä-ß-ご-a -éÄ-ßご-a \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test deleted file mode 100644 index 3192062..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"trim" filter ---TEMPLATE-- -{{ " I like Twig. "|trim }} -{{ text|trim }} -{{ " foo/"|trim("/") }} ---DATA-- -return array('text' => " If you have some HTML it will be escaped. ") ---EXPECT-- -I like Twig. -If you have some <strong>HTML</strong> it will be escaped. - foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test deleted file mode 100644 index 8726159..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"url_encode" filter ---CONDITION-- -defined('PHP_QUERY_RFC3986') ---TEMPLATE-- -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} -{{ {}|url_encode|default("default") }} -{{ 'spéßi%le%c0d@dspa ce'|url_encode }} ---DATA-- -return array() ---EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -default -sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test deleted file mode 100644 index 11800e9..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"url_encode" filter for PHP < 5.4 and HHVM ---CONDITION-- -defined('PHP_QUERY_RFC3986') ---TEMPLATE-- -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} -{{ {}|url_encode|default("default") }} -{{ 'spéßi%le%c0d@dspa ce'|url_encode }} ---DATA-- -return array() ---EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -default -sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test deleted file mode 100644 index 71b2038..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"attribute" function ---TEMPLATE-- -{{ attribute(obj, method) }} -{{ attribute(array, item) }} -{{ attribute(obj, "bar", ["a", "b"]) }} -{{ attribute(obj, "bar", arguments) }} -{{ attribute(obj, method) is defined ? 'ok' : 'ko' }} -{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} ---DATA-- -return array('obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => array('a', 'b')) ---EXPECT-- -foo -bar -bar_a-b -bar_a-b -ok -ko diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test deleted file mode 100644 index 8e54059..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function ---TEMPLATE-- -{% extends 'base.twig' %} -{% block bar %}BAR{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}{{ block('bar') }}{% endblock %} -{% block bar %}BAR_BASE{% endblock %} ---DATA-- -return array() ---EXPECT-- -BARBAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test deleted file mode 100644 index 6312879..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"constant" function ---TEMPLATE-- -{{ constant('DATE_W3C') == expect ? 'true' : 'false' }} -{{ constant('ARRAY_AS_PROPS', object) }} ---DATA-- -return array('expect' => DATE_W3C, 'object' => new ArrayObject(array('hi'))); ---EXPECT-- -true -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test deleted file mode 100644 index 522a63b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"cycle" function ---TEMPLATE-- -{% for i in 0..6 %} -{{ cycle(array1, i) }}-{{ cycle(array2, i) }} -{% endfor %} ---DATA-- -return array('array1' => array('odd', 'even'), 'array2' => array('apple', 'orange', 'citrus')) ---EXPECT-- -odd-apple -even-orange -odd-citrus -even-apple -odd-orange -even-citrus -odd-apple diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test deleted file mode 100644 index 8be9c0c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date() == date('now') ? 'OK' : 'KO' }} -{{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} ---DATA-- -date_default_timezone_set('UTC'); -return array( - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(), -) ---EXPECT-- -OK -OK -OK -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test deleted file mode 100644 index b9dd9e3..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date(date, "America/New_York")|date('d/m/Y H:i:s P', false) }} -{{ date(timezone="America/New_York", date=date)|date('d/m/Y H:i:s P', false) }} ---DATA-- -date_default_timezone_set('UTC'); -return array('date' => mktime(13, 45, 0, 10, 4, 2010)) ---EXPECT-- -04/10/2010 09:45:00 -04:00 -04/10/2010 09:45:00 -04:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test deleted file mode 100644 index f407237..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"dump" function ---CONDITION-- -!extension_loaded('xdebug') ---TEMPLATE-- -{{ dump('foo') }} -{{ dump('foo', 'bar') }} ---DATA-- -return array('foo' => 'foo', 'bar' => 'bar') ---CONFIG-- -return array('debug' => true, 'autoescape' => false); ---EXPECT-- -string(3) "foo" - -string(3) "foo" -string(3) "bar" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test deleted file mode 100644 index 889b7a9..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded ---CONDITION-- -!extension_loaded('xdebug') || (($r = new ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<')) ---TEMPLATE-- -{{ dump() }} ---DATA-- -return array('foo' => 'foo', 'bar' => 'bar') ---CONFIG-- -return array('debug' => true, 'autoescape' => false); ---EXPECT-- -array(3) { - ["foo"]=> - string(3) "foo" - ["bar"]=> - string(3) "bar" - ["global"]=> - string(6) "global" -} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test deleted file mode 100644 index 913fbc9..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic function ---TEMPLATE-- -{{ foo_path('bar') }} -{{ a_foo_b_bar('bar') }} ---DATA-- -return array() ---EXPECT-- -foo/bar -a/b/bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test deleted file mode 100644 index b7653b4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% set tmp = include("foo.twig") %} - -FOO{{ tmp }}BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return array() ---EXPECT-- -FOO -FOOBARBAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test deleted file mode 100644 index 56f8f3b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function is safe for auto-escaping ---TEMPLATE-- -{{ include("foo.twig") }} ---TEMPLATE(foo.twig)-- -

    Test

    ---DATA-- -return array() ---EXPECT-- -

    Test

    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test deleted file mode 100644 index a434182..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -FOO -{{ include("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return array() ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test deleted file mode 100644 index aba30ce..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function allows expressions for the template to include ---TEMPLATE-- -FOO -{{ include(foo) }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return array('foo' => 'foo.twig') ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test deleted file mode 100644 index 43a2ccc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"], ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true, variables = {}) }} -{{ include("foo.twig", ignore_missing = true, variables = {}, with_context = true) }} ---DATA-- -return array() ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test deleted file mode 100644 index 4d2f6cf..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include("foo.twig") }} ---DATA-- -return array(); ---EXCEPTION-- -Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test deleted file mode 100644 index 78fddc7..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {{ include("foo.twig") }} -{% endblock %} ---DATA-- -return array(); ---EXCEPTION-- -Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test deleted file mode 100644 index 7b9ccac..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} ---TEMPLATE(foo.twig)-- - - -{{ foo|e }} -{{ foo|e }} ---DATA-- -return array() ---EXCEPTION-- -Twig_Sandbox_SecurityNotAllowedFilterError: Filter "e" is not allowed in "foo.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test deleted file mode 100644 index 8ffc492..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} -{{ include("bar.twig") }} ---TEMPLATE(foo.twig)-- -foo ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return array('foo' => 'bar
    ') ---EXPECT-- -foo - - -bar<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test deleted file mode 100644 index 8bf6e10..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("unknown.twig", sandboxed = true, ignore_missing = true) }} -{{ include("bar.twig") }} ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return array('foo' => 'bar
    ') ---EXPECT-- - - -bar<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test deleted file mode 100644 index 18d405a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function accepts Twig_Template instance ---TEMPLATE-- -{{ include(foo) }} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return array('foo' => $twig->loadTemplate('foo.twig')) ---EXPECT-- -BAR FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test deleted file mode 100644 index 1a81006..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"]) }} -{{- include(["bar.twig", "foo.twig"]) }} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return array() ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test deleted file mode 100644 index 35611fb..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function accept variables and with_context ---TEMPLATE-- -{{ include("foo.twig") }} -{{- include("foo.twig", with_context = false) }} -{{- include("foo.twig", {'foo1': 'bar'}) }} -{{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return array('foo' => 'bar') ---EXPECT-- -foo,global,_parent, -global,_parent, -foo,global,foo1,_parent, -foo1,global,_parent, diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test deleted file mode 100644 index b2ace94..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function accept variables ---TEMPLATE-- -{{ include("foo.twig", {'foo': 'bar'}) }} -{{- include("foo.twig", vars) }} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return array('vars' => array('foo' => 'bar')) ---EXPECT-- -bar -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test deleted file mode 100644 index e6c94af..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"max" function ---TEMPLATE-- -{{ max([2, 1, 3, 5, 4]) }} -{{ max(2, 1, 3, 5, 4) }} -{{ max({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return array() ---EXPECT-- -5 -5 -two diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test deleted file mode 100644 index 660471c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"min" function ---TEMPLATE-- -{{ min(2, 1, 3, 5, 4) }} -{{ min([2, 1, 3, 5, 4]) }} -{{ min({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return array() ---EXPECT-- -1 -1 -five diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test deleted file mode 100644 index e0377c8..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"range" function ---TEMPLATE-- -{{ range(low=0+1, high=10+0, step=2)|join(',') }} ---DATA-- -return array() ---EXPECT-- -1,3,5,7,9 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test deleted file mode 100644 index f39712d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"block" function recursively called in a parent template ---TEMPLATE-- -{% extends "ordered_menu.twig" %} -{% block label %}"{{ parent() }}"{% endblock %} -{% block list %}{% set class = 'b' %}{{ parent() }}{% endblock %} ---TEMPLATE(ordered_menu.twig)-- -{% extends "menu.twig" %} -{% block list %}{% set class = class|default('a') %}
      {{ block('children') }}
    {% endblock %} ---TEMPLATE(menu.twig)-- -{% extends "base.twig" %} -{% block list %}
      {{ block('children') }}
    {% endblock %} -{% block children %}{% set currentItem = item %}{% for item in currentItem %}{{ block('item') }}{% endfor %}{% set item = currentItem %}{% endblock %} -{% block item %}
  • {% if item is not iterable %}{{ block('label') }}{% else %}{{ block('list') }}{% endif %}
  • {% endblock %} -{% block label %}{{ item }}{{ block('unknown') }}{% endblock %} ---TEMPLATE(base.twig)-- -{{ block('list') }} ---DATA-- -return array('item' => array('1', '2', array('3.1', array('3.2.1', '3.2.2'), '3.4'))) ---EXPECT-- -
    1. "1"
    2. "2"
      1. "3.1"
        1. "3.2.1"
        2. "3.2.2"
      2. "3.4"
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test deleted file mode 100644 index 0e094c3..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"source" function ---TEMPLATE-- -FOO -{{ source("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -{{ foo }}
    ---DATA-- -return array() ---EXPECT-- -FOO - -{{ foo }}
    - -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test deleted file mode 100644 index 30c3df5..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom function ---TEMPLATE-- -{{ §('foo') }} ---DATA-- -return array() ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test deleted file mode 100644 index 3d3b958..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"template_from_string" function ---TEMPLATE-- -{% include template_from_string(template) %} - -{% include template_from_string("Hello {{ name }}") %} -{% include template_from_string('{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}') %} ---TEMPLATE(parent.twig)-- -{% block content %}{% endblock %} ---DATA-- -return array('name' => 'Fabien', 'template' => "Hello {{ name }}") ---EXPECT-- -Hello Fabien -Hello Fabien -Hello Fabien diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test deleted file mode 100644 index 4ccff7b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(a, b = 'bar') -%} -{{ a }}{{ b }} -{%- endmacro %} - -{{ test('foo') }} -{{ test('bar', 'foo') }} ---DATA-- -return array(); ---EXPECT-- -foobar -barfoo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test deleted file mode 100644 index cd25428..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo(data) %} - {{ data }} -{% endmacro %} - -{% macro bar() %} -
    -{% endmacro %} - -{{ macros.foo(macros.bar()) }} ---DATA-- -return array(); ---EXPECT-- -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test deleted file mode 100644 index cbfb921..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(this) -%} - {{ this }} -{%- endmacro %} - -{{ test(this) }} ---DATA-- -return array('this' => 'foo'); ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test deleted file mode 100644 index 6a366cd..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as test %} -{% from _self import test %} - -{% macro test(a, b) -%} - {{ a|default('a') }}
    - {{- b|default('b') }}
    -{%- endmacro %} - -{{ test.test() }} -{{ test() }} -{{ test.test(1, "c") }} -{{ test(1, "c") }} ---DATA-- -return array(); ---EXPECT-- -a
    b
    -a
    b
    -1
    c
    -1
    c
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test deleted file mode 100644 index 412c90f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -macro with arbitrary arguments ---TEMPLATE-- -{% from _self import test1, test2 %} - -{% macro test1(var) %} - {{- var }}: {{ varargs|join(", ") }} -{% endmacro %} - -{% macro test2() %} - {{- varargs|join(", ") }} -{% endmacro %} - -{{ test1("foo", "bar", "foobar") }} -{{ test2("foo", "bar", "foobar") }} ---DATA-- -return array(); ---EXPECT-- -foo: bar, foobar - -foo, bar, foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test deleted file mode 100644 index b08c8ec..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -macro with varargs argument ---TEMPLATE-- -{% macro test(varargs) %} -{% endmacro %} ---EXCEPTION-- -Twig_Error_Syntax: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2 - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test deleted file mode 100644 index 685626f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro with a filter ---TEMPLATE-- -{% import _self as test %} - -{% macro test() %} - {% filter escape %}foo
    {% endfilter %} -{% endmacro %} - -{{ test.test() }} ---DATA-- -return array(); ---EXPECT-- -foo<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test deleted file mode 100644 index df48578..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception with bad line number ---TEMPLATE-- -{% block content %} - {{ foo }} - {{ include("foo") }} -{% endblock %} -index ---TEMPLATE(foo)-- -foo -{{ foo.bar }} ---DATA-- -return array('foo' => 'foo'); ---EXCEPTION-- -Twig_Error_Runtime: Impossible to access an attribute ("bar") on a string variable ("foo") in "foo" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test deleted file mode 100644 index 65f6cd2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig outputs 0 nodes correctly ---TEMPLATE-- -{{ foo }}0{{ foo }} ---DATA-- -return array('foo' => 'foo') ---EXPECT-- -foo0foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test deleted file mode 100644 index ff7c8bb..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -error in twig extension ---TEMPLATE-- -{{ object.region is not null ? object.regionChoices[object.region] }} ---DATA-- -class House -{ - const REGION_S = 1; - const REGION_P = 2; - - public static $regionChoices = array(self::REGION_S => 'house.region.s', self::REGION_P => 'house.region.p'); - - public function getRegionChoices() - { - return self::$regionChoices; - } -} - -$object = new House(); -$object->region = 1; -return array('object' => $object) ---EXPECT-- -house.region.s diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test deleted file mode 100644 index 269a305..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig allows multi-word tests without a custom node class ---TEMPLATE-- -{{ 'foo' is multi word ? 'yes' : 'no' }} -{{ 'foo bar' is multi word ? 'yes' : 'no' }} ---DATA-- -return array() ---EXPECT-- -no -yes diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test deleted file mode 100644 index 60c3c51..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Twig is able to deal with SimpleXMLElement instances as variables ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -Hello '{{ images.image.0.group }}'! -{{ images.image.0.group.attributes.myattr }} -{{ images.children().image.count() }} -{% for image in images %} - - {{ image.group }} -{% endfor %} ---DATA-- -return array('images' => new SimpleXMLElement('foobar')) ---EXPECT-- -Hello 'foo'! -example -2 - - foo - - bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test deleted file mode 100644 index e18e110..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not confuse strings with integers in getAttribute() ---TEMPLATE-- -{{ hash['2e2'] }} ---DATA-- -return array('hash' => array('2e2' => 'works')) ---EXPECT-- -works diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test deleted file mode 100644 index 2f6a3e1..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on its children ---TEMPLATE-- -{% autoescape %} -{{ var }}
    -{% endautoescape %} -{% autoescape 'html' %} -{{ var }}
    -{% endautoescape %} -{% autoescape false %} -{{ var }}
    -{% endautoescape %} -{% autoescape true %} -{{ var }}
    -{% endautoescape %} -{% autoescape false %} -{{ var }}
    -{% endautoescape %} ---DATA-- -return array('var' => '
    ') ---EXPECT-- -<br />
    -<br />
    -

    -<br />
    -

    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test deleted file mode 100644 index 05ab83c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on embedded blocks ---TEMPLATE-- -{% autoescape 'html' %} - {% block foo %} - {{ var }} - {% endblock %} -{% endautoescape %} ---DATA-- -return array('var' => '
    ') ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test deleted file mode 100644 index 9c09724..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not double-escape ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|escape }} -{% endautoescape %} ---DATA-- -return array('var' => '
    ') ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test deleted file mode 100644 index ce7ea78..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling functions ---TEMPLATE-- - -autoescape false -{% autoescape false %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -{% endautoescape %} - -autoescape 'html' -{% autoescape 'html' %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -unsafe_br()|raw -{{ (unsafe_br())|raw }} - -safe_br()|escape -{{ (safe_br())|escape }} - -safe_br()|raw -{{ (safe_br())|raw }} - -unsafe_br()|escape -{{ (unsafe_br())|escape }} - -{% endautoescape %} - -autoescape js -{% autoescape 'js' %} - -safe_br -{{ safe_br() }} - -{% endautoescape %} ---DATA-- -return array() ---EXPECT-- - -autoescape false - -safe_br -
    - -unsafe_br -
    - - -autoescape 'html' - -safe_br -
    - -unsafe_br -<br /> - -unsafe_br()|raw -
    - -safe_br()|escape -<br /> - -safe_br()|raw -
    - -unsafe_br()|escape -<br /> - - -autoescape js - -safe_br -\x3Cbr\x20\x2F\x3E diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test deleted file mode 100644 index e389d4d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -"autoescape" tag does not apply escaping on literals ---TEMPLATE-- -{% autoescape 'html' %} - -1. Simple literal -{{ "
    " }} - -2. Conditional expression with only literals -{{ true ? "
    " : "
    " }} - -3. Conditional expression with a variable -{{ true ? "
    " : someVar }} - -4. Nested conditionals with only literals -{{ true ? (true ? "
    " : "
    ") : "\n" }} - -5. Nested conditionals with a variable -{{ true ? (true ? "
    " : someVar) : "\n" }} - -6. Nested conditionals with a variable marked safe -{{ true ? (true ? "
    " : someVar|raw) : "\n" }} - -{% endautoescape %} ---DATA-- -return array() ---EXPECT-- - -1. Simple literal -
    - -2. Conditional expression with only literals -
    - -3. Conditional expression with a variable -<br /> - -4. Nested conditionals with only literals -
    - -5. Nested conditionals with a variable -<br /> - -6. Nested conditionals with a variable marked safe -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test deleted file mode 100644 index 798e6fe..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tags can be nested at will ---TEMPLATE-- -{{ var }} -{% autoescape 'html' %} - {{ var }} - {% autoescape false %} - {{ var }} - {% autoescape 'html' %} - {{ var }} - {% endautoescape %} - {{ var }} - {% endautoescape %} - {{ var }} -{% endautoescape %} -{{ var }} ---DATA-- -return array('var' => '
    ') ---EXPECT-- -<br /> - <br /> -
    - <br /> -
    - <br /> -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test deleted file mode 100644 index e896aa4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping to object method calls ---TEMPLATE-- -{% autoescape 'html' %} -{{ user.name }} -{{ user.name|lower }} -{{ user }} -{% endautoescape %} ---DATA-- -class UserForAutoEscapeTest -{ - public function getName() - { - return 'Fabien
    '; - } - - public function __toString() - { - return 'Fabien
    '; - } -} -return array('user' => new UserForAutoEscapeTest()) ---EXPECT-- -Fabien<br /> -fabien<br /> -Fabien<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test deleted file mode 100644 index 9f1cedd..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not escape when raw is used as a filter ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|raw }} -{% endautoescape %} ---DATA-- -return array('var' => '
    ') ---EXPECT-- -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test deleted file mode 100644 index bbf1356..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"autoescape" tag accepts an escaping strategy ---TEMPLATE-- -{% autoescape true js %}{{ var }}{% endautoescape %} - -{% autoescape true html %}{{ var }}{% endautoescape %} ---DATA-- -return array('var' => '
    "') ---EXPECT-- -\x3Cbr\x20\x2F\x3E\x22 -<br />" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test deleted file mode 100644 index e496f60..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"autoescape" tag accepts an escaping strategy ---TEMPLATE-- -{% autoescape 'js' %}{{ var }}{% endautoescape %} - -{% autoescape 'html' %}{{ var }}{% endautoescape %} ---DATA-- -return array('var' => '
    "') ---EXPECT-- -\x3Cbr\x20\x2F\x3E\x22 -<br />" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test deleted file mode 100644 index 4f41520..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -escape types ---TEMPLATE-- - -1. autoescape 'html' |escape('js') - -{% autoescape 'html' %} - -{% endautoescape %} - -2. autoescape 'html' |escape('js') - -{% autoescape 'html' %} - -{% endautoescape %} - -3. autoescape 'js' |escape('js') - -{% autoescape 'js' %} - -{% endautoescape %} - -4. no escape - -{% autoescape false %} - -{% endautoescape %} - -5. |escape('js')|escape('html') - -{% autoescape false %} - -{% endautoescape %} - -6. autoescape 'html' |escape('js')|escape('html') - -{% autoescape 'html' %} - -{% endautoescape %} - ---DATA-- -return array('msg' => "<>\n'\"") ---EXPECT-- - -1. autoescape 'html' |escape('js') - - - -2. autoescape 'html' |escape('js') - - - -3. autoescape 'js' |escape('js') - - - -4. no escape - - - -5. |escape('js')|escape('html') - - - -6. autoescape 'html' |escape('js')|escape('html') - - - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test deleted file mode 100644 index 7821a9a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters ---TEMPLATE-- -{% autoescape 'html' %} - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -{{ var|escape_and_nl2br }} - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -{{ var|escape_and_nl2br|raw }} - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -{{ var|escape_and_nl2br|escape }} - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -{{ var|upper }} - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -{{ var|escape_and_nl2br|upper }} - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -{{ var|upper|escape_and_nl2br }} - -7. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - the output is auto-escaped ) -{{ "%s"|format(var) }} - -8. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - |raw is redundant, - the output is auto-escaped ) -{{ "%s"|raw|format(var) }} - -9. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end ) -{{ "%s"|format(var)|raw }} - -10. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) -{{ "%s"|format(var|raw)|raw }} - -{% endautoescape %} ---DATA-- -return array('var' => "\nTwig") ---EXPECT-- - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -<Fabien>
    -Twig - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -<Fabien>
    -Twig - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -&lt;Fabien&gt;<br /> -Twig - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -<FABIEN> -TWIG - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -&LT;FABIEN&GT;<BR /> -TWIG - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -<FABIEN>
    -TWIG - -7. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -8. Escape if last filter is not an escaper -( the output of |format is "" ~ var ~ "", - |raw is redundant, - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -9. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end ) - -Twig - -10. Don't escape escaper filter output -( the output of |format is "" ~ var ~ "", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) - -Twig diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test deleted file mode 100644 index f58a1e0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"autoescape" tag do not applies escaping on filter arguments ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|nl2br("
    ") }} -{{ var|nl2br("
    "|escape) }} -{{ var|nl2br(sep) }} -{{ var|nl2br(sep|raw) }} -{{ var|nl2br(sep|escape) }} -{% endautoescape %} ---DATA-- -return array('var' => "\nTwig", 'sep' => '
    ') ---EXPECT-- -<Fabien>
    -Twig -<Fabien><br /> -Twig -<Fabien>
    -Twig -<Fabien>
    -Twig -<Fabien><br /> -Twig diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test deleted file mode 100644 index 134c77e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters ---TEMPLATE-- -{% autoescape 'html' %} - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -{{ var|nl2br }} - -2. Don't double-pre-escape -( var|escape|nl2br ) -{{ var|escape|nl2br }} - -3. Don't escape safe values -( var|raw|nl2br ) -{{ var|raw|nl2br }} - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -{{ var|nl2br|nl2br }} - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -{{ var|escape_something|nl2br }} - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -{{ var|nl2br|upper }} - -{% endautoescape %} ---DATA-- -return array('var' => "\nTwig") ---EXPECT-- - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -<Fabien>
    -Twig - -2. Don't double-pre-escape -( var|escape|nl2br ) -<Fabien>
    -Twig - -3. Don't escape safe values -( var|raw|nl2br ) -
    -Twig - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -<Fabien>

    -Twig - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -<FABIEN>
    -TWIG - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -&LT;FABIEN&GT;<BR /> -TWIG - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test deleted file mode 100644 index 32d3943..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"autoescape" tag handles filters preserving the safety ---TEMPLATE-- -{% autoescape 'html' %} - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -{{ var|preserves_safety }} - -2. Safe values are still safe -( var|escape|preserves_safety ) -{{ var|escape|preserves_safety }} - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -{{ var|escape_something|preserves_safety }} - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }} - -{% endautoescape %} ---DATA-- -return array('var' => "\nTwig") ---EXPECT-- - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -<FABIEN> -TWIG - -2. Safe values are still safe -( var|escape|preserves_safety ) -<FABIEN> -TWIG - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -<FABIEN> -TWIG - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -&LT;FABPOT&GT; -TWIG - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test deleted file mode 100644 index 360dcf0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block title1 %}FOO{% endblock %} -{% block title2 foo|lower %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return array('foo' => 'bar') ---EXPECT-- -FOObar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test deleted file mode 100644 index 5c205c0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - {% block content %} - {% endblock %} -{% endblock %} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test deleted file mode 100644 index be17fed..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"§" special chars in a block name ---TEMPLATE-- -{% block § %} -§ -{% endblock § %} ---DATA-- -return array() ---EXPECT-- -§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test deleted file mode 100644 index f44296e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return array() ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test deleted file mode 100644 index 71ab2e0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE(index.twig)-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ nothing }} - {% endblock %} -{% endembed %} -BAR ---TEMPLATE(foo.twig)-- -{% block c1 %}{% endblock %} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test deleted file mode 100644 index da161e6..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return array() ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test deleted file mode 100644 index 81563dc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} - - {% endblock %} -{% endembed %} ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return array() ---EXPECT-- -A - block1 - - -A - block1 - - block1extended - B - block2 -C - B - block2 -C diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test deleted file mode 100644 index cf7953d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block c1 %} - {{ parent() }} - blockc1baseextended -{% endblock %} - -{% block c2 %} - {{ parent() }} - - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} -{% endblock %} ---TEMPLATE(base.twig)-- -A -{% block c1 %} - blockc1base -{% endblock %} -{% block c2 %} - blockc2base -{% endblock %} -B ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return array() ---EXPECT-- -A - blockc1base - - blockc1baseextended - blockc2base - - - -A - block1 - - block1extended - B - block2 -CB \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test deleted file mode 100644 index 82094f2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---TEMPLATE-- -{% filter upper %} -Some text with a {{ var }} -{% endfilter %} ---DATA-- -return array('var' => 'var') ---EXPECT-- -SOME TEXT WITH A VAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test deleted file mode 100644 index 3e7148b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---TEMPLATE-- -{% filter json_encode|raw %}test{% endfilter %} ---DATA-- -return array() ---EXPECT-- -"test" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test deleted file mode 100644 index 75512ef..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"filter" tags accept multiple chained filters ---TEMPLATE-- -{% filter lower|title %} - {{ var }} -{% endfilter %} ---DATA-- -return array('var' => 'VAR') ---EXPECT-- - Var diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test deleted file mode 100644 index 7e4e4eb..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"filter" tags can be nested at will ---TEMPLATE-- -{% filter lower|title %} - {{ var }} - {% filter upper %} - {{ var }} - {% endfilter %} - {{ var }} -{% endfilter %} ---DATA-- -return array('var' => 'var') ---EXPECT-- - Var - Var - Var diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test deleted file mode 100644 index 22745ea..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "for" tags ---TEMPLATE-- -{% filter upper %} -{% for item in items %} -{{ item }} -{% endfor %} -{% endfilter %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- -A -B diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test deleted file mode 100644 index afd95b2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "if" tags ---TEMPLATE-- -{% filter upper %} -{% if items %} -{{ items|join(', ') }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% else %} -{{ items.1 }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% elseif items.1 %} -{{ items.0 }} -{% endif %} - -{% endfilter %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- -A, B - -B - -A diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test deleted file mode 100644 index 380531f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"for" tag takes a condition ---TEMPLATE-- -{% for i in 1..5 if i is odd -%} - {{ loop.index }}.{{ i }}{{ foo.bar }} -{% endfor %} ---DATA-- -return array('foo' => array('bar' => 'X')) ---CONFIG-- -return array('strict_variables' => false) ---EXPECT-- -1.1X -2.3X -3.5X diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test deleted file mode 100644 index ddc6930..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tag keeps the context safe ---TEMPLATE-- -{% for item in items %} - {% for item in items %} - * {{ item }} - {% endfor %} - * {{ item }} -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- - * a - * b - * a - * a - * b - * b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test deleted file mode 100644 index 20ccc88..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% else %} - no item -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- - * a - * b ---DATA-- -return array('items' => array()) ---EXPECT-- - no item ---DATA-- -return array() ---CONFIG-- -return array('strict_variables' => false) ---EXPECT-- - no item diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test deleted file mode 100644 index 49fb9ca..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag does not reset inner variables ---TEMPLATE-- -{% for i in 1..2 %} - {% for j in 0..2 %} - {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }} - {% endfor %} -{% endfor %} ---DATA-- -return array('k' => 0) ---EXPECT-- - 0 1 - 1 1 - 2 1 - 3 2 - 4 2 - 5 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test deleted file mode 100644 index 4e22cb4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys ---TEMPLATE-- -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- - * 0 - * 1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test deleted file mode 100644 index 4c21168..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys and values ---TEMPLATE-- -{% for key, item in items %} - * {{ key }}/{{ item }} -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- - * 0/a - * 1/b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test deleted file mode 100644 index 93bc76a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context ---TEMPLATE-- -{% for item in items %} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- - * 1/0 - * 2/1 - * 1//2 - - * 2/1 - * 1/0 - * /1/2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test deleted file mode 100644 index 58af2c3..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context locally ---TEMPLATE-- -{% for item in items %} -{% endfor %} -{% if loop is not defined %}WORKS{% endif %} ---DATA-- -return array('items' => array()) ---EXPECT-- -WORKS diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test deleted file mode 100644 index 4301ef2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if i > 0 %} - {{ loop.last }} -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXCEPTION-- -Twig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test deleted file mode 100644 index c7e723a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if loop.last > 0 %} -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXCEPTION-- -Twig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test deleted file mode 100644 index f8b9f6b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - {% for item in items1 %} - * {{ item }} - {% else %} - no {{ item }} - {% endfor %} -{% else %} - no item1 -{% endfor %} ---DATA-- -return array('items' => array('a', 'b'), 'items1' => array()) ---EXPECT-- -no a - no b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test deleted file mode 100644 index 5034437..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -"for" tag iterates over iterable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.first }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIterator implements Iterator -{ - protected $values = array('foo' => 'bar', 'bar' => 'foo'); - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } -} -return array('items' => new ItemsIterator()) ---EXPECT-- - * bar - * 1/0 - * 1 - - * foo - * 2/1 - * - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test deleted file mode 100644 index 4a1ff61..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -"for" tag iterates over iterable and countable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIteratorCountable implements Iterator, Countable -{ - protected $values = array('foo' => 'bar', 'bar' => 'foo'); - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } - public function count() { return count($this->values); } -} -return array('items' => new ItemsIteratorCountable()) ---EXPECT-- - * bar - * 1/0 - * 2/1 - * 1//2 - - * foo - * 2/1 - * 1/0 - * /1/2 - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test deleted file mode 100644 index 17b2e22..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tags can be nested ---TEMPLATE-- -{% for key, item in items %} -* {{ key }} ({{ loop.length }}): -{% for value in item %} - * {{ value }} ({{ loop.length }}) -{% endfor %} -{% endfor %} ---DATA-- -return array('items' => array('a' => array('a1', 'a2', 'a3'), 'b' => array('b1'))) ---EXPECT-- -* a (2): - * a1 (3) - * a2 (3) - * a3 (3) -* b (2): - * b1 (1) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test deleted file mode 100644 index 82f2ae8..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag iterates over item values ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% endfor %} ---DATA-- -return array('items' => array('a', 'b')) ---EXPECT-- - * a - * b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test deleted file mode 100644 index 5f5da0e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -global variables ---TEMPLATE-- -{% include "included.twig" %} -{% from "included.twig" import foobar %} -{{ foobar() }} ---TEMPLATE(included.twig)-- -{% macro foobar() %} -called foobar -{% endmacro %} ---DATA-- -return array(); ---EXPECT-- -called foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test deleted file mode 100644 index c1c3d27..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" creates a condition ---TEMPLATE-- -{% if a is defined %} - {{ a }} -{% elseif b is defined %} - {{ b }} -{% else %} - NOTHING -{% endif %} ---DATA-- -return array('a' => 'a') ---EXPECT-- - a ---DATA-- -return array('b' => 'b') ---EXPECT-- - b ---DATA-- -return array() ---EXPECT-- - NOTHING diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test deleted file mode 100644 index edfb73d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" takes an expression as a test ---TEMPLATE-- -{% if a < 2 %} - A1 -{% elseif a > 10 %} - A2 -{% else %} - A3 -{% endif %} ---DATA-- -return array('a' => 1) ---EXPECT-- - A1 ---DATA-- -return array('a' => 12) ---EXPECT-- - A2 ---DATA-- -return array('a' => 7) ---EXPECT-- - A3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test deleted file mode 100644 index 8fe1a6c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -FOO -{% include "foo.twig" %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return array() ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test deleted file mode 100644 index eaeeb11..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag allows expressions for the template to include ---TEMPLATE-- -FOO -{% include foo %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return array('foo' => 'foo.twig') ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test deleted file mode 100644 index 24aed06..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] ignore missing %} -{% include "foo.twig" ignore missing %} -{% include "foo.twig" ignore missing with {} %} -{% include "foo.twig" ignore missing with {} only %} ---DATA-- -return array() ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test deleted file mode 100644 index f25e871..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include "foo.twig" %} ---DATA-- -return array(); ---EXCEPTION-- -Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test deleted file mode 100644 index 86c1864..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {% include "foo.twig" %} -{% endblock %} ---DATA-- -return array(); ---EXCEPTION-- -Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test deleted file mode 100644 index 77760a0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag accept variables and only ---TEMPLATE-- -{% include "foo.twig" %} -{% include "foo.twig" only %} -{% include "foo.twig" with {'foo1': 'bar'} %} -{% include "foo.twig" with {'foo1': 'bar'} only %} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return array('foo' => 'bar') ---EXPECT-- -foo,global,_parent, -global,_parent, -foo,global,foo1,_parent, -foo1,global,_parent, diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test deleted file mode 100644 index 6ba064a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag accepts Twig_Template instance ---TEMPLATE-- -{% include foo %} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return array('foo' => $twig->loadTemplate('foo.twig')) ---EXPECT-- -BAR FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test deleted file mode 100644 index ab670ee..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] %} -{% include ["bar.twig", "foo.twig"] %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return array() ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test deleted file mode 100644 index 41384ac..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" tag accept variables ---TEMPLATE-- -{% include "foo.twig" with {'foo': 'bar'} %} -{% include "foo.twig" with vars %} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return array('vars' => array('foo' => 'bar')) ---EXPECT-- -bar -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test deleted file mode 100644 index 0778a4b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return array() ---EXPECT-- -FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test deleted file mode 100644 index 9a81499..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -block_expr ---TEMPLATE-- -{% extends "base.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base.twig)-- -{% spaceless %} -{% block element -%} -
    - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} -
    -{%- endblock %} -{% endspaceless %} ---DATA-- -return array( - 'item' => array( - 'children' => array( - null, - null, - ) - ) -) ---EXPECT-- -Element:
    Element:
    Element:
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test deleted file mode 100644 index 3e868c0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -block_expr2 ---TEMPLATE-- -{% extends "base2.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base2.twig)-- -{% extends "base.twig" %} ---TEMPLATE(base.twig)-- -{% spaceless %} -{% block element -%} -
    - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} -
    -{%- endblock %} -{% endspaceless %} ---DATA-- -return array( - 'item' => array( - 'children' => array( - null, - null, - ) - ) -) ---EXPECT-- -Element:
    Element:
    Element:
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test deleted file mode 100644 index 8576e77..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends standalone ? foo : 'bar.twig' %} - -{% block content %}{{ parent() }}FOO{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---TEMPLATE(bar.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return array('foo' => 'foo.twig', 'standalone' => true) ---EXPECT-- -FOOFOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test deleted file mode 100644 index ee06ddc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return array('foo' => 'foo.twig') ---EXPECT-- -FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test deleted file mode 100644 index 784f357..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---DATA-- -return array() ---EXPECT-- -FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test deleted file mode 100644 index a1cb1ce..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["foo.twig", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return array() ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test deleted file mode 100644 index acc74f6..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return array() ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test deleted file mode 100644 index cfa648d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends [null, "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return array() ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test deleted file mode 100644 index dfc2b6c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}base {% endblock %} ---DATA-- -return array() ---EXPECT-- -base layout index diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test deleted file mode 100644 index 1d3e639..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% set foo = 1 %} -{{ include('parent.twig') }} -{{ include('parent.twig') }} -{% set foo = 2 %} -{{ include('parent.twig') }} ---TEMPLATE(parent.twig)-- -{% extends foo~'_parent.twig' %}{% block content %}{{ parent() }} parent{% endblock %} ---TEMPLATE(1_parent.twig)-- -{% block content %}1{% endblock %} ---TEMPLATE(2_parent.twig)-- -{% block content %}2{% endblock %} ---DATA-- -return array() ---EXPECT-- -1 parent - -1 parent - -2 parent diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test deleted file mode 100644 index faca925..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block subcontent %} - {% block subsubcontent %} - SUBSUBCONTENT - {% endblock %} - {% endblock %} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - {% block subcontent %} - SUBCONTENT - {% endblock %} -{% endblock %} ---DATA-- -return array() ---EXPECT-- -SUBSUBCONTENT diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test deleted file mode 100644 index 0ad11d0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - CONTENT - {%- block subcontent -%} - SUBCONTENT - {%- endblock -%} - ENDCONTENT -{% endblock %} ---TEMPLATE(foo.twig)-- ---DATA-- -return array() ---EXPECT-- -CONTENTSUBCONTENTENDCONTENT diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test deleted file mode 100644 index 71e3cdf..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %} -{% block inside %}INSIDE{% endblock inside %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %} -{% block body %} - {% block inside '' %} -{% endblock body %} ---TEMPLATE(base.twig)-- -{% block body '' %} ---DATA-- -return array() ---EXPECT-- -INSIDE diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test deleted file mode 100644 index 4f975db..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return array() ---EXPECT-- -BARFOOBAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test deleted file mode 100644 index a8bc90c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo ? 'foo.twig' : 'bar.twig' %} ---TEMPLATE(foo.twig)-- -FOO ---TEMPLATE(bar.twig)-- -BAR ---DATA-- -return array('foo' => true) ---EXPECT-- -FOO ---DATA-- -return array('foo' => false) ---EXPECT-- -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test deleted file mode 100644 index c9e86b1..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% block content %} - {% extends "foo.twig" %} -{% endblock %} ---EXCEPTION-- -Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test deleted file mode 100644 index 6281671..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "base.twig" %} -{% block content %}{% include "included.twig" %}{% endblock %} - -{% block footer %}Footer{% endblock %} ---TEMPLATE(included.twig)-- -{% extends "base.twig" %} -{% block content %}Included Content{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}Default Content{% endblock %} - -{% block footer %}Default Footer{% endblock %} ---DATA-- -return array() ---EXPECT-- -Included Content -Default Footer -Footer diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test deleted file mode 100644 index 71e7c20..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block inside %} - INSIDE OVERRIDDEN - {% endblock %} - - BEFORE - {{ parent() }} - AFTER -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - BAR -{% endblock %} ---DATA-- -return array() ---EXPECT-- - -INSIDE OVERRIDDEN - - BEFORE - BAR - - AFTER diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test deleted file mode 100644 index a9eaa4c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% block content %} - {{ parent() }} -{% endblock %} ---EXCEPTION-- -Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test deleted file mode 100644 index 63c7305..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% use 'foo.twig' %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return array() ---EXPECT-- -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test deleted file mode 100644 index d1876a5..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag accepts Twig_Template instance ---TEMPLATE-- -{% extends foo %} - -{% block content %} -{{ parent() }}FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return array('foo' => $twig->loadTemplate('foo.twig')) ---EXPECT-- -BARFOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test deleted file mode 100644 index 8f9ece7..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -"parent" function ---TEMPLATE-- -{% extends "parent.twig" %} - -{% use "use1.twig" %} -{% use "use2.twig" %} - -{% block content_parent %} - {{ parent() }} -{% endblock %} - -{% block content_use1 %} - {{ parent() }} -{% endblock %} - -{% block content_use2 %} - {{ parent() }} -{% endblock %} - -{% block content %} - {{ block('content_use1_only') }} - {{ block('content_use2_only') }} -{% endblock %} ---TEMPLATE(parent.twig)-- -{% block content_parent 'content_parent' %} -{% block content_use1 'content_parent' %} -{% block content_use2 'content_parent' %} -{% block content '' %} ---TEMPLATE(use1.twig)-- -{% block content_use1 'content_use1' %} -{% block content_use2 'content_use1' %} -{% block content_use1_only 'content_use1_only' %} ---TEMPLATE(use2.twig)-- -{% block content_use2 'content_use2' %} -{% block content_use2_only 'content_use2_only' %} ---DATA-- -return array() ---EXPECT-- - content_parent - content_use1 - content_use2 - content_use1_only - content_use2_only diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test deleted file mode 100644 index eef0c10..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.input('username') }} -{{ macros.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return array() ---EXPECT-- - - - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test deleted file mode 100644 index ae6203b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"macro" tag supports name for endmacro ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo() }} -{{ macros.bar() }} - -{% macro foo() %}foo{% endmacro %} -{% macro bar() %}bar{% endmacro bar %} ---DATA-- -return array() ---EXPECT-- -foo -bar - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test deleted file mode 100644 index 5cd3dae..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import 'forms.twig' as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} ---TEMPLATE(forms.twig)-- -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return array() ---EXPECT-- - - - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test deleted file mode 100644 index 205f591..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} -{% from 'forms.twig' import foo as foobar, bar %} - -{{ foo('foo') }} -{{ foobar('foo') }} -{{ bar('foo') }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}foo{{ name }}{% endmacro %} -{% macro bar(name) %}bar{{ name }}{% endmacro %} ---DATA-- -return array() ---EXPECT-- -foofoo -foofoo -barfoo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test deleted file mode 100644 index 6df4f5d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"from" tag with reserved name ---TEMPLATE-- -{% from 'forms.twig' import templateName %} ---TEMPLATE(forms.twig)-- ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Syntax: "templateName" cannot be an imported macro as it is a reserved keyword in "index.twig" at line 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test deleted file mode 100644 index 6b37176..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} - -{{ foo('foo') }} -{{ foo() }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %} ---DATA-- -return array() ---EXPECT-- -fooglobal -fooglobal diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_nam.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_nam.test deleted file mode 100644 index e5aa749..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_nam.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"from" tag with reserved name ---TEMPLATE-- -{% import 'forms.twig' as macros %} - -{{ macros.parent() }} ---TEMPLATE(forms.twig)-- ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Syntax: "parent" cannot be called as macro as it is a reserved keyword in "index.twig" at line 4 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test deleted file mode 100644 index a2dde5a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"macro" tag with reserved name ---TEMPLATE-- -{% macro parent(arg1, arg2) %} - parent -{% endmacro %} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Syntax: "parent" cannot be used as a macro name as it is a reserved keyword in "index.twig" at line 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test deleted file mode 100644 index 17756cb..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - -{% endmacro %} ---DATA-- -return array() ---EXPECT-- - - - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test deleted file mode 100644 index 3721770..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"§" as a macro name ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.§('foo') }} - -{% macro §(foo) %} - §{{ foo }}§ -{% endmacro %} ---DATA-- -return array() ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test deleted file mode 100644 index 5679462..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Super globals as macro arguments ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo('foo') }} - -{% macro foo(GET) %} - {{ GET }} -{% endmacro %} ---DATA-- -return array() ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test deleted file mode 100644 index 0445e85..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -{% raw %} -{{ foo }} -{% endraw %} ---DATA-- -return array() ---EXPECT-- -{{ foo }} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test deleted file mode 100644 index 2fd9fb2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -{% raw %} -{{ foo }} -{% endverbatim %} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test deleted file mode 100644 index 352bb18..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -1*** - -{%- raw %} - {{ 'bla' }} -{% endraw %} - -1*** -2*** - -{%- raw -%} - {{ 'bla' }} -{% endraw %} - -2*** -3*** - -{%- raw -%} - {{ 'bla' }} -{% endraw -%} - -3*** -4*** - -{%- raw -%} - {{ 'bla' }} -{%- endraw %} - -4*** -5*** - -{%- raw -%} - {{ 'bla' }} -{%- endraw -%} - -5*** ---DATA-- -return array() ---EXPECT-- -1*** - {{ 'bla' }} - - -1*** -2***{{ 'bla' }} - - -2*** -3***{{ 'bla' }} -3*** -4***{{ 'bla' }} - -4*** -5***{{ 'bla' }}5*** diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test deleted file mode 100644 index 683c59a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - a -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test deleted file mode 100644 index 3dcfa88..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - - {% if 1 %} - {%- include "foo.twig" %} - {% endif %} -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test deleted file mode 100644 index de20f3d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %} - {%- include "foo.twig" %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %}{% include "foo.twig" %}{% endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return array() ---EXPECT-- -foo -foo -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test deleted file mode 100644 index a5a9f83..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo = 'foo' %} -{% set bar = 'foo
    ' %} - -{{ foo }} -{{ bar }} - -{% set foo, bar = 'foo', 'bar' %} - -{{ foo }}{{ bar }} ---DATA-- -return array() ---EXPECT-- -foo -foo<br /> - - -foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test deleted file mode 100644 index ec657f0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"set" tag block empty capture ---TEMPLATE-- -{% set foo %}{% endset %} - -{% if foo %}FAIL{% endif %} ---DATA-- -return array() ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test deleted file mode 100644 index f156a1a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"set" tag block capture ---TEMPLATE-- -{% set foo %}f
    o
    o{% endset %} - -{{ foo }} ---DATA-- -return array() ---EXPECT-- -f
    o
    o diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test deleted file mode 100644 index 8ff434a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %} - -{{ foo }} -{{ bar }} ---DATA-- -return array() ---EXPECT-- -foobar -barfoo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test deleted file mode 100644 index dd06dec..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"spaceless" tag removes whites between HTML tags ---TEMPLATE-- -{% spaceless %} - -
    foo
    - -{% endspaceless %} ---DATA-- -return array() ---EXPECT-- -
    foo
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test deleted file mode 100644 index 789b4ba..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom tag ---TEMPLATE-- -{% § %} ---DATA-- -return array() ---EXPECT-- -§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test deleted file mode 100644 index 1d2273f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Whitespace trimming on tags. ---TEMPLATE-- -{{ 5 * '{#-'|length }} -{{ '{{-'|length * 5 + '{%-'|length }} - -Trim on control tag: -{% for i in range(1, 9) -%} - {{ i }} -{%- endfor %} - - -Trim on output tag: -{% for i in range(1, 9) %} - {{- i -}} -{% endfor %} - - -Trim comments: - -{#- Invisible -#} - -After the comment. - -Trim leading space: -{% if leading %} - - {{- leading }} -{% endif %} - -{%- if leading %} - {{- leading }} - -{%- endif %} - - -Trim trailing space: -{% if trailing -%} - {{ trailing -}} - -{% endif -%} - -Combined: - -{%- if both -%} -
      -
    • {{- both -}}
    • -
    - -{%- endif -%} - -end ---DATA-- -return array('leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both') ---EXPECT-- -15 -18 - -Trim on control tag: -123456789 - -Trim on output tag: -123456789 - -Trim comments:After the comment. - -Trim leading space: -leading space -leading space - -Trim trailing space: -trailing spaceCombined:
      -
    • both
    • -
    end diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test deleted file mode 100644 index f887006..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" with content as foo %} - -{{ block('foo') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return array() ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test deleted file mode 100644 index 7364d76..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" %} - -{{ block('content') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return array() ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test deleted file mode 100644 index b551a1e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} - -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return array() ---EXPECT-- -foo -foo -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test deleted file mode 100644 index 05cca68..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} ---TEMPLATE(bar.twig)-- ---DATA-- -return array() ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test deleted file mode 100644 index 6368b08d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% use "ancestor.twig" %} - -{% block sub_container %} -
    overriden sub_container
    -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} -
    {{ block('sub_container') }}
    -{% endblock %} - -{% block sub_container %} -
    sub_container
    -{% endblock %} ---DATA-- -return array() ---EXPECT-- -
    overriden sub_container
    -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test deleted file mode 100644 index 114e301..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "ancestor.twig" %} -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% block sub_container %} -
    overriden sub_container
    -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} -
    {{ block('sub_container') }}
    -{% endblock %} - -{% block sub_container %} -
    sub_container
    -{% endblock %} ---DATA-- -return array() ---EXPECT-- -
    overriden sub_container
    -
    diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test deleted file mode 100644 index 198be0c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return array() ---EXPECT-- -bar -foo -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test deleted file mode 100644 index 8de871a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" with content as foo_content %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} -{{ block('foo_content') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return array() ---EXPECT-- -bar -foo -bar -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test deleted file mode 100644 index 59db23d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' with foobar as base_base_foobar %} -{% block foobar %} - {{- block('base_base_foobar') -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' with foobar as base_foobar %} -{% block foobar %} - {{- block('base_foobar') -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return array() ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test deleted file mode 100644 index d3f302d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig'%} -{% block foobar %} - {{- parent() -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foobar %} - {{- parent() -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return array() ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test deleted file mode 100644 index 95b55a4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' %} -{% use 'file1.html.twig' with foo %} -{% block foo %} - {{- parent() -}} - Content of foo (second override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (second override) -{% endblock bar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foo %} - {{- parent() -}} - Content of foo (first override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (first override) -{% endblock bar %} ---TEMPLATE(file1.html.twig)-- -{% block foo -%} - Content of foo -{% endblock foo %} -{% block bar -%} - Content of bar -{% endblock bar %} ---DATA-- -return array() ---EXPECT-- -Content of foo -Content of foo (first override) -Content of foo (second override) -Content of bar -Content of bar (second override) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test deleted file mode 100644 index a95be55..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -{% verbatim %} -{{ foo }} -{% endverbatim %} ---DATA-- -return array() ---EXPECT-- -{{ foo }} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test deleted file mode 100644 index 941dddc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -{% verbatim %} -{{ foo }} -{% endraw %} ---DATA-- -return array() ---EXCEPTION-- -Twig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test deleted file mode 100644 index eb61044..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -1*** - -{%- verbatim %} - {{ 'bla' }} -{% endverbatim %} - -1*** -2*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim %} - -2*** -3*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim -%} - -3*** -4*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim %} - -4*** -5*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim -%} - -5*** ---DATA-- -return array() ---EXPECT-- -1*** - {{ 'bla' }} - - -1*** -2***{{ 'bla' }} - - -2*** -3***{{ 'bla' }} -3*** -4***{{ 'bla' }} - -4*** -5***{{ 'bla' }}5*** diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test deleted file mode 100644 index 1429d37..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -array index test ---TEMPLATE-- -{% for key, value in days %} -{{ key }} -{% endfor %} ---DATA-- -return array('days' => array( - 1 => array('money' => 9), - 2 => array('money' => 21), - 3 => array('money' => 38), - 4 => array('money' => 6), - 18 => array('money' => 6), - 19 => array('money' => 3), - 31 => array('money' => 11), -)); ---EXPECT-- -1 -2 -3 -4 -18 -19 -31 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test deleted file mode 100644 index 60218ac..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"const" test ---TEMPLATE-- -{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }} -{{ 'bar' is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ value is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }} ---DATA-- -return array('value' => 'bar', 'object' => new ArrayObject(array('hi'))); ---EXPECT-- -ok -ok -ok -ok \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test deleted file mode 100644 index cbfe03d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -"defined" test ---TEMPLATE-- -{{ definedVar is defined ? 'ok' : 'ko' }} -{{ definedVar is not defined ? 'ko' : 'ok' }} -{{ undefinedVar is defined ? 'ko' : 'ok' }} -{{ undefinedVar is not defined ? 'ok' : 'ko' }} -{{ zeroVar is defined ? 'ok' : 'ko' }} -{{ nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is defined ? 'ok' : 'ko' }} -{{ nested['definedVar'] is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is not defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is defined ? 'ko' : 'ok' }} -{{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is not defined ? 'ok' : 'ko' }} -{{ nested.zeroVar is defined ? 'ok' : 'ko' }} -{{ nested.nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedArray.0 is defined ? 'ok' : 'ko' }} -{{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }} -{{ object.foo is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.getFoo() is defined ? 'ok' : 'ko' }} -{{ object.getFoo('a') is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod() is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }} -{{ object.self.foo is defined ? 'ok' : 'ko' }} -{{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }} ---DATA-- -return array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => array(0), - ), - 'object' => new TwigTestFoo(), -); ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok ---DATA-- -return array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => array( - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => array(0), - ), - 'object' => new TwigTestFoo(), -); ---CONFIG-- -return array('strict_variables' => false) ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test deleted file mode 100644 index a776d03..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -"empty" test ---TEMPLATE-- -{{ foo is empty ? 'ok' : 'ko' }} -{{ bar is empty ? 'ok' : 'ko' }} -{{ foobar is empty ? 'ok' : 'ko' }} -{{ array is empty ? 'ok' : 'ko' }} -{{ zero is empty ? 'ok' : 'ko' }} -{{ string is empty ? 'ok' : 'ko' }} -{{ countable_empty is empty ? 'ok' : 'ko' }} -{{ countable_not_empty is empty ? 'ok' : 'ko' }} -{{ markup_empty is empty ? 'ok' : 'ko' }} -{{ markup_not_empty is empty ? 'ok' : 'ko' }} ---DATA-- - -class CountableStub implements Countable -{ - private $items; - - public function __construct(array $items) - { - $this->items = $items; - } - - public function count() - { - return count($this->items); - } -} -return array( - 'foo' => '', 'bar' => null, 'foobar' => false, 'array' => array(), 'zero' => 0, 'string' => '0', - 'countable_empty' => new CountableStub(array()), 'countable_not_empty' => new CountableStub(array(1, 2)), - 'markup_empty' => new Twig_Markup('', 'UTF-8'), 'markup_not_empty' => new Twig_Markup('test', 'UTF-8'), -); ---EXPECT-- -ok -ok -ok -ok -ko -ko -ok -ko -ok -ko diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test deleted file mode 100644 index 695b4c2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"even" test ---TEMPLATE-- -{{ 1 is even ? 'ko' : 'ok' }} -{{ 2 is even ? 'ok' : 'ko' }} -{{ 1 is not even ? 'ok' : 'ko' }} -{{ 2 is not even ? 'ko' : 'ok' }} ---DATA-- -return array() ---EXPECT-- -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test deleted file mode 100644 index 545f51f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test +++ /dev/null @@ -1,128 +0,0 @@ ---TEST-- -Twig supports the in operator ---TEMPLATE-- -{% if bar in foo %} -TRUE -{% endif %} -{% if not (bar in foo) %} -{% else %} -TRUE -{% endif %} -{% if bar not in foo %} -{% else %} -TRUE -{% endif %} -{% if 'a' in bar %} -TRUE -{% endif %} -{% if 'c' not in bar %} -TRUE -{% endif %} -{% if '' in bar %} -TRUE -{% endif %} -{% if '' in '' %} -TRUE -{% endif %} -{% if '0' not in '' %} -TRUE -{% endif %} -{% if 'a' not in '0' %} -TRUE -{% endif %} -{% if '0' in '0' %} -TRUE -{% endif %} - -{{ false in [0, 1] ? 'TRUE' : 'FALSE' }} -{{ true in [0, 1] ? 'TRUE' : 'FALSE' }} -{{ '0' in [0, 1] ? 'TRUE' : 'FALSE' }} -{{ '' in [0, 1] ? 'TRUE' : 'FALSE' }} -{{ 0 in ['', 1] ? 'TRUE' : 'FALSE' }} - -{{ '' in 'foo' ? 'TRUE' : 'FALSE' }} -{{ 0 in 'foo' ? 'TRUE' : 'FALSE' }} -{{ false in 'foo' ? 'TRUE' : 'FALSE' }} -{{ false in '100' ? 'TRUE' : 'FALSE' }} -{{ true in '100' ? 'TRUE' : 'FALSE' }} - -{{ [] in [true, false] ? 'TRUE' : 'FALSE' }} -{{ [] in [true, ''] ? 'TRUE' : 'FALSE' }} -{{ [] in [true, []] ? 'TRUE' : 'FALSE' }} - -{{ resource ? 'TRUE' : 'FALSE' }} -{{ resource in 'foo'~resource ? 'TRUE' : 'FALSE' }} -{{ object in 'stdClass' ? 'TRUE' : 'FALSE' }} -{{ [] in 'Array' ? 'TRUE' : 'FALSE' }} -{{ dir_object in 'foo'~dir_object ? 'TRUE' : 'FALSE' }} - -{{ ''~resource in resource ? 'TRUE' : 'FALSE' }} -{{ 'stdClass' in object ? 'TRUE' : 'FALSE' }} -{{ 'Array' in [] ? 'TRUE' : 'FALSE' }} -{{ ''~dir_object in dir_object ? 'TRUE' : 'FALSE' }} - -{{ resource in [''~resource] ? 'TRUE' : 'FALSE' }} -{{ resource in [resource + 1 - 1] ? 'TRUE' : 'FALSE' }} -{{ dir_object in [''~dir_object] ? 'TRUE' : 'FALSE' }} - -{{ 5 in 125 ? 'TRUE' : 'FALSE' }} -{{ 5 in '125' ? 'TRUE' : 'FALSE' }} -{{ '5' in 125 ? 'TRUE' : 'FALSE' }} -{{ '5' in '125' ? 'TRUE' : 'FALSE' }} - -{{ 5.5 in 125.5 ? 'TRUE' : 'FALSE' }} -{{ 5.5 in '125.5' ? 'TRUE' : 'FALSE' }} -{{ '5.5' in 125.5 ? 'TRUE' : 'FALSE' }} ---DATA-- -return array('bar' => 'bar', 'foo' => array('bar' => 'bar'), 'dir_object' => new SplFileInfo(dirname(__FILE__)), 'object' => new stdClass(), 'resource' => opendir(dirname(__FILE__))) ---EXPECT-- -TRUE -TRUE -TRUE -TRUE -TRUE -TRUE -TRUE -TRUE -TRUE -TRUE - -TRUE -TRUE -TRUE -TRUE -TRUE - -TRUE -FALSE -FALSE -FALSE -FALSE - -TRUE -FALSE -TRUE - -TRUE -FALSE -FALSE -FALSE -FALSE - -FALSE -FALSE -FALSE -FALSE - -FALSE -FALSE -FALSE - -FALSE -TRUE -FALSE -TRUE - -FALSE -TRUE -FALSE diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test deleted file mode 100644 index 8e08061..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Twig supports the in operator when using objects ---TEMPLATE-- -{% if object in object_list %} -TRUE -{% endif %} ---DATA-- -$foo = new TwigTestFoo(); -$foo1 = new TwigTestFoo(); - -$foo->position = $foo1; -$foo1->position = $foo; - -return array( - 'object' => $foo, - 'object_list' => array($foo1, $foo), -); ---EXPECT-- -TRUE diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test deleted file mode 100644 index ec52550..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"iterable" test ---TEMPLATE-- -{{ foo is iterable ? 'ok' : 'ko' }} -{{ traversable is iterable ? 'ok' : 'ko' }} -{{ obj is iterable ? 'ok' : 'ko' }} -{{ val is iterable ? 'ok' : 'ko' }} ---DATA-- -return array( - 'foo' => array(), - 'traversable' => new ArrayIterator(array()), - 'obj' => new stdClass(), - 'val' => 'test', -); ---EXPECT-- -ok -ok -ko -ko \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test deleted file mode 100644 index 1b8311e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"odd" test ---TEMPLATE-- -{{ 1 is odd ? 'ok' : 'ko' }} -{{ 2 is odd ? 'ko' : 'ok' }} ---DATA-- -return array() ---EXPECT-- -ok -ok \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php b/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php deleted file mode 100644 index 1908bcd..0000000 --- a/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php +++ /dev/null @@ -1,229 +0,0 @@ -position = 0; - } - - public function current() - { - return $this->array[$this->position]; - } - - public function key() - { - return 'a'; - } - - public function next() - { - ++$this->position; - } - - public function valid() - { - return isset($this->array[$this->position]); - } -} - -class TwigTestTokenParser_§ extends Twig_TokenParser -{ - public function parse(Twig_Token $token) - { - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node_Print(new Twig_Node_Expression_Constant('§', -1), -1); - } - - public function getTag() - { - return '§'; - } -} - -class TwigTestExtension extends Twig_Extension -{ - public function getTokenParsers() - { - return array( - new TwigTestTokenParser_§(), - ); - } - - public function getFilters() - { - return array( - new Twig_SimpleFilter('§', array($this, '§Filter')), - new Twig_SimpleFilter('escape_and_nl2br', array($this, 'escape_and_nl2br'), array('needs_environment' => true, 'is_safe' => array('html'))), - new Twig_SimpleFilter('nl2br', array($this, 'nl2br'), array('pre_escape' => 'html', 'is_safe' => array('html'))), - new Twig_SimpleFilter('escape_something', array($this, 'escape_something'), array('is_safe' => array('something'))), - new Twig_SimpleFilter('preserves_safety', array($this, 'preserves_safety'), array('preserves_safety' => array('html'))), - new Twig_SimpleFilter('*_path', array($this, 'dynamic_path')), - new Twig_SimpleFilter('*_foo_*_bar', array($this, 'dynamic_foo')), - ); - } - - public function getFunctions() - { - return array( - new Twig_SimpleFunction('§', array($this, '§Function')), - new Twig_SimpleFunction('safe_br', array($this, 'br'), array('is_safe' => array('html'))), - new Twig_SimpleFunction('unsafe_br', array($this, 'br')), - new Twig_SimpleFunction('*_path', array($this, 'dynamic_path')), - new Twig_SimpleFunction('*_foo_*_bar', array($this, 'dynamic_foo')), - ); - } - - public function getTests() - { - return array( - new Twig_SimpleTest('multi word', array($this, 'is_multi_word')), - ); - } - - public function §Filter($value) - { - return "§{$value}§"; - } - - public function §Function($value) - { - return "§{$value}§"; - } - - /** - * nl2br which also escapes, for testing escaper filters. - */ - public function escape_and_nl2br($env, $value, $sep = '
    ') - { - return $this->nl2br(twig_escape_filter($env, $value, 'html'), $sep); - } - - /** - * nl2br only, for testing filters with pre_escape. - */ - public function nl2br($value, $sep = '
    ') - { - // not secure if $value contains html tags (not only entities) - // don't use - return str_replace("\n", "$sep\n", $value); - } - - public function dynamic_path($element, $item) - { - return $element.'/'.$item; - } - - public function dynamic_foo($foo, $bar, $item) - { - return $foo.'/'.$bar.'/'.$item; - } - - public function escape_something($value) - { - return strtoupper($value); - } - - public function preserves_safety($value) - { - return strtoupper($value); - } - - public function br() - { - return '
    '; - } - - public function is_multi_word($value) - { - return false !== strpos($value, ' '); - } - - public function getName() - { - return 'integration_test'; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test b/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test deleted file mode 100644 index d9c1d50..0000000 --- a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Old test classes usage ---TEMPLATE-- -{{ 'foo' is multi word ? 'yes' : 'no' }} ---DATA-- -return array() ---EXPECT-- -no diff --git a/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php b/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php deleted file mode 100644 index 055a617..0000000 --- a/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php +++ /dev/null @@ -1,54 +0,0 @@ - new Twig_Test_Method($this, 'is_multi_word'), - ); - } - - public function is_multi_word($value) - { - return false !== strpos($value, ' '); - } - - public function getName() - { - return 'legacy_integration_test'; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/LexerTest.php b/vendor/twig/twig/test/Twig/Tests/LexerTest.php deleted file mode 100644 index 4945d22..0000000 --- a/vendor/twig/twig/test/Twig/Tests/LexerTest.php +++ /dev/null @@ -1,300 +0,0 @@ -getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - - $stream->expect(Twig_Token::BLOCK_START_TYPE); - $this->assertSame('§', $stream->expect(Twig_Token::NAME_TYPE)->getValue()); - } - - public function testNameLabelForFunction() - { - $template = '{{ §() }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - - $stream->expect(Twig_Token::VAR_START_TYPE); - $this->assertSame('§', $stream->expect(Twig_Token::NAME_TYPE)->getValue()); - } - - public function testBracketsNesting() - { - $template = '{{ {"a":{"b":"c"}} }}'; - - $this->assertEquals(2, $this->countToken($template, Twig_Token::PUNCTUATION_TYPE, '{')); - $this->assertEquals(2, $this->countToken($template, Twig_Token::PUNCTUATION_TYPE, '}')); - } - - protected function countToken($template, $type, $value = null) - { - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - - $count = 0; - while (!$stream->isEOF()) { - $token = $stream->next(); - if ($type === $token->getType()) { - if (null === $value || $value === $token->getValue()) { - ++$count; - } - } - } - - return $count; - } - - public function testLineDirective() - { - $template = "foo\n" - ."bar\n" - ."{% line 10 %}\n" - ."{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - - // foo\nbar\n - $this->assertSame(1, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); - // \n (after {% line %}) - $this->assertSame(10, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(11, $stream->expect(Twig_Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(12, $stream->expect(Twig_Token::NAME_TYPE)->getLine()); - } - - public function testLineDirectiveInline() - { - $template = "foo\n" - ."bar{% line 10 %}{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - - // foo\nbar - $this->assertSame(1, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(10, $stream->expect(Twig_Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(11, $stream->expect(Twig_Token::NAME_TYPE)->getLine()); - } - - public function testLongComments() - { - $template = '{# '.str_repeat('*', 100000).' #}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $lexer->tokenize($template); - - // should not throw an exception - } - - public function testLongVerbatim() - { - $template = '{% verbatim %}'.str_repeat('*', 100000).'{% endverbatim %}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $lexer->tokenize($template); - - // should not throw an exception - } - - public function testLongVar() - { - $template = '{{ '.str_repeat('x', 100000).' }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $lexer->tokenize($template); - - // should not throw an exception - } - - public function testLongBlock() - { - $template = '{% '.str_repeat('x', 100000).' %}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $lexer->tokenize($template); - - // should not throw an exception - } - - public function testBigNumbers() - { - $template = '{{ 922337203685477580700 }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - $stream->next(); - $node = $stream->next(); - $this->assertEquals('922337203685477580700', $node->getValue()); - } - - public function testStringWithEscapedDelimiter() - { - $tests = array( - "{{ 'foo \' bar' }}" => 'foo \' bar', - '{{ "foo \" bar" }}' => 'foo " bar', - ); - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - foreach ($tests as $template => $expected) { - $stream = $lexer->tokenize($template); - $stream->expect(Twig_Token::VAR_START_TYPE); - $stream->expect(Twig_Token::STRING_TYPE, $expected); - } - } - - public function testStringWithInterpolation() - { - $template = 'foo {{ "bar #{ baz + 1 }" }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - $stream->expect(Twig_Token::TEXT_TYPE, 'foo '); - $stream->expect(Twig_Token::VAR_START_TYPE); - $stream->expect(Twig_Token::STRING_TYPE, 'bar '); - $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); - $stream->expect(Twig_Token::NAME_TYPE, 'baz'); - $stream->expect(Twig_Token::OPERATOR_TYPE, '+'); - $stream->expect(Twig_Token::NUMBER_TYPE, '1'); - $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); - $stream->expect(Twig_Token::VAR_END_TYPE); - } - - public function testStringWithEscapedInterpolation() - { - $template = '{{ "bar \#{baz+1}" }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - $stream->expect(Twig_Token::VAR_START_TYPE); - $stream->expect(Twig_Token::STRING_TYPE, 'bar #{baz+1}'); - $stream->expect(Twig_Token::VAR_END_TYPE); - } - - public function testStringWithHash() - { - $template = '{{ "bar # baz" }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - $stream->expect(Twig_Token::VAR_START_TYPE); - $stream->expect(Twig_Token::STRING_TYPE, 'bar # baz'); - $stream->expect(Twig_Token::VAR_END_TYPE); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unclosed """ - */ - public function testStringWithUnterminatedInterpolation() - { - $template = '{{ "bar #{x" }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $lexer->tokenize($template); - } - - public function testStringWithNestedInterpolations() - { - $template = '{{ "bar #{ "foo#{bar}" }" }}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - $stream->expect(Twig_Token::VAR_START_TYPE); - $stream->expect(Twig_Token::STRING_TYPE, 'bar '); - $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); - $stream->expect(Twig_Token::STRING_TYPE, 'foo'); - $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); - $stream->expect(Twig_Token::NAME_TYPE, 'bar'); - $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); - $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); - $stream->expect(Twig_Token::VAR_END_TYPE); - } - - public function testStringWithNestedInterpolationsInBlock() - { - $template = '{% foo "bar #{ "foo#{bar}" }" %}'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - $stream->expect(Twig_Token::BLOCK_START_TYPE); - $stream->expect(Twig_Token::NAME_TYPE, 'foo'); - $stream->expect(Twig_Token::STRING_TYPE, 'bar '); - $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); - $stream->expect(Twig_Token::STRING_TYPE, 'foo'); - $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); - $stream->expect(Twig_Token::NAME_TYPE, 'bar'); - $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); - $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); - $stream->expect(Twig_Token::BLOCK_END_TYPE); - } - - public function testOperatorEndingWithALetterAtTheEndOfALine() - { - $template = "{{ 1 and\n0}}"; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $stream = $lexer->tokenize($template); - $stream->expect(Twig_Token::VAR_START_TYPE); - $stream->expect(Twig_Token::NUMBER_TYPE, 1); - $stream->expect(Twig_Token::OPERATOR_TYPE, 'and'); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unclosed "variable" at line 3 - */ - public function testUnterminatedVariable() - { - $template = ' - -{{ - -bar - - -'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $lexer->tokenize($template); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unclosed "block" at line 3 - */ - public function testUnterminatedBlock() - { - $template = ' - -{% - -bar - - -'; - - $lexer = new Twig_Lexer(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $lexer->tokenize($template); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php deleted file mode 100644 index 1369a6b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php +++ /dev/null @@ -1,97 +0,0 @@ - 'bar')); - - $this->assertEquals('bar', $loader->getSource('foo')); - } - - /** - * @expectedException Twig_Error_Loader - */ - public function testGetSourceWhenTemplateDoesNotExist() - { - $loader = new Twig_Loader_Array(array()); - - $loader->getSource('foo'); - } - - public function testGetCacheKey() - { - $loader = new Twig_Loader_Array(array('foo' => 'bar')); - - $this->assertEquals('bar', $loader->getCacheKey('foo')); - } - - /** - * @expectedException Twig_Error_Loader - */ - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $loader = new Twig_Loader_Array(array()); - - $loader->getCacheKey('foo'); - } - - public function testSetTemplate() - { - $loader = new Twig_Loader_Array(array()); - $loader->setTemplate('foo', 'bar'); - - $this->assertEquals('bar', $loader->getSource('foo')); - } - - public function testIsFresh() - { - $loader = new Twig_Loader_Array(array('foo' => 'bar')); - $this->assertTrue($loader->isFresh('foo', time())); - } - - /** - * @expectedException Twig_Error_Loader - */ - public function testIsFreshWhenTemplateDoesNotExist() - { - $loader = new Twig_Loader_Array(array()); - - $loader->isFresh('foo', time()); - } - - public function testTemplateReference() - { - $name = new Twig_Test_Loader_TemplateReference('foo'); - $loader = new Twig_Loader_Array(array('foo' => 'bar')); - - $loader->getCacheKey($name); - $loader->getSource($name); - $loader->isFresh($name, time()); - $loader->setTemplate($name, 'foobar'); - } -} - -class Twig_Test_Loader_TemplateReference -{ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php deleted file mode 100644 index 4fe0db9..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php +++ /dev/null @@ -1,79 +0,0 @@ - 'bar')), - new Twig_Loader_Array(array('foo' => 'foobar', 'bar' => 'foo')), - )); - - $this->assertEquals('bar', $loader->getSource('foo')); - $this->assertEquals('foo', $loader->getSource('bar')); - } - - /** - * @expectedException Twig_Error_Loader - */ - public function testGetSourceWhenTemplateDoesNotExist() - { - $loader = new Twig_Loader_Chain(array()); - - $loader->getSource('foo'); - } - - public function testGetCacheKey() - { - $loader = new Twig_Loader_Chain(array( - new Twig_Loader_Array(array('foo' => 'bar')), - new Twig_Loader_Array(array('foo' => 'foobar', 'bar' => 'foo')), - )); - - $this->assertEquals('bar', $loader->getCacheKey('foo')); - $this->assertEquals('foo', $loader->getCacheKey('bar')); - } - - /** - * @expectedException Twig_Error_Loader - */ - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $loader = new Twig_Loader_Chain(array()); - - $loader->getCacheKey('foo'); - } - - public function testAddLoader() - { - $loader = new Twig_Loader_Chain(); - $loader->addLoader(new Twig_Loader_Array(array('foo' => 'bar'))); - - $this->assertEquals('bar', $loader->getSource('foo')); - } - - public function testExists() - { - $loader1 = $this->getMock('Twig_Loader_Array', array('exists', 'getSource'), array(), '', false); - $loader1->expects($this->once())->method('exists')->will($this->returnValue(false)); - $loader1->expects($this->never())->method('getSource'); - - $loader2 = $this->getMock('Twig_LoaderInterface'); - $loader2->expects($this->once())->method('getSource')->will($this->returnValue('content')); - - $loader = new Twig_Loader_Chain(); - $loader->addLoader($loader1); - $loader->addLoader($loader2); - - $this->assertTrue($loader->exists('foo')); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php deleted file mode 100644 index e07f374..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php +++ /dev/null @@ -1,175 +0,0 @@ -getCacheKey($template); - $this->fail(); - } catch (Twig_Error_Loader $e) { - $this->assertNotContains('Unable to find template', $e->getMessage()); - } - } - - public function getSecurityTests() - { - return array( - array("AutoloaderTest\0.php"), - array('..\\AutoloaderTest.php'), - array('..\\\\\\AutoloaderTest.php'), - array('../AutoloaderTest.php'), - array('..////AutoloaderTest.php'), - array('./../AutoloaderTest.php'), - array('.\\..\\AutoloaderTest.php'), - array('././././././../AutoloaderTest.php'), - array('.\\./.\\./.\\./../AutoloaderTest.php'), - array('foo/../../AutoloaderTest.php'), - array('foo\\..\\..\\AutoloaderTest.php'), - array('foo/../bar/../../AutoloaderTest.php'), - array('foo/bar/../../../AutoloaderTest.php'), - array('filters/../../AutoloaderTest.php'), - array('filters//..//..//AutoloaderTest.php'), - array('filters\\..\\..\\AutoloaderTest.php'), - array('filters\\\\..\\\\..\\\\AutoloaderTest.php'), - array('filters\\//../\\/\\..\\AutoloaderTest.php'), - array('/../AutoloaderTest.php'), - ); - } - - public function testPaths() - { - $basePath = dirname(__FILE__).'/Fixtures'; - - $loader = new Twig_Loader_Filesystem(array($basePath.'/normal', $basePath.'/normal_bis')); - $loader->setPaths(array($basePath.'/named', $basePath.'/named_bis'), 'named'); - $loader->addPath($basePath.'/named_ter', 'named'); - $loader->addPath($basePath.'/normal_ter'); - $loader->prependPath($basePath.'/normal_final'); - $loader->prependPath($basePath.'/named/../named_quater', 'named'); - $loader->prependPath($basePath.'/named_final', 'named'); - - $this->assertEquals(array( - $basePath.'/normal_final', - $basePath.'/normal', - $basePath.'/normal_bis', - $basePath.'/normal_ter', - ), $loader->getPaths()); - $this->assertEquals(array( - $basePath.'/named_final', - $basePath.'/named/../named_quater', - $basePath.'/named', - $basePath.'/named_bis', - $basePath.'/named_ter', - ), $loader->getPaths('named')); - - $this->assertEquals( - realpath($basePath.'/named_quater/named_absolute.html'), - realpath($loader->getCacheKey('@named/named_absolute.html')) - ); - $this->assertEquals("path (final)\n", $loader->getSource('index.html')); - $this->assertEquals("path (final)\n", $loader->getSource('@__main__/index.html')); - $this->assertEquals("named path (final)\n", $loader->getSource('@named/index.html')); - } - - public function testEmptyConstructor() - { - $loader = new Twig_Loader_Filesystem(); - $this->assertEquals(array(), $loader->getPaths()); - } - - public function testGetNamespaces() - { - $loader = new Twig_Loader_Filesystem(sys_get_temp_dir()); - $this->assertEquals(array(Twig_Loader_Filesystem::MAIN_NAMESPACE), $loader->getNamespaces()); - - $loader->addPath(sys_get_temp_dir(), 'named'); - $this->assertEquals(array(Twig_Loader_Filesystem::MAIN_NAMESPACE, 'named'), $loader->getNamespaces()); - } - - public function testFindTemplateExceptionNamespace() - { - $basePath = dirname(__FILE__).'/Fixtures'; - - $loader = new Twig_Loader_Filesystem(array($basePath.'/normal')); - $loader->addPath($basePath.'/named', 'named'); - - try { - $loader->getSource('@named/nowhere.html'); - } catch (Exception $e) { - $this->assertInstanceof('Twig_Error_Loader', $e); - $this->assertContains('Unable to find template "@named/nowhere.html"', $e->getMessage()); - } - } - - public function testFindTemplateWithCache() - { - $basePath = dirname(__FILE__).'/Fixtures'; - - $loader = new Twig_Loader_Filesystem(array($basePath.'/normal')); - $loader->addPath($basePath.'/named', 'named'); - - // prime the cache for index.html in the named namespace - $namedSource = $loader->getSource('@named/index.html'); - $this->assertEquals("named path\n", $namedSource); - - // get index.html from the main namespace - $this->assertEquals("path\n", $loader->getSource('index.html')); - } - - public function testLoadTemplateAndRenderBlockWithCache() - { - $loader = new Twig_Loader_Filesystem(array()); - $loader->addPath(dirname(__FILE__).'/Fixtures/themes/theme2'); - $loader->addPath(dirname(__FILE__).'/Fixtures/themes/theme1'); - $loader->addPath(dirname(__FILE__).'/Fixtures/themes/theme1', 'default_theme'); - - $twig = new Twig_Environment($loader); - - $template = $twig->loadTemplate('blocks.html.twig'); - $this->assertSame('block from theme 1', $template->renderBlock('b1', array())); - - $template = $twig->loadTemplate('blocks.html.twig'); - $this->assertSame('block from theme 2', $template->renderBlock('b2', array())); - } - - public function getArrayInheritanceTests() - { - return array( - 'valid array inheritance' => array('array_inheritance_valid_parent.html.twig'), - 'array inheritance with null first template' => array('array_inheritance_null_parent.html.twig'), - 'array inheritance with empty first template' => array('array_inheritance_empty_parent.html.twig'), - 'array inheritance with non-existent first template' => array('array_inheritance_nonexistent_parent.html.twig'), - ); - } - - /** - * @dataProvider getArrayInheritanceTests - * - * @param $templateName string Template name with array inheritance - */ - public function testArrayInheritance($templateName) - { - $loader = new Twig_Loader_Filesystem(array()); - $loader->addPath(dirname(__FILE__).'/Fixtures/inheritance'); - - $twig = new Twig_Environment($loader); - - $template = $twig->loadTemplate($templateName); - $this->assertSame('VALID Child', $template->renderBlock('body', array())); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig deleted file mode 100644 index 6977ebf..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig deleted file mode 100644 index 5b50a8b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['nonexistent.html.twig','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig deleted file mode 100644 index a16b3ad..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends [null,'parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig deleted file mode 100644 index 4940dad..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['parent.html.twig','spare_parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig deleted file mode 100644 index d594c0e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}VALID{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig deleted file mode 100644 index 70b7360..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}SPARE PARENT{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html deleted file mode 100644 index 9e5449c..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html +++ /dev/null @@ -1 +0,0 @@ -named path diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html deleted file mode 100644 index d3a272b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (bis) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html deleted file mode 100644 index 9f05d15..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (final) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html deleted file mode 100644 index b1fb5f5..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html +++ /dev/null @@ -1 +0,0 @@ -named path (quater) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html deleted file mode 100644 index 24fb68a..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (ter) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html deleted file mode 100644 index e7a8fd4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html +++ /dev/null @@ -1 +0,0 @@ -path diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html deleted file mode 100644 index bfa9160..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -path (bis) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html deleted file mode 100644 index 73a089b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html +++ /dev/null @@ -1 +0,0 @@ -path (final) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html deleted file mode 100644 index b7ad97d..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -path (ter) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig deleted file mode 100644 index dd0cbc2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block b1 %}block from theme 1{% endblock %} - -{% block b2 %}block from theme 1{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig deleted file mode 100644 index 07cf9db..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% use '@default_theme/blocks.html.twig' %} - -{% block b2 %}block from theme 2{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php b/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php deleted file mode 100644 index 942aff9..0000000 --- a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php +++ /dev/null @@ -1,33 +0,0 @@ -markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)'); - } - - $twig = new Twig_Environment(new Twig_Loader_Array(array('index' => '{{ d1.date }}{{ d2.date }}')), array( - 'debug' => true, - 'cache' => false, - 'autoescape' => false, - )); - - $d1 = new DateTime(); - $d2 = new DateTime(); - $output = $twig->render('index', compact('d1', 'd2')); - - // If it fails, PHP will crash. - $this->assertEquals($output, $d1->date.$d2->date); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php deleted file mode 100644 index 25d1602..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertTrue($node->getAttribute('value')); - } - - public function getTests() - { - $body = new Twig_Node(array(new Twig_Node_Text('foo', 1))); - $node = new Twig_Node_AutoEscape(true, $body, 1); - - return array( - array($node, "// line 1\necho \"foo\";"), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php deleted file mode 100644 index 84dac9b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - return array( - array(new Twig_Node_BlockReference('foo', 1), <<displayBlock('foo', \$context, \$blocks); -EOF - ), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php deleted file mode 100644 index e7246dc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new Twig_Node_Text('foo', 1); - $node = new Twig_Node_Block('foo', $body, 1); - - return array( - array($node, <<assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = array(); - - $expr = new Twig_Node_Expression_Constant('foo', 1); - $node = new Twig_Node_Do($expr, 1); - $tests[] = array($node, "// line 1\n\"foo\";"); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php deleted file mode 100644 index 4f83ab1..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertEquals($foo, $node->getNode(1)); - } - - public function getTests() - { - $elements = array( - new Twig_Node_Expression_Constant('foo', 1), - new Twig_Node_Expression_Constant('bar', 1), - - new Twig_Node_Expression_Constant('bar', 1), - new Twig_Node_Expression_Constant('foo', 1), - ); - $node = new Twig_Node_Expression_Array($elements, 1); - - return array( - array($node, 'array("foo" => "bar", "bar" => "foo")'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php deleted file mode 100644 index bf365de..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php +++ /dev/null @@ -1,29 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new Twig_Node_Expression_AssignName('foo', 1); - - return array( - array($node, '$context["foo"]'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php deleted file mode 100644 index 02310a1..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_Add($left, $right, 1); - - return array( - array($node, '(1 + 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php deleted file mode 100644 index 2df3c8e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_And($left, $right, 1); - - return array( - array($node, '(1 && 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php deleted file mode 100644 index 759e482..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_Concat($left, $right, 1); - - return array( - array($node, '(1 . 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php deleted file mode 100644 index 0e54b10..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_Div($left, $right, 1); - - return array( - array($node, '(1 / 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php deleted file mode 100644 index 602888f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_FloorDiv($left, $right, 1); - - return array( - array($node, 'intval(floor((1 / 2)))'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php deleted file mode 100644 index 4c663c7..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_Mod($left, $right, 1); - - return array( - array($node, '(1 % 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php deleted file mode 100644 index e92c95e..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_Mul($left, $right, 1); - - return array( - array($node, '(1 * 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php deleted file mode 100644 index ec37c83..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_Or($left, $right, 1); - - return array( - array($node, '(1 || 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php deleted file mode 100644 index 061cb27..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new Twig_Node_Expression_Constant(1, 1); - $right = new Twig_Node_Expression_Constant(2, 1); - $node = new Twig_Node_Expression_Binary_Sub($left, $right, 1); - - return array( - array($node, '(1 - 2)'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php deleted file mode 100644 index 43afcd2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php +++ /dev/null @@ -1,116 +0,0 @@ - 'function', 'name' => 'date')); - $this->assertEquals(array('U', null), $node->getArguments('date', array('format' => 'U', 'timestamp' => null))); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Positional arguments cannot be used after named arguments for function "date". - */ - public function testGetArgumentsWhenPositionalArgumentsAfterNamedArguments() - { - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); - $node->getArguments('date', array('timestamp' => 123456, 'Y-m-d')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Argument "format" is defined twice for function "date". - */ - public function testGetArgumentsWhenArgumentIsDefinedTwice() - { - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); - $node->getArguments('date', array('Y-m-d', 'format' => 'U')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unknown argument "unknown" for function "date(format, timestamp)". - */ - public function testGetArgumentsWithWrongNamedArgumentName() - { - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); - $node->getArguments('date', array('Y-m-d', 'timestamp' => null, 'unknown' => '')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unknown arguments "unknown1", "unknown2" for function "date(format, timestamp)". - */ - public function testGetArgumentsWithWrongNamedArgumentNames() - { - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); - $node->getArguments('date', array('Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => '')); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length". - */ - public function testResolveArgumentsWithMissingValueForOptionalArgument() - { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)'); - } - - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'substr_compare')); - $node->getArguments('substr_compare', array('abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true)); - } - - public function testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction() - { - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'custom_function')); - - $this->assertEquals(array('arg1'), $node->getArguments(array($this, 'customFunction'), array('arg1' => 'arg1'))); - } - - public function testGetArgumentsForStaticMethod() - { - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'custom_static_function')); - $this->assertEquals(array('arg1'), $node->getArguments(__CLASS__.'::customStaticFunction', array('arg1' => 'arg1'))); - } - - /** - * @expectedException LogicException - * @expectedExceptionMessage The last parameter of "Twig_Tests_Node_Expression_CallTest::customFunctionWithArbitraryArguments" for function "foo" must be an array with default value, eg. "array $arg = array()". - */ - public function testResolveArgumentsWithMissingParameterForArbitraryArguments() - { - $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'foo', 'is_variadic' => true)); - $node->getArguments(array($this, 'customFunctionWithArbitraryArguments'), array()); - } - - public static function customStaticFunction($arg1, $arg2 = 'default', $arg3 = array()) - { - } - - public function customFunction($arg1, $arg2 = 'default', $arg3 = array()) - { - } - - public function customFunctionWithArbitraryArguments() - { - } -} - -class Twig_Tests_Node_Expression_Call extends Twig_Node_Expression_Call -{ - public function getArguments($callable, $arguments) - { - return parent::getArguments($callable, $arguments); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php deleted file mode 100644 index a3e8bad..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php +++ /dev/null @@ -1,38 +0,0 @@ -assertEquals($expr1, $node->getNode('expr1')); - $this->assertEquals($expr2, $node->getNode('expr2')); - $this->assertEquals($expr3, $node->getNode('expr3')); - } - - public function getTests() - { - $tests = array(); - - $expr1 = new Twig_Node_Expression_Constant(1, 1); - $expr2 = new Twig_Node_Expression_Constant(2, 1); - $expr3 = new Twig_Node_Expression_Constant(3, 1); - $node = new Twig_Node_Expression_Conditional($expr1, $expr2, $expr3, 1); - $tests[] = array($node, '((1) ? (2) : (3))'); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php deleted file mode 100644 index 2ff9318..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals('foo', $node->getAttribute('value')); - } - - public function getTests() - { - $tests = array(); - - $node = new Twig_Node_Expression_Constant('foo', 1); - $tests[] = array($node, '"foo"'); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php deleted file mode 100644 index d5ffb24..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php +++ /dev/null @@ -1,154 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - $this->assertEquals($name, $node->getNode('filter')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $environment->addFilter(new Twig_SimpleFilter('bar', 'bar', array('needs_environment' => true))); - $environment->addFilter(new Twig_SimpleFilter('barbar', 'twig_tests_filter_barbar', array('needs_context' => true, 'is_variadic' => true))); - - $tests = array(); - - $expr = new Twig_Node_Expression_Constant('foo', 1); - $node = $this->createFilter($expr, 'upper'); - $node = $this->createFilter($node, 'number_format', array(new Twig_Node_Expression_Constant(2, 1), new Twig_Node_Expression_Constant('.', 1), new Twig_Node_Expression_Constant(',', 1))); - - if (function_exists('mb_get_info')) { - $tests[] = array($node, 'twig_number_format_filter($this->env, twig_upper_filter($this->env, "foo"), 2, ".", ",")'); - } else { - $tests[] = array($node, 'twig_number_format_filter($this->env, strtoupper("foo"), 2, ".", ",")'); - } - - // named arguments - $date = new Twig_Node_Expression_Constant(0, 1); - $node = $this->createFilter($date, 'date', array( - 'timezone' => new Twig_Node_Expression_Constant('America/Chicago', 1), - 'format' => new Twig_Node_Expression_Constant('d/m/Y H:i:s P', 1), - )); - $tests[] = array($node, 'twig_date_format_filter($this->env, 0, "d/m/Y H:i:s P", "America/Chicago")'); - - // skip an optional argument - $date = new Twig_Node_Expression_Constant(0, 1); - $node = $this->createFilter($date, 'date', array( - 'timezone' => new Twig_Node_Expression_Constant('America/Chicago', 1), - )); - $tests[] = array($node, 'twig_date_format_filter($this->env, 0, null, "America/Chicago")'); - - // underscores vs camelCase for named arguments - $string = new Twig_Node_Expression_Constant('abc', 1); - $node = $this->createFilter($string, 'reverse', array( - 'preserve_keys' => new Twig_Node_Expression_Constant(true, 1), - )); - $tests[] = array($node, 'twig_reverse_filter($this->env, "abc", true)'); - $node = $this->createFilter($string, 'reverse', array( - 'preserveKeys' => new Twig_Node_Expression_Constant(true, 1), - )); - $tests[] = array($node, 'twig_reverse_filter($this->env, "abc", true)'); - - // filter as an anonymous function - if (PHP_VERSION_ID >= 50300) { - $node = $this->createFilter(new Twig_Node_Expression_Constant('foo', 1), 'anonymous'); - $tests[] = array($node, 'call_user_func_array($this->env->getFilter(\'anonymous\')->getCallable(), array("foo"))'); - } - - // needs environment - $node = $this->createFilter($string, 'bar'); - $tests[] = array($node, 'bar($this->env, "abc")', $environment); - - $node = $this->createFilter($string, 'bar', array(new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'bar($this->env, "abc", "bar")', $environment); - - // arbitrary named arguments - $node = $this->createFilter($string, 'barbar'); - $tests[] = array($node, 'twig_tests_filter_barbar($context, "abc")', $environment); - - $node = $this->createFilter($string, 'barbar', array('foo' => new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'twig_tests_filter_barbar($context, "abc", null, null, array("foo" => "bar"))', $environment); - - $node = $this->createFilter($string, 'barbar', array('arg2' => new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'twig_tests_filter_barbar($context, "abc", null, "bar")', $environment); - - $node = $this->createFilter($string, 'barbar', array( - new Twig_Node_Expression_Constant('1', 1), - new Twig_Node_Expression_Constant('2', 1), - new Twig_Node_Expression_Constant('3', 1), - 'foo' => new Twig_Node_Expression_Constant('bar', 1), - )); - $tests[] = array($node, 'twig_tests_filter_barbar($context, "abc", "1", "2", array(0 => "3", "foo" => "bar"))', $environment); - - return $tests; - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unknown argument "foobar" for filter "date(format, timezone)" at line 1. - */ - public function testCompileWithWrongNamedArgumentName() - { - $date = new Twig_Node_Expression_Constant(0, 1); - $node = $this->createFilter($date, 'date', array( - 'foobar' => new Twig_Node_Expression_Constant('America/Chicago', 1), - )); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Value for argument "from" is required for filter "replace". - */ - public function testCompileWithMissingNamedArgument() - { - $value = new Twig_Node_Expression_Constant(0, 1); - $node = $this->createFilter($value, 'replace', array( - 'to' => new Twig_Node_Expression_Constant('foo', 1), - )); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - protected function createFilter($node, $name, array $arguments = array()) - { - $name = new Twig_Node_Expression_Constant($name, 1); - $arguments = new Twig_Node($arguments); - - return new Twig_Node_Expression_Filter($node, $name, $arguments, 1); - } - - protected function getEnvironment() - { - if (PHP_VERSION_ID >= 50300) { - return include 'PHP53/FilterInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_filter_barbar($context, $string, $arg1 = null, $arg2 = null, array $args = array()) -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php deleted file mode 100644 index de2e0f8..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php +++ /dev/null @@ -1,110 +0,0 @@ -assertEquals($name, $node->getAttribute('name')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $environment->addFunction(new Twig_SimpleFunction('foo', 'foo', array())); - $environment->addFunction(new Twig_SimpleFunction('bar', 'bar', array('needs_environment' => true))); - $environment->addFunction(new Twig_SimpleFunction('foofoo', 'foofoo', array('needs_context' => true))); - $environment->addFunction(new Twig_SimpleFunction('foobar', 'foobar', array('needs_environment' => true, 'needs_context' => true))); - $environment->addFunction(new Twig_SimpleFunction('barbar', 'twig_tests_function_barbar', array('is_variadic' => true))); - - $tests = array(); - - $node = $this->createFunction('foo'); - $tests[] = array($node, 'foo()', $environment); - - $node = $this->createFunction('foo', array(new Twig_Node_Expression_Constant('bar', 1), new Twig_Node_Expression_Constant('foobar', 1))); - $tests[] = array($node, 'foo("bar", "foobar")', $environment); - - $node = $this->createFunction('bar'); - $tests[] = array($node, 'bar($this->env)', $environment); - - $node = $this->createFunction('bar', array(new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'bar($this->env, "bar")', $environment); - - $node = $this->createFunction('foofoo'); - $tests[] = array($node, 'foofoo($context)', $environment); - - $node = $this->createFunction('foofoo', array(new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'foofoo($context, "bar")', $environment); - - $node = $this->createFunction('foobar'); - $tests[] = array($node, 'foobar($this->env, $context)', $environment); - - $node = $this->createFunction('foobar', array(new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'foobar($this->env, $context, "bar")', $environment); - - // named arguments - $node = $this->createFunction('date', array( - 'timezone' => new Twig_Node_Expression_Constant('America/Chicago', 1), - 'date' => new Twig_Node_Expression_Constant(0, 1), - )); - $tests[] = array($node, 'twig_date_converter($this->env, 0, "America/Chicago")'); - - // arbitrary named arguments - $node = $this->createFunction('barbar'); - $tests[] = array($node, 'twig_tests_function_barbar()', $environment); - - $node = $this->createFunction('barbar', array('foo' => new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'twig_tests_function_barbar(null, null, array("foo" => "bar"))', $environment); - - $node = $this->createFunction('barbar', array('arg2' => new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'twig_tests_function_barbar(null, "bar")', $environment); - - $node = $this->createFunction('barbar', array( - new Twig_Node_Expression_Constant('1', 1), - new Twig_Node_Expression_Constant('2', 1), - new Twig_Node_Expression_Constant('3', 1), - 'foo' => new Twig_Node_Expression_Constant('bar', 1), - )); - $tests[] = array($node, 'twig_tests_function_barbar("1", "2", array(0 => "3", "foo" => "bar"))', $environment); - - // function as an anonymous function - if (PHP_VERSION_ID >= 50300) { - $node = $this->createFunction('anonymous', array(new Twig_Node_Expression_Constant('foo', 1))); - $tests[] = array($node, 'call_user_func_array($this->env->getFunction(\'anonymous\')->getCallable(), array("foo"))'); - } - - return $tests; - } - - protected function createFunction($name, array $arguments = array()) - { - return new Twig_Node_Expression_Function($name, new Twig_Node($arguments), 1); - } - - protected function getEnvironment() - { - if (PHP_VERSION_ID >= 50300) { - return include 'PHP53/FunctionInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_function_barbar($arg1 = null, $arg2 = null, array $args = array()) -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php deleted file mode 100644 index 2764478..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php +++ /dev/null @@ -1,50 +0,0 @@ -addElement(new Twig_Node_Expression_Name('foo', 1)); - $args->addElement(new Twig_Node_Expression_Constant('bar', 1)); - $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ARRAY_CALL, 1); - - $this->assertEquals($expr, $node->getNode('node')); - $this->assertEquals($attr, $node->getNode('attribute')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals(Twig_Template::ARRAY_CALL, $node->getAttribute('type')); - } - - public function getTests() - { - $tests = array(); - - $expr = new Twig_Node_Expression_Name('foo', 1); - $attr = new Twig_Node_Expression_Constant('bar', 1); - $args = new Twig_Node_Expression_Array(array(), 1); - $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ANY_CALL, 1); - $tests[] = array($node, sprintf('%s%s, "bar", array())', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))); - - $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ARRAY_CALL, 1); - $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))); - - $args = new Twig_Node_Expression_Array(array(), 1); - $args->addElement(new Twig_Node_Expression_Name('foo', 1)); - $args->addElement(new Twig_Node_Expression_Constant('bar', 1)); - $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::METHOD_CALL, 1); - $tests[] = array($node, sprintf('%s%s, "bar", array(0 => %s, 1 => "bar"), "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1), $this->getVariableGetter('foo'))); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php deleted file mode 100644 index 8cbb2f7..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new Twig_Node_Expression_Name('foo', 1); - $context = new Twig_Node_Expression_Name('_context', 1); - - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true)); - $env1 = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => false)); - - return array( - array($node, "// line 1\n".(PHP_VERSION_ID >= 50400 ? '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))' : '$this->getContext($context, "foo")'), $env), - array($node, $this->getVariableGetter('foo', 1), $env1), - array($context, "// line 1\n\$context"), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php deleted file mode 100644 index b5394bc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php +++ /dev/null @@ -1,6 +0,0 @@ -addFilter(new Twig_SimpleFilter('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php deleted file mode 100644 index e8f68c7..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php +++ /dev/null @@ -1,6 +0,0 @@ -addFunction(new Twig_SimpleFunction('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php deleted file mode 100644 index 9f818bc..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php +++ /dev/null @@ -1,6 +0,0 @@ -addTest(new Twig_SimpleTest('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php deleted file mode 100644 index ab2bbe0..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php +++ /dev/null @@ -1,28 +0,0 @@ -assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $tests = array(); - $tests[] = array(new Twig_Node_Expression_Parent('foo', 1), '$this->renderParentBlock("foo", $context, $blocks)'); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php deleted file mode 100644 index 55d3fcb..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php +++ /dev/null @@ -1,82 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals($name, $node->getAttribute('name')); - } - - public function getTests() - { - $environment = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $environment->addTest(new Twig_SimpleTest('barbar', 'twig_tests_test_barbar', array('is_variadic' => true, 'need_context' => true))); - - $tests = array(); - - $expr = new Twig_Node_Expression_Constant('foo', 1); - $node = new Twig_Node_Expression_Test_Null($expr, 'null', new Twig_Node(array()), 1); - $tests[] = array($node, '(null === "foo")'); - - // test as an anonymous function - if (PHP_VERSION_ID >= 50300) { - $node = $this->createTest(new Twig_Node_Expression_Constant('foo', 1), 'anonymous', array(new Twig_Node_Expression_Constant('foo', 1))); - $tests[] = array($node, 'call_user_func_array($this->env->getTest(\'anonymous\')->getCallable(), array("foo", "foo"))'); - } - - // arbitrary named arguments - $string = new Twig_Node_Expression_Constant('abc', 1); - $node = $this->createTest($string, 'barbar'); - $tests[] = array($node, 'twig_tests_test_barbar("abc")', $environment); - - $node = $this->createTest($string, 'barbar', array('foo' => new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'twig_tests_test_barbar("abc", null, null, array("foo" => "bar"))', $environment); - - $node = $this->createTest($string, 'barbar', array('arg2' => new Twig_Node_Expression_Constant('bar', 1))); - $tests[] = array($node, 'twig_tests_test_barbar("abc", null, "bar")', $environment); - - $node = $this->createTest($string, 'barbar', array( - new Twig_Node_Expression_Constant('1', 1), - new Twig_Node_Expression_Constant('2', 1), - new Twig_Node_Expression_Constant('3', 1), - 'foo' => new Twig_Node_Expression_Constant('bar', 1), - )); - $tests[] = array($node, 'twig_tests_test_barbar("abc", "1", "2", array(0 => "3", "foo" => "bar"))', $environment); - - return $tests; - } - - protected function createTest($node, $name, array $arguments = array()) - { - return new Twig_Node_Expression_Test($node, $name, new Twig_Node($arguments), 1); - } - - protected function getEnvironment() - { - if (PHP_VERSION_ID >= 50300) { - return include 'PHP53/TestInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_test_barbar($string, $arg1 = null, $arg2 = null, array $args = array()) -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php deleted file mode 100644 index b633371..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new Twig_Node_Expression_Constant(1, 1); - $node = new Twig_Node_Expression_Unary_Neg($node, 1); - - return array( - array($node, '-1'), - array(new Twig_Node_Expression_Unary_Neg($node, 1), '- -1'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php deleted file mode 100644 index d7c6f85..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new Twig_Node_Expression_Constant(1, 1); - $node = new Twig_Node_Expression_Unary_Not($node, 1); - - return array( - array($node, '!1'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php deleted file mode 100644 index 057250f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new Twig_Node_Expression_Constant(1, 1); - $node = new Twig_Node_Expression_Unary_Pos($node, 1); - - return array( - array($node, '+1'), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php deleted file mode 100644 index b2c6fa4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php +++ /dev/null @@ -1,191 +0,0 @@ -setAttribute('with_loop', false); - - $this->assertEquals($keyTarget, $node->getNode('key_target')); - $this->assertEquals($valueTarget, $node->getNode('value_target')); - $this->assertEquals($seq, $node->getNode('seq')); - $this->assertTrue($node->getAttribute('ifexpr')); - $this->assertEquals('Twig_Node_If', get_class($node->getNode('body'))); - $this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0)); - $this->assertNull($node->getNode('else')); - - $else = new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1); - $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = array(); - - $keyTarget = new Twig_Node_Expression_AssignName('key', 1); - $valueTarget = new Twig_Node_Expression_AssignName('item', 1); - $seq = new Twig_Node_Expression_Name('items', 1); - $ifexpr = null; - $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); - $else = null; - $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - - $tests[] = array($node, <<getVariableGetter('items')}); -foreach (\$context['_seq'] as \$context["key"] => \$context["item"]) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['key'], \$context['item'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ); - - $keyTarget = new Twig_Node_Expression_AssignName('k', 1); - $valueTarget = new Twig_Node_Expression_AssignName('v', 1); - $seq = new Twig_Node_Expression_Name('values', 1); - $ifexpr = null; - $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); - $else = null; - $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = array($node, <<getVariableGetter('values')}); -\$context['loop'] = array( - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -); -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ); - - $keyTarget = new Twig_Node_Expression_AssignName('k', 1); - $valueTarget = new Twig_Node_Expression_AssignName('v', 1); - $seq = new Twig_Node_Expression_Name('values', 1); - $ifexpr = new Twig_Node_Expression_Constant(true, 1); - $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); - $else = null; - $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = array($node, <<getVariableGetter('values')}); -\$context['loop'] = array( - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -); -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - if (true) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ); - - $keyTarget = new Twig_Node_Expression_AssignName('k', 1); - $valueTarget = new Twig_Node_Expression_AssignName('v', 1); - $seq = new Twig_Node_Expression_Name('values', 1); - $ifexpr = null; - $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); - $else = new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1); - $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = array($node, <<getVariableGetter('values')}); -\$context['_iterated'] = false; -\$context['loop'] = array( - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -); -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - \$context['_iterated'] = true; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -if (!\$context['_iterated']) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php deleted file mode 100644 index e47dd65..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php +++ /dev/null @@ -1,88 +0,0 @@ -assertEquals($t, $node->getNode('tests')); - $this->assertNull($node->getNode('else')); - - $else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1); - $node = new Twig_Node_If($t, $else, 1); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = array(); - - $t = new Twig_Node(array( - new Twig_Node_Expression_Constant(true, 1), - new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1), - ), array(), 1); - $else = null; - $node = new Twig_Node_If($t, $else, 1); - - $tests[] = array($node, <<getVariableGetter('foo')}; -} -EOF - ); - - $t = new Twig_Node(array( - new Twig_Node_Expression_Constant(true, 1), - new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1), - new Twig_Node_Expression_Constant(false, 1), - new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1), - ), array(), 1); - $else = null; - $node = new Twig_Node_If($t, $else, 1); - - $tests[] = array($node, <<getVariableGetter('foo')}; -} elseif (false) { - echo {$this->getVariableGetter('bar')}; -} -EOF - ); - - $t = new Twig_Node(array( - new Twig_Node_Expression_Constant(true, 1), - new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1), - ), array(), 1); - $else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1); - $node = new Twig_Node_If($t, $else, 1); - - $tests[] = array($node, <<getVariableGetter('foo')}; -} else { - echo {$this->getVariableGetter('bar')}; -} -EOF - ); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php deleted file mode 100644 index 36525b2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals($macro, $node->getNode('expr')); - $this->assertEquals($var, $node->getNode('var')); - } - - public function getTests() - { - $tests = array(); - - $macro = new Twig_Node_Expression_Constant('foo.twig', 1); - $var = new Twig_Node_Expression_AssignName('macro', 1); - $node = new Twig_Node_Import($macro, $var, 1); - - $tests[] = array($node, <<loadTemplate("foo.twig", null, 1); -EOF - ); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php deleted file mode 100644 index 6fe5c17..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php +++ /dev/null @@ -1,83 +0,0 @@ -assertNull($node->getNode('variables')); - $this->assertEquals($expr, $node->getNode('expr')); - $this->assertFalse($node->getAttribute('only')); - - $vars = new Twig_Node_Expression_Array(array(new Twig_Node_Expression_Constant('foo', 1), new Twig_Node_Expression_Constant(true, 1)), 1); - $node = new Twig_Node_Include($expr, $vars, true, false, 1); - $this->assertEquals($vars, $node->getNode('variables')); - $this->assertTrue($node->getAttribute('only')); - } - - public function getTests() - { - $tests = array(); - - $expr = new Twig_Node_Expression_Constant('foo.twig', 1); - $node = new Twig_Node_Include($expr, null, false, false, 1); - $tests[] = array($node, <<loadTemplate("foo.twig", null, 1)->display(\$context); -EOF - ); - - $expr = new Twig_Node_Expression_Conditional( - new Twig_Node_Expression_Constant(true, 1), - new Twig_Node_Expression_Constant('foo', 1), - new Twig_Node_Expression_Constant('foo', 1), - 0 - ); - $node = new Twig_Node_Include($expr, null, false, false, 1); - $tests[] = array($node, <<loadTemplate(((true) ? ("foo") : ("foo")), null, 1)->display(\$context); -EOF - ); - - $expr = new Twig_Node_Expression_Constant('foo.twig', 1); - $vars = new Twig_Node_Expression_Array(array(new Twig_Node_Expression_Constant('foo', 1), new Twig_Node_Expression_Constant(true, 1)), 1); - $node = new Twig_Node_Include($expr, $vars, false, false, 1); - $tests[] = array($node, <<loadTemplate("foo.twig", null, 1)->display(array_merge(\$context, array("foo" => true))); -EOF - ); - - $node = new Twig_Node_Include($expr, $vars, true, false, 1); - $tests[] = array($node, <<loadTemplate("foo.twig", null, 1)->display(array("foo" => true)); -EOF - ); - - $node = new Twig_Node_Include($expr, $vars, true, true, 1); - $tests[] = array($node, <<loadTemplate("foo.twig", null, 1)->display(array("foo" => true)); -} catch (Twig_Error_Loader \$e) { - // ignore missing template -} -EOF - ); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php b/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php deleted file mode 100644 index 901e57b..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php +++ /dev/null @@ -1,70 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals($arguments, $node->getNode('arguments')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new Twig_Node_Text('foo', 1); - $arguments = new Twig_Node(array( - 'foo' => new Twig_Node_Expression_Constant(null, 1), - 'bar' => new Twig_Node_Expression_Constant('Foo', 1), - ), array(), 1); - $node = new Twig_Node_Macro('foo', $body, $arguments, 1); - - if (PHP_VERSION_ID >= 50600) { - $declaration = ', ...$__varargs__'; - $varargs = '$__varargs__'; - } else { - $declaration = ''; - $varargs = 'func_num_args() > 2 ? array_slice(func_get_args(), 2) : array()'; - } - - return array( - array($node, <<env->mergeGlobals(array( - "foo" => \$__foo__, - "bar" => \$__bar__, - "varargs" => $varargs, - )); - - \$blocks = array(); - - ob_start(); - try { - echo "foo"; - } catch (Exception \$e) { - ob_end_clean(); - - throw \$e; - } - - return ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset()); -} -EOF - ), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php deleted file mode 100644 index 19a4be9..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php +++ /dev/null @@ -1,183 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals($blocks, $node->getNode('blocks')); - $this->assertEquals($macros, $node->getNode('macros')); - $this->assertEquals($parent, $node->getNode('parent')); - $this->assertEquals($filename, $node->getAttribute('filename')); - } - - public function getTests() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - - $tests = array(); - - $body = new Twig_Node_Text('foo', 1); - $extends = null; - $blocks = new Twig_Node(); - $macros = new Twig_Node(); - $traits = new Twig_Node(); - $filename = 'foo.twig'; - - $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); - $tests[] = array($node, <<parent = false; - - \$this->blocks = array( - ); - } - - protected function doDisplay(array \$context, array \$blocks = array()) - { - // line 1 - echo "foo"; - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function getDebugInfo() - { - return array ( 19 => 1,); - } -} -EOF - , $twig); - - $import = new Twig_Node_Import(new Twig_Node_Expression_Constant('foo.twig', 1), new Twig_Node_Expression_AssignName('macro', 1), 2); - - $body = new Twig_Node(array($import)); - $extends = new Twig_Node_Expression_Constant('layout.twig', 1); - - $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); - $tests[] = array($node, <<parent = \$this->loadTemplate("layout.twig", "foo.twig", 1); - \$this->blocks = array( - ); - } - - protected function doGetParent(array \$context) - { - return "layout.twig"; - } - - protected function doDisplay(array \$context, array \$blocks = array()) - { - // line 2 - \$context["macro"] = \$this->loadTemplate("foo.twig", "foo.twig", 2); - // line 1 - \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 26 => 1, 24 => 2, 11 => 1,); - } -} -EOF - , $twig); - - $set = new Twig_Node_Set(false, new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 4))), new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 4))), 4); - $body = new Twig_Node(array($set)); - $extends = new Twig_Node_Expression_Conditional( - new Twig_Node_Expression_Constant(true, 2), - new Twig_Node_Expression_Constant('foo', 2), - new Twig_Node_Expression_Constant('foo', 2), - 2 - ); - - $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); - $tests[] = array($node, <<loadTemplate(((true) ? ("foo") : ("foo")), "foo.twig", 2); - } - - protected function doDisplay(array \$context, array \$blocks = array()) - { - // line 4 - \$context["foo"] = "foo"; - // line 2 - \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 17 => 2, 15 => 4, 9 => 2,); - } -} -EOF - , $twig); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php b/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php deleted file mode 100644 index 4e0990f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php +++ /dev/null @@ -1,29 +0,0 @@ -assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = array(); - $tests[] = array(new Twig_Node_Print(new Twig_Node_Expression_Constant('foo', 1), 1), "// line 1\necho \"foo\";"); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php deleted file mode 100644 index 46ecf97..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $tests = array(); - - $body = new Twig_Node_Text('foo', 1); - $node = new Twig_Node_Sandbox($body, 1); - - $tests[] = array($node, <<env->getExtension('sandbox'); -if (!\$alreadySandboxed = \$sandbox->isSandboxed()) { - \$sandbox->enableSandbox(); -} -echo "foo"; -if (!\$alreadySandboxed) { - \$sandbox->disableSandbox(); -} -EOF - ); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php deleted file mode 100644 index 05e1854..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = array(); - - $tests[] = array(new Twig_Node_SandboxedPrint(new Twig_Node_Expression_Constant('foo', 1), 1), <<env->getExtension('sandbox')->ensureToStringAllowed("foo"); -EOF - ); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php deleted file mode 100644 index 62ad280..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php +++ /dev/null @@ -1,69 +0,0 @@ -assertEquals($names, $node->getNode('names')); - $this->assertEquals($values, $node->getNode('values')); - $this->assertFalse($node->getAttribute('capture')); - } - - public function getTests() - { - $tests = array(); - - $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1)), array(), 1); - $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 1)), array(), 1); - $node = new Twig_Node_Set(false, $names, $values, 1); - $tests[] = array($node, <<env->getCharset()); -EOF - ); - - $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1)), array(), 1); - $values = new Twig_Node_Text('foo', 1); - $node = new Twig_Node_Set(true, $names, $values, 1); - $tests[] = array($node, <<env->getCharset()); -EOF - ); - - $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1), new Twig_Node_Expression_AssignName('bar', 1)), array(), 1); - $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 1), new Twig_Node_Expression_Name('bar', 1)), array(), 1); - $node = new Twig_Node_Set(false, $names, $values, 1); - $tests[] = array($node, <<getVariableGetter('bar')}); -EOF - ); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php deleted file mode 100644 index 222ca09..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php +++ /dev/null @@ -1,37 +0,0 @@ -
    foo
    ', 1))); - $node = new Twig_Node_Spaceless($body, 1); - - $this->assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $body = new Twig_Node(array(new Twig_Node_Text('
    foo
    ', 1))); - $node = new Twig_Node_Spaceless($body, 1); - - return array( - array($node, <<
    foo
    "; -echo trim(preg_replace('/>\s+<', ob_get_clean())); -EOF - ), - ); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php b/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php deleted file mode 100644 index ceaf67f..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php +++ /dev/null @@ -1,28 +0,0 @@ -assertEquals('foo', $node->getAttribute('data')); - } - - public function getTests() - { - $tests = array(); - $tests[] = array(new Twig_Node_Text('foo', 1), "// line 1\necho \"foo\";"); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php deleted file mode 100644 index b5ea7aa..0000000 --- a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php +++ /dev/null @@ -1,124 +0,0 @@ -getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - - $stream = $env->parse($env->tokenize('{{ block("foo") }}', 'index')); - - $node = $stream->getNode('body')->getNode(0); - - $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); - $this->assertTrue($node->getAttribute('output')); - } - - public function testRenderParentBlockOptimizer() - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - - $stream = $env->parse($env->tokenize('{% extends "foo" %}{% block content %}{{ parent() }}{% endblock %}', 'index')); - - $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body'); - - $this->assertEquals('Twig_Node_Expression_Parent', get_class($node)); - $this->assertTrue($node->getAttribute('output')); - } - - public function testRenderVariableBlockOptimizer() - { - if (PHP_VERSION_ID >= 50400) { - return; - } - - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false)); - $stream = $env->parse($env->tokenize('{{ block(name|lower) }}', 'index')); - - $node = $stream->getNode('body')->getNode(0)->getNode(1); - - $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); - $this->assertTrue($node->getAttribute('output')); - } - - /** - * @dataProvider getTestsForForOptimizer - */ - public function testForOptimizer($template, $expected) - { - $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false)); - - $stream = $env->parse($env->tokenize($template, 'index')); - - foreach ($expected as $target => $withLoop) { - $this->assertTrue($this->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : '')); - } - } - - public function getTestsForForOptimizer() - { - return array( - array('{% for i in foo %}{% endfor %}', array('i' => false)), - - array('{% for i in foo %}{{ loop.index }}{% endfor %}', array('i' => true)), - - array('{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)), - - array('{% for i in foo %}{% include "foo" %}{% endfor %}', array('i' => true)), - - array('{% for i in foo %}{% include "foo" only %}{% endfor %}', array('i' => false)), - - array('{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', array('i' => false)), - - array('{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', array('i' => true)), - - array('{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => true)), - - array('{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)), - - array('{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => false)), - - array('{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)), - - array('{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)), - - array('{% for i in foo %}{{ include("foo") }}{% endfor %}', array('i' => true)), - - array('{% for i in foo %}{{ include("foo", with_context = false) }}{% endfor %}', array('i' => false)), - - array('{% for i in foo %}{{ include("foo", with_context = true) }}{% endfor %}', array('i' => true)), - - array('{% for i in foo %}{{ include("foo", { "foo": "bar" }, with_context = false) }}{% endfor %}', array('i' => false)), - - array('{% for i in foo %}{{ include("foo", { "foo": loop.index }, with_context = false) }}{% endfor %}', array('i' => true)), - ); - } - - public function checkForConfiguration(Twig_NodeInterface $node = null, $target, $withLoop) - { - if (null === $node) { - return; - } - - foreach ($node as $n) { - if ($n instanceof Twig_Node_For) { - if ($target === $n->getNode('value_target')->getAttribute('name')) { - return $withLoop == $n->getAttribute('with_loop'); - } - } - - $ret = $this->checkForConfiguration($n, $target, $withLoop); - if (null !== $ret) { - return $ret; - } - } - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/ParserTest.php b/vendor/twig/twig/test/Twig/Tests/ParserTest.php deleted file mode 100644 index b29dac3..0000000 --- a/vendor/twig/twig/test/Twig/Tests/ParserTest.php +++ /dev/null @@ -1,180 +0,0 @@ -getParser(); - $parser->setMacro('parent', $this->getMock('Twig_Node_Macro', array(), array(), '', null)); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unknown tag name "foo". Did you mean "for" at line 1 - */ - public function testUnknownTag() - { - $stream = new Twig_TokenStream(array( - new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1), - new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 1), - new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1), - new Twig_Token(Twig_Token::EOF_TYPE, '', 1), - )); - $parser = new Twig_Parser(new Twig_Environment($this->getMock('Twig_LoaderInterface'))); - $parser->parse($stream); - } - - /** - * @dataProvider getFilterBodyNodesData - */ - public function testFilterBodyNodes($input, $expected) - { - $parser = $this->getParser(); - - $this->assertEquals($expected, $parser->filterBodyNodes($input)); - } - - public function getFilterBodyNodesData() - { - return array( - array( - new Twig_Node(array(new Twig_Node_Text(' ', 1))), - new Twig_Node(array()), - ), - array( - $input = new Twig_Node(array(new Twig_Node_Set(false, new Twig_Node(), new Twig_Node(), 1))), - $input, - ), - array( - $input = new Twig_Node(array(new Twig_Node_Set(true, new Twig_Node(), new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 1))))), 1))), - $input, - ), - ); - } - - /** - * @dataProvider getFilterBodyNodesDataThrowsException - * @expectedException Twig_Error_Syntax - */ - public function testFilterBodyNodesThrowsException($input) - { - $parser = $this->getParser(); - - $parser->filterBodyNodes($input); - } - - public function getFilterBodyNodesDataThrowsException() - { - return array( - array(new Twig_Node_Text('foo', 1)), - array(new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 1)))))), - ); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed at line 1. - */ - public function testFilterBodyNodesWithBOM() - { - $parser = $this->getParser(); - $parser->filterBodyNodes(new Twig_Node_Text(chr(0xEF).chr(0xBB).chr(0xBF), 1)); - } - - public function testParseIsReentrant() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array( - 'autoescape' => false, - 'optimizations' => 0, - )); - $twig->addTokenParser(new TestTokenParser()); - - $parser = new Twig_Parser($twig); - - $parser->parse(new Twig_TokenStream(array( - new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1), - new Twig_Token(Twig_Token::NAME_TYPE, 'test', 1), - new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1), - new Twig_Token(Twig_Token::VAR_START_TYPE, '', 1), - new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 1), - new Twig_Token(Twig_Token::VAR_END_TYPE, '', 1), - new Twig_Token(Twig_Token::EOF_TYPE, '', 1), - ))); - - $this->assertNull($parser->getParent()); - } - - // The getVarName() must not depend on the template loaders, - // If this test does not throw any exception, that's good. - // see https://github.com/symfony/symfony/issues/4218 - public function testGetVarName() - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array( - 'autoescape' => false, - 'optimizations' => 0, - )); - - $twig->parse($twig->tokenize(<<getMock('Twig_LoaderInterface'))); - $parser->setParent(new Twig_Node()); - $parser->stream = $this->getMockBuilder('Twig_TokenStream')->disableOriginalConstructor()->getMock(); - - return $parser; - } -} - -class TestParser extends Twig_Parser -{ - public $stream; - - public function filterBodyNodes(Twig_NodeInterface $node) - { - return parent::filterBodyNodes($node); - } -} - -class TestTokenParser extends Twig_TokenParser -{ - public function parse(Twig_Token $token) - { - // simulate the parsing of another template right in the middle of the parsing of the current template - $this->parser->parse(new Twig_TokenStream(array( - new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1), - new Twig_Token(Twig_Token::NAME_TYPE, 'extends', 1), - new Twig_Token(Twig_Token::STRING_TYPE, 'base', 1), - new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1), - new Twig_Token(Twig_Token::EOF_TYPE, '', 1), - ))); - - $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); - - return new Twig_Node(array()); - } - - public function getTag() - { - return 'test'; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php deleted file mode 100644 index da97f47..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php +++ /dev/null @@ -1,101 +0,0 @@ -getMockBuilder('Twig_Profiler_Profile')->disableOriginalConstructor()->getMock(); - - $profile->expects($this->any())->method('isRoot')->will($this->returnValue(true)); - $profile->expects($this->any())->method('getName')->will($this->returnValue('main')); - $profile->expects($this->any())->method('getDuration')->will($this->returnValue(1)); - $profile->expects($this->any())->method('getMemoryUsage')->will($this->returnValue(0)); - $profile->expects($this->any())->method('getPeakMemoryUsage')->will($this->returnValue(0)); - - $subProfiles = array( - $this->getIndexProfile( - array( - $this->getEmbeddedBlockProfile(), - $this->getEmbeddedTemplateProfile( - array( - $this->getIncludedTemplateProfile(), - ) - ), - $this->getMacroProfile(), - $this->getEmbeddedTemplateProfile( - array( - $this->getIncludedTemplateProfile(), - ) - ), - ) - ), - ); - - $profile->expects($this->any())->method('getProfiles')->will($this->returnValue($subProfiles)); - $profile->expects($this->any())->method('getIterator')->will($this->returnValue(new ArrayIterator($subProfiles))); - - return $profile; - } - - private function getIndexProfile(array $subProfiles = array()) - { - return $this->generateProfile('main', 1, true, 'template', 'index.twig', $subProfiles); - } - - private function getEmbeddedBlockProfile(array $subProfiles = array()) - { - return $this->generateProfile('body', 0.0001, false, 'block', 'embedded.twig', $subProfiles); - } - - private function getEmbeddedTemplateProfile(array $subProfiles = array()) - { - return $this->generateProfile('main', 0.0001, true, 'template', 'embedded.twig', $subProfiles); - } - - private function getIncludedTemplateProfile(array $subProfiles = array()) - { - return $this->generateProfile('main', 0.0001, true, 'template', 'included.twig', $subProfiles); - } - - private function getMacroProfile(array $subProfiles = array()) - { - return $this->generateProfile('foo', 0.0001, false, 'macro', 'index.twig', $subProfiles); - } - - /** - * @param string $name - * @param float $duration - * @param bool $isTemplate - * @param string $type - * @param string $templateName - * @param array $subProfiles - * - * @return Twig_Profiler_Profile - */ - private function generateProfile($name, $duration, $isTemplate, $type, $templateName, array $subProfiles = array()) - { - $profile = $this->getMockBuilder('Twig_Profiler_Profile')->disableOriginalConstructor()->getMock(); - - $profile->expects($this->any())->method('isRoot')->will($this->returnValue(false)); - $profile->expects($this->any())->method('getName')->will($this->returnValue($name)); - $profile->expects($this->any())->method('getDuration')->will($this->returnValue($duration)); - $profile->expects($this->any())->method('getMemoryUsage')->will($this->returnValue(0)); - $profile->expects($this->any())->method('getPeakMemoryUsage')->will($this->returnValue(0)); - $profile->expects($this->any())->method('isTemplate')->will($this->returnValue($isTemplate)); - $profile->expects($this->any())->method('getType')->will($this->returnValue($type)); - $profile->expects($this->any())->method('getTemplate')->will($this->returnValue($templateName)); - $profile->expects($this->any())->method('getProfiles')->will($this->returnValue($subProfiles)); - $profile->expects($this->any())->method('getIterator')->will($this->returnValue(new ArrayIterator($subProfiles))); - - return $profile; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php deleted file mode 100644 index 1a1b9d2..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertStringMatchesFormat(<<index.twig//1 %d %d %d -index.twig==>embedded.twig::block(body)//1 %d %d 0 -index.twig==>embedded.twig//2 %d %d %d -embedded.twig==>included.twig//2 %d %d %d -index.twig==>index.twig::macro(foo)//1 %d %d %d -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php deleted file mode 100644 index 66a68c4..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertStringMatchesFormat(<<main %d.%dms/%d% -└ index.twig %d.%dms/%d% - └ embedded.twig::block(body) - └ embedded.twig - │ └ included.twig - └ index.twig::macro(foo) - └ embedded.twig - └ included.twig - -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php deleted file mode 100644 index e2ea165..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertStringMatchesFormat(<<dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php deleted file mode 100644 index f786f06..0000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php +++ /dev/null @@ -1,100 +0,0 @@ -assertEquals('template', $profile->getTemplate()); - $this->assertEquals('type', $profile->getType()); - $this->assertEquals('name', $profile->getName()); - } - - public function testIsRoot() - { - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT); - $this->assertTrue($profile->isRoot()); - - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::TEMPLATE); - $this->assertFalse($profile->isRoot()); - } - - public function testIsTemplate() - { - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::TEMPLATE); - $this->assertTrue($profile->isTemplate()); - - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT); - $this->assertFalse($profile->isTemplate()); - } - - public function testIsBlock() - { - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::BLOCK); - $this->assertTrue($profile->isBlock()); - - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT); - $this->assertFalse($profile->isBlock()); - } - - public function testIsMacro() - { - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::MACRO); - $this->assertTrue($profile->isMacro()); - - $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT); - $this->assertFalse($profile->isMacro()); - } - - public function testGetAddProfile() - { - $profile = new Twig_Profiler_Profile(); - $profile->addProfile($a = new Twig_Profiler_Profile()); - $profile->addProfile($b = new Twig_Profiler_Profile()); - - $this->assertSame(array($a, $b), $profile->getProfiles()); - $this->assertSame(array($a, $b), iterator_to_array($profile)); - } - - public function testGetDuration() - { - $profile = new Twig_Profiler_Profile(); - usleep(1); - $profile->leave(); - - $this->assertTrue($profile->getDuration() > 0, sprintf('Expected duration > 0, got: %f', $profile->getDuration())); - } - - public function testSerialize() - { - $profile = new Twig_Profiler_Profile('template', 'type', 'name'); - $profile1 = new Twig_Profiler_Profile('template1', 'type1', 'name1'); - $profile->addProfile($profile1); - $profile->leave(); - $profile1->leave(); - - $profile2 = unserialize(serialize($profile)); - $profiles = $profile->getProfiles(); - $this->assertCount(1, $profiles); - $profile3 = $profiles[0]; - - $this->assertEquals($profile->getTemplate(), $profile2->getTemplate()); - $this->assertEquals($profile->getType(), $profile2->getType()); - $this->assertEquals($profile->getName(), $profile2->getName()); - $this->assertEquals($profile->getDuration(), $profile2->getDuration()); - - $this->assertEquals($profile1->getTemplate(), $profile3->getTemplate()); - $this->assertEquals($profile1->getType(), $profile3->getType()); - $this->assertEquals($profile1->getName(), $profile3->getName()); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/vendor/twig/twig/test/Twig/Tests/TemplateTest.php deleted file mode 100644 index 37836fd..0000000 --- a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php +++ /dev/null @@ -1,693 +0,0 @@ -getMockForAbstractClass('Twig_Template', array(), '', false); - $template->displayBlock('foo', array(), array('foo' => array(new stdClass(), 'foo'))); - } - - /** - * @dataProvider getAttributeExceptions - */ - public function testGetAttributeExceptions($template, $message, $useExt) - { - $name = 'index_'.($useExt ? 1 : 0); - $templates = array( - $name => $template.$useExt, // appending $useExt makes the template content unique - ); - - $env = new Twig_Environment(new Twig_Loader_Array($templates), array('strict_variables' => true)); - if (!$useExt) { - $env->addNodeVisitor(new CExtDisablingNodeVisitor()); - } - $template = $env->loadTemplate($name); - - $context = array( - 'string' => 'foo', - 'null' => null, - 'empty_array' => array(), - 'array' => array('foo' => 'foo'), - 'array_access' => new Twig_TemplateArrayAccessObject(), - 'magic_exception' => new Twig_TemplateMagicPropertyObjectWithException(), - 'object' => new stdClass(), - ); - - try { - $template->render($context); - $this->fail('Accessing an invalid attribute should throw an exception.'); - } catch (Twig_Error_Runtime $e) { - $this->assertSame(sprintf($message, $name), $e->getMessage()); - } - } - - public function getAttributeExceptions() - { - $tests = array( - array('{{ string["a"] }}', 'Impossible to access a key ("a") on a string variable ("foo") in "%s" at line 1', false), - array('{{ null["a"] }}', 'Impossible to access a key ("a") on a null variable in "%s" at line 1', false), - array('{{ empty_array["a"] }}', 'Key "a" does not exist as the array is empty in "%s" at line 1', false), - array('{{ array["a"] }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false), - array('{{ array_access["a"] }}', 'Key "a" in object with ArrayAccess of class "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), - array('{{ string.a }}', 'Impossible to access an attribute ("a") on a string variable ("foo") in "%s" at line 1', false), - array('{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1', false), - array('{{ null.a }}', 'Impossible to access an attribute ("a") on a null variable in "%s" at line 1', false), - array('{{ null.a() }}', 'Impossible to invoke a method ("a") on a null variable in "%s" at line 1', false), - array('{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1', false), - array('{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false), - array('{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1', false), - array('{{ array_access.a }}', 'Method "a" for object "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), - array('{% from _self import foo %}{% macro foo(obj) %}{{ obj.missing_method() }}{% endmacro %}{{ foo(array_access) }}', 'Method "missing_method" for object "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), - array('{{ magic_exception.test }}', 'An exception has been thrown during the rendering of a template ("Hey! Don\'t try to isset me!") in "%s" at line 1.', false), - array('{{ object["a"] }}', 'Impossible to access a key "a" on an object of class "stdClass" that does not implement ArrayAccess interface in "%s" at line 1', false), - ); - - if (function_exists('twig_template_get_attributes')) { - foreach (array_slice($tests, 0) as $test) { - $test[2] = true; - $tests[] = $test; - } - } - - return $tests; - } - - public function testGetSource() - { - $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), false); - - $this->assertSame("\n", $template->getSource()); - } - - /** - * @dataProvider getGetAttributeWithSandbox - */ - public function testGetAttributeWithSandbox($object, $item, $allowed, $useExt) - { - $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - $policy = new Twig_Sandbox_SecurityPolicy(array(), array(), array(/*method*/), array(/*prop*/), array()); - $twig->addExtension(new Twig_Extension_Sandbox($policy, !$allowed)); - $template = new Twig_TemplateTest($twig, $useExt); - - try { - $template->getAttribute($object, $item, array(), 'any'); - - if (!$allowed) { - $this->fail(); - } - } catch (Twig_Sandbox_SecurityError $e) { - if ($allowed) { - $this->fail(); - } - - $this->assertContains('is not allowed', $e->getMessage()); - } - } - - public function getGetAttributeWithSandbox() - { - $tests = array( - array(new Twig_TemplatePropertyObject(), 'defined', false, false), - array(new Twig_TemplatePropertyObject(), 'defined', true, false), - array(new Twig_TemplateMethodObject(), 'defined', false, false), - array(new Twig_TemplateMethodObject(), 'defined', true, false), - ); - - if (function_exists('twig_template_get_attributes')) { - foreach (array_slice($tests, 0) as $test) { - $test[3] = true; - $tests[] = $test; - } - } - - return $tests; - } - - /** - * @dataProvider getGetAttributeWithTemplateAsObject - */ - public function testGetAttributeWithTemplateAsObject($useExt) - { - $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt); - $template1 = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), false); - - $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'string')); - $this->assertEquals('some_string', $template->getAttribute($template1, 'string')); - - $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'true')); - $this->assertEquals('1', $template->getAttribute($template1, 'true')); - - $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'zero')); - $this->assertEquals('0', $template->getAttribute($template1, 'zero')); - - $this->assertNotInstanceof('Twig_Markup', $template->getAttribute($template1, 'empty')); - $this->assertSame('', $template->getAttribute($template1, 'empty')); - - $this->assertFalse($template->getAttribute($template1, 'env', array(), Twig_Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'environment', array(), Twig_Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'getEnvironment', array(), Twig_Template::METHOD_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'displayWithErrorHandling', array(), Twig_Template::METHOD_CALL, true)); - } - - public function getGetAttributeWithTemplateAsObject() - { - $bools = array( - array(false), - ); - - if (function_exists('twig_template_get_attributes')) { - $bools[] = array(true); - } - - return $bools; - } - - /** - * @dataProvider getTestsDependingOnExtensionAvailability - */ - public function testGetAttributeOnArrayWithConfusableKey($useExt = false) - { - $template = new Twig_TemplateTest( - new Twig_Environment($this->getMock('Twig_LoaderInterface')), - $useExt - ); - - $array = array('Zero', 'One', -1 => 'MinusOne', '' => 'EmptyString', '1.5' => 'FloatButString', '01' => 'IntegerButStringWithLeadingZeros'); - - $this->assertSame('Zero', $array[false]); - $this->assertSame('One', $array[true]); - $this->assertSame('One', $array[1.5]); - $this->assertSame('One', $array['1']); - $this->assertSame('MinusOne', $array[-1.5]); - $this->assertSame('FloatButString', $array['1.5']); - $this->assertSame('IntegerButStringWithLeadingZeros', $array['01']); - $this->assertSame('EmptyString', $array[null]); - - $this->assertSame('Zero', $template->getAttribute($array, false), 'false is treated as 0 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, true), 'true is treated as 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, 1.5), 'float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, '1'), '"1" is treated as integer 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('MinusOne', $template->getAttribute($array, -1.5), 'negative float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('FloatButString', $template->getAttribute($array, '1.5'), '"1.5" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('IntegerButStringWithLeadingZeros', $template->getAttribute($array, '01'), '"01" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('EmptyString', $template->getAttribute($array, null), 'null is treated as "" when accessing an array (equals PHP behavior)'); - } - - public function getTestsDependingOnExtensionAvailability() - { - if (function_exists('twig_template_get_attributes')) { - return array(array(false), array(true)); - } - - return array(array(false)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttribute($defined, $value, $object, $item, $arguments, $type, $useExt = false) - { - $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt); - - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false, $exceptionMessage = null) - { - $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true)), $useExt); - - if ($defined) { - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } else { - try { - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - - throw new Exception('Expected Twig_Error_Runtime exception.'); - } catch (Twig_Error_Runtime $e) { - if (null !== $exceptionMessage) { - $this->assertSame($exceptionMessage, $e->getMessage()); - } - } - } - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type, $useExt = false) - { - $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt); - - $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false) - { - $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true)), $useExt); - - $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); - } - - /** - * @dataProvider getTestsDependingOnExtensionAvailability - */ - public function testGetAttributeCallExceptions($useExt = false) - { - $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt); - - $object = new Twig_TemplateMagicMethodExceptionObject(); - - $this->assertNull($template->getAttribute($object, 'foo')); - } - - public function getGetAttributeTests() - { - $array = array( - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - '09' => '09', - '+4' => '+4', - ); - - $objectArray = new Twig_TemplateArrayAccessObject(); - $stdObject = (object) $array; - $magicPropertyObject = new Twig_TemplateMagicPropertyObject(); - $propertyObject = new Twig_TemplatePropertyObject(); - $propertyObject1 = new Twig_TemplatePropertyObjectAndIterator(); - $propertyObject2 = new Twig_TemplatePropertyObjectAndArrayAccess(); - $propertyObject3 = new Twig_TemplatePropertyObjectDefinedWithUndefinedValue(); - $methodObject = new Twig_TemplateMethodObject(); - $magicMethodObject = new Twig_TemplateMagicMethodObject(); - - $anyType = Twig_Template::ANY_CALL; - $methodType = Twig_Template::METHOD_CALL; - $arrayType = Twig_Template::ARRAY_CALL; - - $basicTests = array( - // array(defined, value, property to fetch) - array(true, 'defined', 'defined'), - array(false, null, 'undefined'), - array(false, null, 'protected'), - array(true, 0, 'zero'), - array(true, 1, 1), - array(true, 1, 1.0), - array(true, null, 'null'), - array(true, true, 'bar'), - array(true, '09', '09'), - array(true, '+4', '+4'), - ); - $testObjects = array( - // array(object, type of fetch) - array($array, $arrayType), - array($objectArray, $arrayType), - array($stdObject, $anyType), - array($magicPropertyObject, $anyType), - array($methodObject, $methodType), - array($methodObject, $anyType), - array($propertyObject, $anyType), - array($propertyObject1, $anyType), - array($propertyObject2, $anyType), - ); - - $tests = array(); - foreach ($testObjects as $testObject) { - foreach ($basicTests as $test) { - // properties cannot be numbers - if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { - continue; - } - - if ('+4' === $test[2] && $methodObject === $testObject[0]) { - continue; - } - - $tests[] = array($test[0], $test[1], $testObject[0], $test[2], array(), $testObject[1]); - } - } - - // additional properties tests - $tests = array_merge($tests, array( - array(true, null, $propertyObject3, 'foo', array(), $anyType), - )); - - // additional method tests - $tests = array_merge($tests, array( - array(true, 'defined', $methodObject, 'defined', array(), $methodType), - array(true, 'defined', $methodObject, 'DEFINED', array(), $methodType), - array(true, 'defined', $methodObject, 'getDefined', array(), $methodType), - array(true, 'defined', $methodObject, 'GETDEFINED', array(), $methodType), - array(true, 'static', $methodObject, 'static', array(), $methodType), - array(true, 'static', $methodObject, 'getStatic', array(), $methodType), - - array(true, '__call_undefined', $magicMethodObject, 'undefined', array(), $methodType), - array(true, '__call_UNDEFINED', $magicMethodObject, 'UNDEFINED', array(), $methodType), - )); - - // add the same tests for the any type - foreach ($tests as $test) { - if ($anyType !== $test[5]) { - $test[5] = $anyType; - $tests[] = $test; - } - } - - $methodAndPropObject = new Twig_TemplateMethodAndPropObject(); - - // additional method tests - $tests = array_merge($tests, array( - array(true, 'a', $methodAndPropObject, 'a', array(), $anyType), - array(true, 'a', $methodAndPropObject, 'a', array(), $methodType), - array(false, null, $methodAndPropObject, 'a', array(), $arrayType), - - array(true, 'b_prop', $methodAndPropObject, 'b', array(), $anyType), - array(true, 'b', $methodAndPropObject, 'B', array(), $anyType), - array(true, 'b', $methodAndPropObject, 'b', array(), $methodType), - array(true, 'b', $methodAndPropObject, 'B', array(), $methodType), - array(false, null, $methodAndPropObject, 'b', array(), $arrayType), - - array(false, null, $methodAndPropObject, 'c', array(), $anyType), - array(false, null, $methodAndPropObject, 'c', array(), $methodType), - array(false, null, $methodAndPropObject, 'c', array(), $arrayType), - - )); - - // tests when input is not an array or object - $tests = array_merge($tests, array( - array(false, null, 42, 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a integer variable ("42")'), - array(false, null, 'string', 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a string variable ("string")'), - array(false, null, array(), 'a', array(), $anyType, false, 'Key "a" does not exist as the array is empty'), - )); - - // add twig_template_get_attributes tests - - if (function_exists('twig_template_get_attributes')) { - foreach (array_slice($tests, 0) as $test) { - $test = array_pad($test, 7, null); - $test[6] = true; - $tests[] = $test; - } - } - - return $tests; - } -} - -class Twig_TemplateTest extends Twig_Template -{ - protected $useExtGetAttribute = false; - - public function __construct(Twig_Environment $env, $useExtGetAttribute = false) - { - parent::__construct($env); - $this->useExtGetAttribute = $useExtGetAttribute; - self::$cache = array(); - } - - public function getZero() - { - return 0; - } - - public function getEmpty() - { - return ''; - } - - public function getString() - { - return 'some_string'; - } - - public function getTrue() - { - return true; - } - - public function getTemplateName() - { - } - - public function getDebugInfo() - { - return array(); - } - - protected function doGetParent(array $context) - { - } - - protected function doDisplay(array $context, array $blocks = array()) - { - } - - public function getAttribute($object, $item, array $arguments = array(), $type = Twig_Template::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) - { - if ($this->useExtGetAttribute) { - return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); - } else { - return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); - } - } -} -/* */ -/* */ - -class Twig_TemplateArrayAccessObject implements ArrayAccess -{ - protected $protected = 'protected'; - - public $attributes = array( - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - '09' => '09', - '+4' => '+4', - ); - - public function offsetExists($name) - { - return array_key_exists($name, $this->attributes); - } - - public function offsetGet($name) - { - return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } - - public function offsetSet($name, $value) - { - } - - public function offsetUnset($name) - { - } -} - -class Twig_TemplateMagicPropertyObject -{ - public $defined = 'defined'; - - public $attributes = array( - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - '09' => '09', - '+4' => '+4', - ); - - protected $protected = 'protected'; - - public function __isset($name) - { - return array_key_exists($name, $this->attributes); - } - - public function __get($name) - { - return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } -} - -class Twig_TemplateMagicPropertyObjectWithException -{ - public function __isset($key) - { - throw new Exception('Hey! Don\'t try to isset me!'); - } -} - -class Twig_TemplatePropertyObject -{ - public $defined = 'defined'; - public $zero = 0; - public $null = null; - public $bar = true; - - protected $protected = 'protected'; -} - -class Twig_TemplatePropertyObjectAndIterator extends Twig_TemplatePropertyObject implements IteratorAggregate -{ - public function getIterator() - { - return new ArrayIterator(array('foo', 'bar')); - } -} - -class Twig_TemplatePropertyObjectAndArrayAccess extends Twig_TemplatePropertyObject implements ArrayAccess -{ - private $data = array(); - - public function offsetExists($offset) - { - return array_key_exists($offset, $this->data); - } - - public function offsetGet($offset) - { - return $this->offsetExists($offset) ? $this->data[$offset] : 'n/a'; - } - - public function offsetSet($offset, $value) - { - } - - public function offsetUnset($offset) - { - } -} - -class Twig_TemplatePropertyObjectDefinedWithUndefinedValue -{ - public $foo; - - public function __construct() - { - $this->foo = @$notExist; - } -} - -class Twig_TemplateMethodObject -{ - public function getDefined() - { - return 'defined'; - } - - public function get1() - { - return 1; - } - - public function get09() - { - return '09'; - } - - public function getZero() - { - return 0; - } - - public function getNull() - { - } - - public function isBar() - { - return true; - } - - protected function getProtected() - { - return 'protected'; - } - - public static function getStatic() - { - return 'static'; - } -} - -class Twig_TemplateMethodAndPropObject -{ - private $a = 'a_prop'; - public function getA() - { - return 'a'; - } - - public $b = 'b_prop'; - public function getB() - { - return 'b'; - } - - private $c = 'c_prop'; - private function getC() - { - return 'c'; - } -} - -class Twig_TemplateMagicMethodObject -{ - public function __call($method, $arguments) - { - return '__call_'.$method; - } -} - -class Twig_TemplateMagicMethodExceptionObject -{ - public function __call($method, $arguments) - { - throw new BadMethodCallException(sprintf('Unkown method %s', $method)); - } -} - -class CExtDisablingNodeVisitor implements Twig_NodeVisitorInterface -{ - public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) - { - if ($node instanceof Twig_Node_Expression_GetAttr) { - $node->setAttribute('disable_c_ext', true); - } - - return $node; - } - - public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php b/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php deleted file mode 100644 index fd4ec63..0000000 --- a/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php +++ /dev/null @@ -1,70 +0,0 @@ -isEOF()) { - $token = $stream->next(); - - $repr[] = $token->getValue(); - } - $this->assertEquals('1, 2, 3, 4, 5, 6, 7', implode(', ', $repr), '->next() advances the pointer and returns the current token'); - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedMessage Unexpected end of template - */ - public function testEndOfTemplateNext() - { - $stream = new Twig_TokenStream(array( - new Twig_Token(Twig_Token::BLOCK_START_TYPE, 1, 1), - )); - while (!$stream->isEOF()) { - $stream->next(); - } - } - - /** - * @expectedException Twig_Error_Syntax - * @expectedMessage Unexpected end of template - */ - public function testEndOfTemplateLook() - { - $stream = new Twig_TokenStream(array( - new Twig_Token(Twig_Token::BLOCK_START_TYPE, 1, 1), - )); - while (!$stream->isEOF()) { - $stream->look(); - $stream->next(); - } - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/escapingTest.php b/vendor/twig/twig/test/Twig/Tests/escapingTest.php deleted file mode 100644 index 7b765ca..0000000 --- a/vendor/twig/twig/test/Twig/Tests/escapingTest.php +++ /dev/null @@ -1,320 +0,0 @@ - ''', - '"' => '"', - '<' => '<', - '>' => '>', - '&' => '&', - ); - - protected $htmlAttrSpecialChars = array( - '\'' => ''', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => 'Ā', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '-' => '-', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => ' ', - "\n" => ' ', - "\t" => ' ', - "\0" => '�', // should use Unicode replacement char - /* Encode chars as named entities where possible */ - '<' => '<', - '>' => '>', - '&' => '&', - '"' => '"', - /* Encode spaces for quoteless attribute protection */ - ' ' => ' ', - ); - - protected $jsSpecialChars = array( - /* HTML special chars - escape without exception to hex */ - '<' => '\\x3C', - '>' => '\\x3E', - '\'' => '\\x27', - '"' => '\\x22', - '&' => '\\x26', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\u0100', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\\x0D', - "\n" => '\\x0A', - "\t" => '\\x09', - "\0" => '\\x00', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\x20', - ); - - protected $urlSpecialChars = array( - /* HTML special chars - escape without exception to percent encoding */ - '<' => '%3C', - '>' => '%3E', - '\'' => '%27', - '"' => '%22', - '&' => '%26', - /* Characters beyond ASCII value 255 to hex sequence */ - 'Ā' => '%C4%80', - /* Punctuation and unreserved check */ - ',' => '%2C', - '.' => '.', - '_' => '_', - '-' => '-', - ':' => '%3A', - ';' => '%3B', - '!' => '%21', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '%0D', - "\n" => '%0A', - "\t" => '%09', - "\0" => '%00', - /* PHP quirks from the past */ - ' ' => '%20', - '~' => '~', - '+' => '%2B', - ); - - protected $cssSpecialChars = array( - /* HTML special chars - escape without exception to hex */ - '<' => '\\3C ', - '>' => '\\3E ', - '\'' => '\\27 ', - '"' => '\\22 ', - '&' => '\\26 ', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\100 ', - /* Immune chars excluded */ - ',' => '\\2C ', - '.' => '\\2E ', - '_' => '\\5F ', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\\D ', - "\n" => '\\A ', - "\t" => '\\9 ', - "\0" => '\\0 ', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\20 ', - ); - - protected $env; - - public function setUp() - { - $this->env = new Twig_Environment($this->getMock('Twig_LoaderInterface')); - } - - public function testHtmlEscapingConvertsSpecialChars() - { - foreach ($this->htmlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html'), 'Failed to escape: '.$key); - } - } - - public function testHtmlAttributeEscapingConvertsSpecialChars() - { - foreach ($this->htmlAttrSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html_attr'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingConvertsSpecialChars() - { - foreach ($this->jsSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'js'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingReturnsStringIfZeroLength() - { - $this->assertEquals('', twig_escape_filter($this->env, '', 'js')); - } - - public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits() - { - $this->assertEquals('123', twig_escape_filter($this->env, '123', 'js')); - } - - public function testCssEscapingConvertsSpecialChars() - { - foreach ($this->cssSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'css'), 'Failed to escape: '.$key); - } - } - - public function testCssEscapingReturnsStringIfZeroLength() - { - $this->assertEquals('', twig_escape_filter($this->env, '', 'css')); - } - - public function testCssEscapingReturnsStringIfContainsOnlyDigits() - { - $this->assertEquals('123', twig_escape_filter($this->env, '123', 'css')); - } - - public function testUrlEscapingConvertsSpecialChars() - { - foreach ($this->urlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'url'), 'Failed to escape: '.$key); - } - } - - /** - * Range tests to confirm escaped range of characters is within OWASP recommendation. - */ - - /** - * Only testing the first few 2 ranges on this prot. function as that's all these - * other range tests require. - */ - public function testUnicodeCodepointConversionToUtf8() - { - $expected = ' ~ޙ'; - $codepoints = array(0x20, 0x7e, 0x799); - $result = ''; - foreach ($codepoints as $value) { - $result .= $this->codepointToUtf8($value); - } - $this->assertEquals($expected, $result); - } - - /** - * Convert a Unicode Codepoint to a literal UTF-8 character. - * - * @param int $codepoint Unicode codepoint in hex notation - * - * @return string UTF-8 literal string - */ - protected function codepointToUtf8($codepoint) - { - if ($codepoint < 0x80) { - return chr($codepoint); - } - if ($codepoint < 0x800) { - return chr($codepoint >> 6 & 0x3f | 0xc0) - .chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x10000) { - return chr($codepoint >> 12 & 0x0f | 0xe0) - .chr($codepoint >> 6 & 0x3f | 0x80) - .chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x110000) { - return chr($codepoint >> 18 & 0x07 | 0xf0) - .chr($codepoint >> 12 & 0x3f | 0x80) - .chr($codepoint >> 6 & 0x3f | 0x80) - .chr($codepoint & 0x3f | 0x80); - } - throw new Exception('Codepoint requested outside of Unicode range'); - } - - public function testJavascriptEscapingEscapesOwaspRecommendedRanges() - { - $immune = array(',', '.', '_'); // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); - } else { - $literal = $this->codepointToUtf8($chr); - if (in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'js'), - "$literal should be escaped!"); - } - } - } - } - - public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() - { - $immune = array(',', '.', '-', '_'); // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); - } else { - $literal = $this->codepointToUtf8($chr); - if (in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'html_attr'), - "$literal should be escaped!"); - } - } - } - } - - public function testCssEscapingEscapesOwaspRecommendedRanges() - { - // CSS has no exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'css')); - } else { - $literal = $this->codepointToUtf8($chr); - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'css'), - "$literal should be escaped!"); - } - } - } -} diff --git a/vendor/twig/twig/test/bootstrap.php b/vendor/twig/twig/test/bootstrap.php deleted file mode 100644 index aecb976..0000000 --- a/vendor/twig/twig/test/bootstrap.php +++ /dev/null @@ -1,13 +0,0 @@ -