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' - -
Some accentués characters
- Téléphone - -
- DaPhone - -
Test
- 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. - -
- 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. - -
Hi
This is a test.
R&D
line1
"; - $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 = ' - - - FooBarBaz - - '; - - $doc = $this->parse($html); - $length = $doc->getElementsByTagName('ul')->item(0)->childNodes->length; - $this->assertEquals(3, $length); - } - - public function testMathML() - { - $html = ' - - - - x - - ± - - y - - - '; - - $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 = ' - - - - - - - Test Text. - - - - - '; - - $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 = 'No JS'; - $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 = 'Test'; - $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 = ''; - - $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 @@ -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 @@ - - - - - Test - - - This is a test. - - \ 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 @@ -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('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('', $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 = " - - Test - - - This is a test. - -"; - $this->assertEquals($text, $s->charsUntil("\t")); - } - - public function testCharsWhile() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('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 @@ -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 @@ -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 @@ -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 @@ -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( - '&' => '&', - '<' => '<', - '&' => '&', - '&' => '&' - ); - $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 = 'oo'; - $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. +>', - '', - '', - '', - '', - '', - '', - '', - '', - ' 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', - '' => 'test', - '' => 'test', - '' => 'thisisthetagthatdoesntenditjustgoesonandonmyfriend', - // See 8.2.4.10, which requires this and does not say error. - '' => 'aisAllGood('endTag', 2, $succeed); - - // Recoverable failures - $fail = array( - '' => 'a', - '' => 'a', - '' => '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', - '' => ' 1 > 0 ', - '' => ' --$i ', - '' => '--$i', - '' => ' 1 > 0 ', - "" => "\nHello World.\na", - '' => ' ' => '', - '' => '', - '' => '' - ); - 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( - ' '&Hello world' => 'Hello world' - ); - foreach ($bad as $test => $expects) { - $events = $this->parse($test); - $this->assertEquals(4, $events->depth(), "Counting events for '$test': " . print_r($events, true)); - $this->assertEventEquals('startTag', 'script', $events->get(0)); - $this->assertEventError($events->get(1)); - $this->assertEventEquals('text', $expects, $events->get(2)); - } - - // Testing case sensitivity - $events = $this->parse('a test'); - $this->assertEventEquals('startTag', 'title', $events->get(0)); - $this->assertEventEquals('text', 'a test', $events->get(1)); - $this->assertEventEquals('endTag', 'title', $events->get(2)); - - // Testing end tags with whitespaces - $events = $this->parse('Whitespaces are tasty'); - $this->assertEventEquals('startTag', 'title', $events->get(0)); - $this->assertEventEquals('text', 'Whitespaces are tasty', $events->get(1)); - $this->assertEventEquals('endTag', 'title', $events->get(2)); - } - - public function testRcdata() - { - list ($tok, $events) = $this->createTokenizer('''); - $tok->setTextMode(\Masterminds\HTML5\Elements::TEXT_RCDATA, 'title'); - $tok->parse(); - $this->assertEventEquals('text', "'", $events->get(1)); - } - - public function testText() - { - $events = $this->parse('ab'); - $this->assertEquals(4, $events->depth(), "Events: " . print_r($events, true)); - $this->assertEventEquals('text', 'a', $events->get(0)); - $this->assertEventEquals('startTag', 'br', $events->get(1)); - $this->assertEventEquals('text', 'b', $events->get(2)); - - $events = $this->parse('Test'); - $this->assertEquals(4, $events->depth(), "Events: " . print_r($events, true)); - $this->assertEventEquals('startTag', 'a', $events->get(0)); - $this->assertEventEquals('text', 'Test', $events->get(1)); - $this->assertEventEquals('endTag', 'a', $events->get(2)); - - $events = $this->parse('01'); - $this->assertEquals(7, $events->depth(), "Events: " . print_r($events, true)); - - $this->assertEventEquals('startTag', 'p', $events->get(0)); - $this->assertEventEquals('text', '0', $events->get(1)); - $this->assertEventEquals('endTag', 'p', $events->get(2)); - - $this->assertEventEquals('startTag', 'p', $events->get(3)); - $this->assertEventEquals('text', '1', $events->get(4)); - $this->assertEventEquals('endTag', 'p', $events->get(5)); - - - $events = $this->parse('ab'); - $this->assertEquals(4, $events->depth(), "Events: " . print_r($events, true)); - $this->assertEventEquals('text', 'a', $events->get(0)); - $this->assertEventEquals('cdata', 'test', $events->get(1)); - $this->assertEventEquals('text', 'b', $events->get(2)); - - $events = $this->parse('ab'); - $this->assertEquals(4, $events->depth(), "Events: " . print_r($events, true)); - $this->assertEventEquals('text', 'a', $events->get(0)); - $this->assertEventEquals('comment', 'test', $events->get(1)); - $this->assertEventEquals('text', 'b', $events->get(2)); - - $events = $this->parse('a&b'); - $this->assertEquals(2, $events->depth(), "Events: " . print_r($events, true)); - $this->assertEventEquals('text', 'a&b', $events->get(0)); - } - - // ================================================================ - // Utility functions. - // ================================================================ - protected function createTokenizer($string, $debug = false) - { - $eventHandler = new EventStack(); - $stream = new StringInputStream($string); - $scanner = new Scanner($stream); - - $scanner->debug = $debug; - - return array( - new Tokenizer($scanner, $eventHandler), - $eventHandler - ); - } - - public function parse($string, $debug = false) - { - list ($tok, $events) = $this->createTokenizer($string, $debug); - $tok->parse(); - - return $events; - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/TreeBuildingRulesTest.php b/vendor/masterminds/html5/test/HTML5/Parser/TreeBuildingRulesTest.php deleted file mode 100644 index bff2530..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/TreeBuildingRulesTest.php +++ /dev/null @@ -1,104 +0,0 @@ -test%s'; - - /** - * Convenience function for parsing. - */ - protected function parse($string) - { - $treeBuilder = new DOMTreeBuilder(); - $scanner = new Scanner(new StringInputStream($string)); - $parser = new Tokenizer($scanner, $treeBuilder); - - $parser->parse(); - return $treeBuilder->document(); - } - /** - * Convenience function for parsing fragments. - */ - protected function parseFragment($string) - { - $events = new DOMTreeBuilder(true); - $scanner = new Scanner(new StringInputStream($string)); - $parser = new Tokenizer($scanner, $events); - - $parser->parse(); - return $events->fragment(); - } - - public function testTDFragment() - { - - $frag = $this->parseFragment("This is a test of the HTML5 parser"); - - $td = $frag->childNodes->item(0); - - $this->assertEquals(1, $frag->childNodes->length); - $this->assertEquals('td', $td->tagName); - $this->assertEquals('This is a test of the HTML5 parser', $td->nodeValue); - } - - public function testHasRules() - { - $doc = new \DOMDocument('1.0'); - $engine = new TreeBuildingRules($doc); - - $this->assertTrue($engine->hasRules('li')); - $this->assertFalse($engine->hasRules('imaginary')); - } - - public function testHandleLI() - { - $html = sprintf(self::HTML_STUB, 'testtest2'); - $doc = $this->parse($html); - - $list = $doc->getElementById('a'); - - $this->assertEquals(2, $list->childNodes->length); - foreach ($list->childNodes as $ele) { - $this->assertEquals('li', $ele->tagName); - } - } - - public function testHandleDT() - { - $html = sprintf(self::HTML_STUB, 'HelloHi'); - $doc = $this->parse($html); - - $list = $doc->getElementById('a'); - - $this->assertEquals(2, $list->childNodes->length); - $this->assertEquals('dt', $list->firstChild->tagName); - $this->assertEquals('dd', $list->lastChild->tagName); - } - - public function testTable() - { - $html = sprintf(self::HTML_STUB, 'foobarbaz'); - $doc = $this->parse($html); - - $list = $doc->getElementById('a'); - - $this->assertEquals(3, $list->childNodes->length); - $this->assertEquals('th', $list->firstChild->tagName); - $this->assertEquals('td', $list->lastChild->tagName); - } -} diff --git a/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php b/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php deleted file mode 100644 index 0e8555a..0000000 --- a/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertEquals('éà a', $out); - } - - /** - * @todo add tests for invalid codepoints - */ - public function testCheckForIllegalCodepoints() { - $smoke = "Smoke test"; - $err = UTF8Utils::checkForIllegalCodepoints($smoke); - $this->assertEmpty($err); - - $data = "Foo Bar \0 Baz"; - $errors = UTF8Utils::checkForIllegalCodepoints($data); - $this->assertContains('null-character', $errors); - } -} \ No newline at end of file diff --git a/vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php b/vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php deleted file mode 100644 index 72d1cd3..0000000 --- a/vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php +++ /dev/null @@ -1,587 +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\OutputRules'); - $method = $class->getMethod($name); - $method->setAccessible(true); - - return $method; - } - - public function getTraverserProtectedProperty($name) - { - $class = new \ReflectionClass('\Masterminds\HTML5\Serializer\Traverser'); - $property = $class->getProperty($name); - $property->setAccessible(true); - - return $property; - } - - public function getOutputRules($options = array()) - { - $options = $options + $this->html5->getOptions(); - $stream = fopen('php://temp', 'w'); - $dom = $this->html5->loadHTML($this->markup); - $r = new OutputRules($stream, $options); - $t = new Traverser($dom, $stream, $r, $options); - - return array( - $r, - $stream - ); - } - - public function testDocument() - { - $dom = $this->html5->loadHTML('foo'); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $r->document($dom); - $expected = '' . PHP_EOL . 'foo' . PHP_EOL; - $this->assertEquals($expected, stream_get_contents($stream, - 1, 0)); - } - - public function testEmptyDocument() - { - $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()); - - $r->document($dom); - $expected = '' . PHP_EOL; - $this->assertEquals($expected, stream_get_contents($stream, - 1, 0)); - } - - public function testDoctype() - { - $dom = $this->html5->loadHTML('foo'); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $m = $this->getProtectedMethod('doctype'); - $m->invoke($r, 'foo'); - $this->assertEquals("" . PHP_EOL, stream_get_contents($stream, - 1, 0)); - } - - public function testElement() - { - $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'); - $r->element($list->item(0)); - $this->assertEquals('foo bar baz', stream_get_contents($stream, - 1, 0)); - } - - function testSerializeWithNamespaces() - { - $this->html5 = $this->getInstance(array( - 'xmlNamespaces' => true - )); - - $source = ' - - - - xy - - svg - - - - y - - '; - - $dom = $this->html5->loadHTML($source, array( - 'xmlNamespaces' => true - )); - $this->assertFalse($this->html5->hasErrors(), print_r($this->html5->getErrors(), 1)); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $t->walk(); - $rendered = stream_get_contents($stream, - 1, 0); - - $clear = function($s){ - return trim(preg_replace('/[\s]+/', " ", $s)); - }; - - $this->assertEquals($clear($source), $clear($rendered)); - } - - public function testElementWithScript() - { - $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()); - - $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]+(.*)>[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 = 'foobar'; - $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('text content'); - - $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
0
1