diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..77913e9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/phpunit.xml.dist export-ignore +/tests export-ignore +/util export-ignore diff --git a/.gitignore b/.gitignore index 809b698..697e972 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -/vendor/ /build/ -composer.phar \ No newline at end of file +/vendor/ +composer.lock +composer.phar diff --git a/.travis.yml b/.travis.yml index 3b42073..d8e43bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,74 @@ -language: php +language: python -php: - - 5.5 - - 5.4 - - 5.3 +sudo: false + +python: + - 2.6 + - 2.7 + - 3.3 + - 3.4 + - 3.5 + - 3.6 + +env: + global: + - PATH="$HOME/.phpenv/bin:$HOME/.phpenv/shims:$PATH" + matrix: + - PHP_VERSION=7.1 PYGMENTS_VERSION=1.6 + - PHP_VERSION=7.1 PYGMENTS_VERSION=2.0 + - PHP_VERSION=7.1 PYGMENTS_VERSION=2.1 + - PHP_VERSION=7.1 PYGMENTS_VERSION=2.2 + - PHP_VERSION=7.0 PYGMENTS_VERSION=1.6 + - PHP_VERSION=7.0 PYGMENTS_VERSION=2.0 + - PHP_VERSION=7.0 PYGMENTS_VERSION=2.1 + - PHP_VERSION=7.0 PYGMENTS_VERSION=2.2 + - PHP_VERSION=5.6 PYGMENTS_VERSION=1.6 + - PHP_VERSION=5.6 PYGMENTS_VERSION=2.0 + - PHP_VERSION=5.6 PYGMENTS_VERSION=2.1 + - PHP_VERSION=5.6 PYGMENTS_VERSION=2.2 + +matrix: + fast_finish: true + include: + - python: 3.2 + env: PHP_VERSION=7.1 PYGMENTS_VERSION=1.6 + - python: 3.2 + env: PHP_VERSION=7.0 PYGMENTS_VERSION=1.6 + - python: 3.2 + env: PHP_VERSION=5.6 PYGMENTS_VERSION=1.6 + allow_failures: + - python: 2.6 + env: PHP_VERSION=7.1 PYGMENTS_VERSION=2.2 + - python: 2.6 + env: PHP_VERSION=7.0 PYGMENTS_VERSION=2.2 + - python: 2.6 + env: PHP_VERSION=5.6 PYGMENTS_VERSION=2.2 + +addons: + apt: + packages: + - libc-client-dev + - libtidy-dev + - libmcrypt-dev before_install: - - sudo easy_install Pygments + - ./util/install-php.sh + - eval "$(phpenv init -)" && phpenv rehash + - php --version + - php composer.phar --version + +install: + - travis_retry pip install Pygments==$PYGMENTS_VERSION + - travis_retry php composer.phar require --no-update satooshi/php-coveralls:^1.0 + - travis_retry php composer.phar install --no-interaction --prefer-dist before_script: - - composer require --no-update satooshi/php-coveralls:dev-master sensiolabs/security-checker:dev-master - - composer update --dev --no-interaction + - mkdir -p build/logs script: - - mkdir -p build/logs - - phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml - - php vendor/bin/security-checker security:check composer.lock + - ./vendor/bin/parallel-lint src tests + - ./vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml + - ./vendor/bin/phpcs src tests --standard=psr2 -sp -after_script: - - php vendor/bin/coveralls \ No newline at end of file +after_success: + - travis_retry php vendor/bin/coveralls diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ff064c4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Pygments.php - A Thin Wrapper for the Python Pygments +Copyright (c) 2013-2017 Kazuyuki Hayashi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index b2e441a..3fdcb7e 100644 --- a/README.md +++ b/README.md @@ -6,26 +6,34 @@ Pygments.php - A Thin Wrapper for the Python Pygments [![Coverage Status](https://coveralls.io/repos/kzykhys/Pygments.php/badge.png)](https://coveralls.io/r/kzykhys/Pygments.php) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/3efddd61-f6e2-4f4a-949d-9ca7230f6e56/mini.png)](https://insight.sensiolabs.com/projects/3efddd61-f6e2-4f4a-949d-9ca7230f6e56) -A PHP wrapper for the Python Pygments syntax highlighter +A PHP wrapper for [Pygments](http://pygments.org/), the Python syntax highlighter. Requirements ------------ -* PHP5.3+ -* Python 2.4+ -* Pygments (`sudo easy_install Pygments`) +* PHP 5.6+ +* Python +* Pygments (`pip install Pygments`) + +Python and Pygments versions supported: + +| Pygments: | 1.6 | 2.0 | 2.1 | 2.2 | +| :--------- | :-: | :-: | :-: | :-: | +| Python 2.6 | ✔ | ✔ | ✔ | - | +| Python 2.7 | ✔ | ✔ | ✔ | ✔ | +| Python 3.2 | ✔ | - | - | - | +| Python 3.3 | ✔ | ✔ | ✔ | ✔ | +| Python 3.4 | ✔ | ✔ | ✔ | ✔ | +| Python 3.5 | ✔ | ✔ | ✔ | ✔ | +| Python 3.6 | ✔ | ✔ | ✔ | ✔ | Installation ------------ -Create or update your composer.json and run `composer update` +Use [Composer](https://getcomposer.org) to require this package: -``` json -{ - "require": { - "kzykhys/pygments": ">=1.0" - } -} +``` +composer require kzykhys/pygments ``` Usage diff --git a/composer.json b/composer.json index 3b9833a..20ab6e3 100644 --- a/composer.json +++ b/composer.json @@ -11,15 +11,33 @@ ], "minimum-stability": "stable", "require": { - "php": ">=5.3.2", - "symfony/process": ">=2.3" + "php": "^5.6 || ^7.0", + "symfony/process": "^3.0" }, "require-dev": { - "symfony/finder": ">=2.3" + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phpunit/phpunit": "^5.7 || ^6.0", + "squizlabs/php_codesniffer": "^2.8", + "symfony/finder": "^3.0" }, "autoload": { - "psr-0": { - "": "src" + "psr-4": { + "KzykHys\\Pygments\\": "src" } + }, + "autoload-dev": { + "psr-4": { + "KzykHys\\Pygments\\Test\\": "tests" + } + }, + "scripts": { + "lint": "parallel-lint src tests", + "phpunit": "phpunit --verbose --colors=always", + "phpcs": "phpcs src tests --standard=psr2 -sp --colors", + "test": [ + "@lint", + "@phpunit", + "@phpcs" + ] } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index fa03182..0000000 --- a/composer.lock +++ /dev/null @@ -1,118 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" - ], - "hash": "d2e111fb167611c09ab96baa0504b60b", - "packages": [ - { - "name": "symfony/process", - "version": "v2.4.0", - "target-dir": "Symfony/Component/Process", - "source": { - "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "87738ff42e2467730ed74d941866e95513844b70" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/87738ff42e2467730ed74d941866e95513844b70", - "reference": "87738ff42e2467730ed74d941866e95513844b70", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Process\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "http://symfony.com", - "time": "2013-11-26 16:40:27" - } - ], - "packages-dev": [ - { - "name": "symfony/finder", - "version": "v2.4.0", - "target-dir": "Symfony/Component/Finder", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "72356bf0646b11af1bae666c28a639bd8ede459f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/72356bf0646b11af1bae666c28a639bd8ede459f", - "reference": "72356bf0646b11af1bae666c28a639bd8ede459f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Finder\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "http://symfony.com", - "time": "2013-11-26 16:40:27" - } - ], - "aliases": [ - - ], - "minimum-stability": "stable", - "stability-flags": [ - - ], - "platform": { - "php": ">=5.3.2" - }, - "platform-dev": [ - - ] -} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ad8dd7b..c0269a4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,16 @@ - - - - - - - test - - - - - - src - - - - \ No newline at end of file + + + + ./tests + + + + + ./src + + + + + + diff --git a/src/KzykHys/Pygments/Pygments.php b/src/Pygments.php similarity index 90% rename from src/KzykHys/Pygments/Pygments.php rename to src/Pygments.php index 6ebd652..b2a770a 100644 --- a/src/KzykHys/Pygments/Pygments.php +++ b/src/Pygments.php @@ -12,7 +12,6 @@ */ class Pygments { - /** * @var string */ @@ -38,7 +37,7 @@ public function __construct($pygmentize = 'pygmentize') * * @return string */ - public function highlight($code, $lexer = null, $formatter = null, $options = array()) + public function highlight($code, $lexer = null, $formatter = null, $options = []) { $builder = $this->createProcessBuilder(); @@ -53,16 +52,12 @@ public function highlight($code, $lexer = null, $formatter = null, $options = ar } if (count($options)) { - $arg = array(); - foreach ($options as $key => $value) { - $arg[] = sprintf('%s=%s', $key, $value); + $builder->add('-P')->add(sprintf('%s=%s', $key, $value)); } - - $builder->add('-O')->add(implode(',', $arg)); } - $process = $builder->getProcess()->setStdin($code); + $process = $builder->setInput($code)->getProcess(); return $this->getOutput($process); } @@ -98,7 +93,7 @@ public function getCss($style = 'default', $selector = null) public function guessLexer($fileName) { $process = $this->createProcessBuilder() - ->setArguments(array('-N', $fileName)) + ->setArguments(['-N', $fileName]) ->getProcess(); return trim($this->getOutput($process)); @@ -112,7 +107,7 @@ public function guessLexer($fileName) public function getLexers() { $process = $this->createProcessBuilder() - ->setArguments(array('-L', 'lexer')) + ->setArguments(['-L', 'lexer']) ->getProcess(); $output = $this->getOutput($process); @@ -128,7 +123,7 @@ public function getLexers() public function getFormatters() { $process = $this->createProcessBuilder() - ->setArguments(array('-L', 'formatter')) + ->setArguments(['-L', 'formatter']) ->getProcess(); $output = $this->getOutput($process); @@ -144,7 +139,7 @@ public function getFormatters() public function getStyles() { $process = $this->createProcessBuilder() - ->setArguments(array('-L', 'style')) + ->setArguments(['-L', 'style']) ->getProcess(); $output = $this->getOutput($process); @@ -182,7 +177,7 @@ protected function getOutput(Process $process) */ protected function parseList($input) { - $list = array(); + $list = []; if (preg_match_all('/^\* (.*?):\r?\n *([^\r\n]*?)$/m', $input, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { @@ -196,5 +191,4 @@ protected function parseList($input) return $list; } - -} \ No newline at end of file +} diff --git a/test/KzykHys/Pygments/PygmentsTest.php b/tests/PygmentsTest.php similarity index 69% rename from test/KzykHys/Pygments/PygmentsTest.php rename to tests/PygmentsTest.php index 2110e0d..a39a82f 100644 --- a/test/KzykHys/Pygments/PygmentsTest.php +++ b/tests/PygmentsTest.php @@ -1,24 +1,26 @@ */ -class PygmentsTest extends PHPUnit_Framework_TestCase +class PygmentsTest extends TestCase { - /** * @dataProvider provideSamples */ - public function testHighlight($input, $expected, $expectedL, $lexer) + public function testHighlight($input, $expected, $expectedL, $expectedG, $lexer) { - $pygments = new Pygments(); + $pygments = new Pygments(getenv('PYGMENTIZE_PATH')); - $this->assertEquals($expected, $pygments->highlight($input, null, 'html')); + $this->assertEquals($expectedG, $pygments->highlight($input, null, 'html')); $this->assertEquals($expected, $pygments->highlight($input, $lexer, 'html')); - $this->assertEquals($expectedL, $pygments->highlight($input, null, 'html', array('linenos' => 1))); + $this->assertEquals($expectedL, $pygments->highlight($input, null, 'html', ['linenos' => 1])); } /** @@ -26,7 +28,7 @@ public function testHighlight($input, $expected, $expectedL, $lexer) */ public function testGetCss($expected, $expectedA, $style) { - $pygments = new Pygments(); + $pygments = new Pygments(getenv('PYGMENTIZE_PATH')); $this->assertEquals($expected, $pygments->getCss($style)); $this->assertEquals($expectedA, $pygments->getCss($style, '.syntax')); @@ -34,7 +36,7 @@ public function testGetCss($expected, $expectedA, $style) public function testGetLexers() { - $pygments = new Pygments(); + $pygments = new Pygments(getenv('PYGMENTIZE_PATH')); $lexers = $pygments->getLexers(); $this->assertArrayHasKey('python', $lexers); @@ -42,7 +44,7 @@ public function testGetLexers() public function testGetFormatters() { - $pygments = new Pygments(); + $pygments = new Pygments(getenv('PYGMENTIZE_PATH')); $formatters = $pygments->getFormatters(); $this->assertArrayHasKey('html', $formatters); @@ -50,7 +52,7 @@ public function testGetFormatters() public function testGetStyles() { - $pygments = new Pygments(); + $pygments = new Pygments(getenv('PYGMENTIZE_PATH')); $styles = $pygments->getStyles(); $this->assertArrayHasKey('monokai', $styles); @@ -58,7 +60,7 @@ public function testGetStyles() public function testGuessLexer() { - $pygments = new Pygments(); + $pygments = new Pygments(getenv('PYGMENTIZE_PATH')); $this->assertEquals('php', $pygments->guessLexer('index.php')); $this->assertEquals('go', $pygments->guessLexer('main.go')); @@ -68,22 +70,22 @@ public function provideSamples() { $finder = new Finder(); $finder - ->in(__DIR__ . '/Resources/example') + ->in(__DIR__ . '/Resources/pygments-' . getenv('PYGMENTIZE_VERSION') . '/example') ->name("*.in") - ->notName('*.linenos.out') ->files() ->ignoreVCS(true); - $samples = array(); + $samples = []; /* @var \Symfony\Component\Finder\SplFileInfo $file */ foreach ($finder as $file) { - $samples[] = array( + $samples[] = [ $file->getContents(), file_get_contents(str_replace('.in', '.out', $file->getPathname())), file_get_contents(str_replace('.in', '.linenos.out', $file->getPathname())), - preg_replace('/\..*/', '', $file->getFilename()) - ); + file_get_contents(str_replace('.in', '.guess.out', $file->getPathname())), + preg_replace('/\..*/', '', $file->getFilename()), + ]; } return $samples; @@ -93,24 +95,23 @@ public function provideCss() { $finder = new Finder(); $finder - ->in(__DIR__ . '/Resources/css') + ->in(__DIR__ . '/Resources/pygments-' . getenv('PYGMENTIZE_VERSION') . '/css') ->files() ->ignoreVCS(true) ->name('*.css') ->notName('*.prefix.css'); - $css = array(); + $css = []; /* @var \Symfony\Component\Finder\SplFileInfo $file */ foreach ($finder as $file) { - $css[] = array( + $css[] = [ $file->getContents(), file_get_contents(str_replace('.css', '.prefix.css', $file->getPathname())), - str_replace('.css', '', $file->getFilename()) - ); + str_replace('.css', '', $file->getFilename()), + ]; } return $css; } - -} \ No newline at end of file +} diff --git a/test/KzykHys/Pygments/Resources/css/default.css b/tests/Resources/pygments-1.6/css/default.css similarity index 100% rename from test/KzykHys/Pygments/Resources/css/default.css rename to tests/Resources/pygments-1.6/css/default.css diff --git a/test/KzykHys/Pygments/Resources/css/default.prefix.css b/tests/Resources/pygments-1.6/css/default.prefix.css similarity index 100% rename from test/KzykHys/Pygments/Resources/css/default.prefix.css rename to tests/Resources/pygments-1.6/css/default.prefix.css diff --git a/test/KzykHys/Pygments/Resources/example/php.php.out b/tests/Resources/pygments-1.6/example/php.php.guess.out similarity index 100% rename from test/KzykHys/Pygments/Resources/example/php.php.out rename to tests/Resources/pygments-1.6/example/php.php.guess.out diff --git a/test/KzykHys/Pygments/Resources/example/php.php.in b/tests/Resources/pygments-1.6/example/php.php.in similarity index 100% rename from test/KzykHys/Pygments/Resources/example/php.php.in rename to tests/Resources/pygments-1.6/example/php.php.in diff --git a/test/KzykHys/Pygments/Resources/example/php.php.linenos.out b/tests/Resources/pygments-1.6/example/php.php.linenos.out similarity index 100% rename from test/KzykHys/Pygments/Resources/example/php.php.linenos.out rename to tests/Resources/pygments-1.6/example/php.php.linenos.out diff --git a/tests/Resources/pygments-1.6/example/php.php.out b/tests/Resources/pygments-1.6/example/php.php.out new file mode 100644 index 0000000..c5e907f --- /dev/null +++ b/tests/Resources/pygments-1.6/example/php.php.out @@ -0,0 +1,22 @@ +
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
diff --git a/tests/Resources/pygments-2.0/css/default.css b/tests/Resources/pygments-2.0/css/default.css new file mode 100644 index 0000000..251b50d --- /dev/null +++ b/tests/Resources/pygments-2.0/css/default.css @@ -0,0 +1,62 @@ +.hll { background-color: #ffffcc } +.c { color: #408080; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #008000; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.cp { color: #BC7A00 } /* Comment.Preproc */ +.c1 { color: #408080; font-style: italic } /* Comment.Single */ +.cs { color: #408080; font-style: italic } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #888888 } /* Generic.Output */ +.gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0044DD } /* Generic.Traceback */ +.kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #008000 } /* Keyword.Pseudo */ +.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #B00040 } /* Keyword.Type */ +.m { color: #666666 } /* Literal.Number */ +.s { color: #BA2121 } /* Literal.String */ +.na { color: #7D9029 } /* Name.Attribute */ +.nb { color: #008000 } /* Name.Builtin */ +.nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.no { color: #880000 } /* Name.Constant */ +.nd { color: #AA22FF } /* Name.Decorator */ +.ni { color: #999999; font-weight: bold } /* Name.Entity */ +.ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.nf { color: #0000FF } /* Name.Function */ +.nl { color: #A0A000 } /* Name.Label */ +.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.nt { color: #008000; font-weight: bold } /* Name.Tag */ +.nv { color: #19177C } /* Name.Variable */ +.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mb { color: #666666 } /* Literal.Number.Bin */ +.mf { color: #666666 } /* Literal.Number.Float */ +.mh { color: #666666 } /* Literal.Number.Hex */ +.mi { color: #666666 } /* Literal.Number.Integer */ +.mo { color: #666666 } /* Literal.Number.Oct */ +.sb { color: #BA2121 } /* Literal.String.Backtick */ +.sc { color: #BA2121 } /* Literal.String.Char */ +.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #BA2121 } /* Literal.String.Double */ +.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #BA2121 } /* Literal.String.Heredoc */ +.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.sx { color: #008000 } /* Literal.String.Other */ +.sr { color: #BB6688 } /* Literal.String.Regex */ +.s1 { color: #BA2121 } /* Literal.String.Single */ +.ss { color: #19177C } /* Literal.String.Symbol */ +.bp { color: #008000 } /* Name.Builtin.Pseudo */ +.vc { color: #19177C } /* Name.Variable.Class */ +.vg { color: #19177C } /* Name.Variable.Global */ +.vi { color: #19177C } /* Name.Variable.Instance */ +.il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/tests/Resources/pygments-2.0/css/default.prefix.css b/tests/Resources/pygments-2.0/css/default.prefix.css new file mode 100644 index 0000000..b8b872f --- /dev/null +++ b/tests/Resources/pygments-2.0/css/default.prefix.css @@ -0,0 +1,63 @@ +.syntax .hll { background-color: #ffffcc } +.syntax { background: #f8f8f8; } +.syntax .c { color: #408080; font-style: italic } /* Comment */ +.syntax .err { border: 1px solid #FF0000 } /* Error */ +.syntax .k { color: #008000; font-weight: bold } /* Keyword */ +.syntax .o { color: #666666 } /* Operator */ +.syntax .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.syntax .cp { color: #BC7A00 } /* Comment.Preproc */ +.syntax .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.syntax .cs { color: #408080; font-style: italic } /* Comment.Special */ +.syntax .gd { color: #A00000 } /* Generic.Deleted */ +.syntax .ge { font-style: italic } /* Generic.Emph */ +.syntax .gr { color: #FF0000 } /* Generic.Error */ +.syntax .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.syntax .gi { color: #00A000 } /* Generic.Inserted */ +.syntax .go { color: #888888 } /* Generic.Output */ +.syntax .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.syntax .gs { font-weight: bold } /* Generic.Strong */ +.syntax .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.syntax .gt { color: #0044DD } /* Generic.Traceback */ +.syntax .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.syntax .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.syntax .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.syntax .kp { color: #008000 } /* Keyword.Pseudo */ +.syntax .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.syntax .kt { color: #B00040 } /* Keyword.Type */ +.syntax .m { color: #666666 } /* Literal.Number */ +.syntax .s { color: #BA2121 } /* Literal.String */ +.syntax .na { color: #7D9029 } /* Name.Attribute */ +.syntax .nb { color: #008000 } /* Name.Builtin */ +.syntax .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.syntax .no { color: #880000 } /* Name.Constant */ +.syntax .nd { color: #AA22FF } /* Name.Decorator */ +.syntax .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.syntax .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.syntax .nf { color: #0000FF } /* Name.Function */ +.syntax .nl { color: #A0A000 } /* Name.Label */ +.syntax .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.syntax .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.syntax .nv { color: #19177C } /* Name.Variable */ +.syntax .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.syntax .w { color: #bbbbbb } /* Text.Whitespace */ +.syntax .mb { color: #666666 } /* Literal.Number.Bin */ +.syntax .mf { color: #666666 } /* Literal.Number.Float */ +.syntax .mh { color: #666666 } /* Literal.Number.Hex */ +.syntax .mi { color: #666666 } /* Literal.Number.Integer */ +.syntax .mo { color: #666666 } /* Literal.Number.Oct */ +.syntax .sb { color: #BA2121 } /* Literal.String.Backtick */ +.syntax .sc { color: #BA2121 } /* Literal.String.Char */ +.syntax .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.syntax .s2 { color: #BA2121 } /* Literal.String.Double */ +.syntax .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.syntax .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.syntax .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.syntax .sx { color: #008000 } /* Literal.String.Other */ +.syntax .sr { color: #BB6688 } /* Literal.String.Regex */ +.syntax .s1 { color: #BA2121 } /* Literal.String.Single */ +.syntax .ss { color: #19177C } /* Literal.String.Symbol */ +.syntax .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.syntax .vc { color: #19177C } /* Name.Variable.Class */ +.syntax .vg { color: #19177C } /* Name.Variable.Global */ +.syntax .vi { color: #19177C } /* Name.Variable.Instance */ +.syntax .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/tests/Resources/pygments-2.0/example/php.php.guess.out b/tests/Resources/pygments-2.0/example/php.php.guess.out new file mode 100644 index 0000000..c5e907f --- /dev/null +++ b/tests/Resources/pygments-2.0/example/php.php.guess.out @@ -0,0 +1,22 @@ +
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
diff --git a/tests/Resources/pygments-2.0/example/php.php.in b/tests/Resources/pygments-2.0/example/php.php.in new file mode 100644 index 0000000..b5d9404 --- /dev/null +++ b/tests/Resources/pygments-2.0/example/php.php.in @@ -0,0 +1,21 @@ +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
+ \ No newline at end of file diff --git a/tests/Resources/pygments-2.0/example/php.php.out b/tests/Resources/pygments-2.0/example/php.php.out new file mode 100644 index 0000000..c5e907f --- /dev/null +++ b/tests/Resources/pygments-2.0/example/php.php.out @@ -0,0 +1,22 @@ +
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
diff --git a/tests/Resources/pygments-2.1/css/default.css b/tests/Resources/pygments-2.1/css/default.css new file mode 100644 index 0000000..f76b8b5 --- /dev/null +++ b/tests/Resources/pygments-2.1/css/default.css @@ -0,0 +1,64 @@ +.hll { background-color: #ffffcc } +.c { color: #408080; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #008000; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.ch { color: #408080; font-style: italic } /* Comment.Hashbang */ +.cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.cp { color: #BC7A00 } /* Comment.Preproc */ +.cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ +.c1 { color: #408080; font-style: italic } /* Comment.Single */ +.cs { color: #408080; font-style: italic } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #888888 } /* Generic.Output */ +.gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0044DD } /* Generic.Traceback */ +.kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #008000 } /* Keyword.Pseudo */ +.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #B00040 } /* Keyword.Type */ +.m { color: #666666 } /* Literal.Number */ +.s { color: #BA2121 } /* Literal.String */ +.na { color: #7D9029 } /* Name.Attribute */ +.nb { color: #008000 } /* Name.Builtin */ +.nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.no { color: #880000 } /* Name.Constant */ +.nd { color: #AA22FF } /* Name.Decorator */ +.ni { color: #999999; font-weight: bold } /* Name.Entity */ +.ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.nf { color: #0000FF } /* Name.Function */ +.nl { color: #A0A000 } /* Name.Label */ +.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.nt { color: #008000; font-weight: bold } /* Name.Tag */ +.nv { color: #19177C } /* Name.Variable */ +.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mb { color: #666666 } /* Literal.Number.Bin */ +.mf { color: #666666 } /* Literal.Number.Float */ +.mh { color: #666666 } /* Literal.Number.Hex */ +.mi { color: #666666 } /* Literal.Number.Integer */ +.mo { color: #666666 } /* Literal.Number.Oct */ +.sb { color: #BA2121 } /* Literal.String.Backtick */ +.sc { color: #BA2121 } /* Literal.String.Char */ +.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #BA2121 } /* Literal.String.Double */ +.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #BA2121 } /* Literal.String.Heredoc */ +.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.sx { color: #008000 } /* Literal.String.Other */ +.sr { color: #BB6688 } /* Literal.String.Regex */ +.s1 { color: #BA2121 } /* Literal.String.Single */ +.ss { color: #19177C } /* Literal.String.Symbol */ +.bp { color: #008000 } /* Name.Builtin.Pseudo */ +.vc { color: #19177C } /* Name.Variable.Class */ +.vg { color: #19177C } /* Name.Variable.Global */ +.vi { color: #19177C } /* Name.Variable.Instance */ +.il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/tests/Resources/pygments-2.1/css/default.prefix.css b/tests/Resources/pygments-2.1/css/default.prefix.css new file mode 100644 index 0000000..77b77d2 --- /dev/null +++ b/tests/Resources/pygments-2.1/css/default.prefix.css @@ -0,0 +1,65 @@ +.syntax .hll { background-color: #ffffcc } +.syntax { background: #f8f8f8; } +.syntax .c { color: #408080; font-style: italic } /* Comment */ +.syntax .err { border: 1px solid #FF0000 } /* Error */ +.syntax .k { color: #008000; font-weight: bold } /* Keyword */ +.syntax .o { color: #666666 } /* Operator */ +.syntax .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ +.syntax .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.syntax .cp { color: #BC7A00 } /* Comment.Preproc */ +.syntax .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ +.syntax .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.syntax .cs { color: #408080; font-style: italic } /* Comment.Special */ +.syntax .gd { color: #A00000 } /* Generic.Deleted */ +.syntax .ge { font-style: italic } /* Generic.Emph */ +.syntax .gr { color: #FF0000 } /* Generic.Error */ +.syntax .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.syntax .gi { color: #00A000 } /* Generic.Inserted */ +.syntax .go { color: #888888 } /* Generic.Output */ +.syntax .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.syntax .gs { font-weight: bold } /* Generic.Strong */ +.syntax .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.syntax .gt { color: #0044DD } /* Generic.Traceback */ +.syntax .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.syntax .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.syntax .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.syntax .kp { color: #008000 } /* Keyword.Pseudo */ +.syntax .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.syntax .kt { color: #B00040 } /* Keyword.Type */ +.syntax .m { color: #666666 } /* Literal.Number */ +.syntax .s { color: #BA2121 } /* Literal.String */ +.syntax .na { color: #7D9029 } /* Name.Attribute */ +.syntax .nb { color: #008000 } /* Name.Builtin */ +.syntax .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.syntax .no { color: #880000 } /* Name.Constant */ +.syntax .nd { color: #AA22FF } /* Name.Decorator */ +.syntax .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.syntax .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.syntax .nf { color: #0000FF } /* Name.Function */ +.syntax .nl { color: #A0A000 } /* Name.Label */ +.syntax .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.syntax .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.syntax .nv { color: #19177C } /* Name.Variable */ +.syntax .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.syntax .w { color: #bbbbbb } /* Text.Whitespace */ +.syntax .mb { color: #666666 } /* Literal.Number.Bin */ +.syntax .mf { color: #666666 } /* Literal.Number.Float */ +.syntax .mh { color: #666666 } /* Literal.Number.Hex */ +.syntax .mi { color: #666666 } /* Literal.Number.Integer */ +.syntax .mo { color: #666666 } /* Literal.Number.Oct */ +.syntax .sb { color: #BA2121 } /* Literal.String.Backtick */ +.syntax .sc { color: #BA2121 } /* Literal.String.Char */ +.syntax .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.syntax .s2 { color: #BA2121 } /* Literal.String.Double */ +.syntax .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.syntax .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.syntax .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.syntax .sx { color: #008000 } /* Literal.String.Other */ +.syntax .sr { color: #BB6688 } /* Literal.String.Regex */ +.syntax .s1 { color: #BA2121 } /* Literal.String.Single */ +.syntax .ss { color: #19177C } /* Literal.String.Symbol */ +.syntax .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.syntax .vc { color: #19177C } /* Name.Variable.Class */ +.syntax .vg { color: #19177C } /* Name.Variable.Global */ +.syntax .vi { color: #19177C } /* Name.Variable.Instance */ +.syntax .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/tests/Resources/pygments-2.1/example/php.php.guess.out b/tests/Resources/pygments-2.1/example/php.php.guess.out new file mode 100644 index 0000000..c5e907f --- /dev/null +++ b/tests/Resources/pygments-2.1/example/php.php.guess.out @@ -0,0 +1,22 @@ +
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
diff --git a/tests/Resources/pygments-2.1/example/php.php.in b/tests/Resources/pygments-2.1/example/php.php.in new file mode 100644 index 0000000..b5d9404 --- /dev/null +++ b/tests/Resources/pygments-2.1/example/php.php.in @@ -0,0 +1,21 @@ +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
+ \ No newline at end of file diff --git a/tests/Resources/pygments-2.1/example/php.php.out b/tests/Resources/pygments-2.1/example/php.php.out new file mode 100644 index 0000000..c5e907f --- /dev/null +++ b/tests/Resources/pygments-2.1/example/php.php.out @@ -0,0 +1,22 @@ +
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
diff --git a/tests/Resources/pygments-2.2/css/default.css b/tests/Resources/pygments-2.2/css/default.css new file mode 100644 index 0000000..2a4cfcb --- /dev/null +++ b/tests/Resources/pygments-2.2/css/default.css @@ -0,0 +1,68 @@ +.hll { background-color: #ffffcc } +.c { color: #408080; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #008000; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.ch { color: #408080; font-style: italic } /* Comment.Hashbang */ +.cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.cp { color: #BC7A00 } /* Comment.Preproc */ +.cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ +.c1 { color: #408080; font-style: italic } /* Comment.Single */ +.cs { color: #408080; font-style: italic } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #888888 } /* Generic.Output */ +.gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0044DD } /* Generic.Traceback */ +.kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #008000 } /* Keyword.Pseudo */ +.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #B00040 } /* Keyword.Type */ +.m { color: #666666 } /* Literal.Number */ +.s { color: #BA2121 } /* Literal.String */ +.na { color: #7D9029 } /* Name.Attribute */ +.nb { color: #008000 } /* Name.Builtin */ +.nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.no { color: #880000 } /* Name.Constant */ +.nd { color: #AA22FF } /* Name.Decorator */ +.ni { color: #999999; font-weight: bold } /* Name.Entity */ +.ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.nf { color: #0000FF } /* Name.Function */ +.nl { color: #A0A000 } /* Name.Label */ +.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.nt { color: #008000; font-weight: bold } /* Name.Tag */ +.nv { color: #19177C } /* Name.Variable */ +.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mb { color: #666666 } /* Literal.Number.Bin */ +.mf { color: #666666 } /* Literal.Number.Float */ +.mh { color: #666666 } /* Literal.Number.Hex */ +.mi { color: #666666 } /* Literal.Number.Integer */ +.mo { color: #666666 } /* Literal.Number.Oct */ +.sa { color: #BA2121 } /* Literal.String.Affix */ +.sb { color: #BA2121 } /* Literal.String.Backtick */ +.sc { color: #BA2121 } /* Literal.String.Char */ +.dl { color: #BA2121 } /* Literal.String.Delimiter */ +.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #BA2121 } /* Literal.String.Double */ +.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #BA2121 } /* Literal.String.Heredoc */ +.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.sx { color: #008000 } /* Literal.String.Other */ +.sr { color: #BB6688 } /* Literal.String.Regex */ +.s1 { color: #BA2121 } /* Literal.String.Single */ +.ss { color: #19177C } /* Literal.String.Symbol */ +.bp { color: #008000 } /* Name.Builtin.Pseudo */ +.fm { color: #0000FF } /* Name.Function.Magic */ +.vc { color: #19177C } /* Name.Variable.Class */ +.vg { color: #19177C } /* Name.Variable.Global */ +.vi { color: #19177C } /* Name.Variable.Instance */ +.vm { color: #19177C } /* Name.Variable.Magic */ +.il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/tests/Resources/pygments-2.2/css/default.prefix.css b/tests/Resources/pygments-2.2/css/default.prefix.css new file mode 100644 index 0000000..bfe69e6 --- /dev/null +++ b/tests/Resources/pygments-2.2/css/default.prefix.css @@ -0,0 +1,69 @@ +.syntax .hll { background-color: #ffffcc } +.syntax { background: #f8f8f8; } +.syntax .c { color: #408080; font-style: italic } /* Comment */ +.syntax .err { border: 1px solid #FF0000 } /* Error */ +.syntax .k { color: #008000; font-weight: bold } /* Keyword */ +.syntax .o { color: #666666 } /* Operator */ +.syntax .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ +.syntax .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.syntax .cp { color: #BC7A00 } /* Comment.Preproc */ +.syntax .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ +.syntax .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.syntax .cs { color: #408080; font-style: italic } /* Comment.Special */ +.syntax .gd { color: #A00000 } /* Generic.Deleted */ +.syntax .ge { font-style: italic } /* Generic.Emph */ +.syntax .gr { color: #FF0000 } /* Generic.Error */ +.syntax .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.syntax .gi { color: #00A000 } /* Generic.Inserted */ +.syntax .go { color: #888888 } /* Generic.Output */ +.syntax .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.syntax .gs { font-weight: bold } /* Generic.Strong */ +.syntax .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.syntax .gt { color: #0044DD } /* Generic.Traceback */ +.syntax .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.syntax .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.syntax .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.syntax .kp { color: #008000 } /* Keyword.Pseudo */ +.syntax .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.syntax .kt { color: #B00040 } /* Keyword.Type */ +.syntax .m { color: #666666 } /* Literal.Number */ +.syntax .s { color: #BA2121 } /* Literal.String */ +.syntax .na { color: #7D9029 } /* Name.Attribute */ +.syntax .nb { color: #008000 } /* Name.Builtin */ +.syntax .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.syntax .no { color: #880000 } /* Name.Constant */ +.syntax .nd { color: #AA22FF } /* Name.Decorator */ +.syntax .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.syntax .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.syntax .nf { color: #0000FF } /* Name.Function */ +.syntax .nl { color: #A0A000 } /* Name.Label */ +.syntax .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.syntax .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.syntax .nv { color: #19177C } /* Name.Variable */ +.syntax .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.syntax .w { color: #bbbbbb } /* Text.Whitespace */ +.syntax .mb { color: #666666 } /* Literal.Number.Bin */ +.syntax .mf { color: #666666 } /* Literal.Number.Float */ +.syntax .mh { color: #666666 } /* Literal.Number.Hex */ +.syntax .mi { color: #666666 } /* Literal.Number.Integer */ +.syntax .mo { color: #666666 } /* Literal.Number.Oct */ +.syntax .sa { color: #BA2121 } /* Literal.String.Affix */ +.syntax .sb { color: #BA2121 } /* Literal.String.Backtick */ +.syntax .sc { color: #BA2121 } /* Literal.String.Char */ +.syntax .dl { color: #BA2121 } /* Literal.String.Delimiter */ +.syntax .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.syntax .s2 { color: #BA2121 } /* Literal.String.Double */ +.syntax .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.syntax .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.syntax .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.syntax .sx { color: #008000 } /* Literal.String.Other */ +.syntax .sr { color: #BB6688 } /* Literal.String.Regex */ +.syntax .s1 { color: #BA2121 } /* Literal.String.Single */ +.syntax .ss { color: #19177C } /* Literal.String.Symbol */ +.syntax .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.syntax .fm { color: #0000FF } /* Name.Function.Magic */ +.syntax .vc { color: #19177C } /* Name.Variable.Class */ +.syntax .vg { color: #19177C } /* Name.Variable.Global */ +.syntax .vi { color: #19177C } /* Name.Variable.Instance */ +.syntax .vm { color: #19177C } /* Name.Variable.Magic */ +.syntax .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/tests/Resources/pygments-2.2/example/php.php.guess.out b/tests/Resources/pygments-2.2/example/php.php.guess.out new file mode 100644 index 0000000..aa79e0d --- /dev/null +++ b/tests/Resources/pygments-2.2/example/php.php.guess.out @@ -0,0 +1,22 @@ +
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
diff --git a/tests/Resources/pygments-2.2/example/php.php.in b/tests/Resources/pygments-2.2/example/php.php.in new file mode 100644 index 0000000..b5d9404 --- /dev/null +++ b/tests/Resources/pygments-2.2/example/php.php.in @@ -0,0 +1,21 @@ +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
+ \ No newline at end of file diff --git a/tests/Resources/pygments-2.2/example/php.php.out b/tests/Resources/pygments-2.2/example/php.php.out new file mode 100644 index 0000000..6509663 --- /dev/null +++ b/tests/Resources/pygments-2.2/example/php.php.out @@ -0,0 +1,22 @@ +
<?php
+
+class Foo
+{
+    const TEST_CONST = 1;
+
+    public static $staticProperty = null;
+
+    public $property = null;
+
+    public static function staticMethod()
+    {
+        return new static();
+    }
+
+    public function method()
+    {
+        return $this;
+    }
+
+}
+
diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..d507592 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,54 @@ +&2 echo 'ERROR: This script may only run inside the Travis CI environment' + exit 1 +fi + +archive_url="https://s3.amazonaws.com/travis-php-archives/binaries/ubuntu/12.04/x86_64/php-${PHP_VERSION}.tar.bz2" + +# Install phpenv +type phpenv >/dev/null 2>&1 +if [ $? -ne 0 ]; then + git clone git://github.com/CHH/phpenv.git $HOME/phpenv.git + $HOME/phpenv.git/bin/phpenv-install.sh + PATH="$HOME/.phpenv/bin:$HOME/.phpenv/shims:$PATH" + eval "$(phpenv init -)" +fi + +phpenv rehash + +# Install PHP +phpenv global $PHP_VERSION 2>/dev/null +if [ $? -ne 0 ]; then + curl -s -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory / + phpenv rehash + phpenv global $PHP_VERSION +fi + +if [ $? -ne 0 ]; then + >&2 echo 'ERROR: PHP was not properly installed' + exit 1 +fi + +# Install Composer +cd $TRAVIS_BUILD_DIR +EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then + >&2 echo 'ERROR: Invalid installer signature' + exit 1 +fi + +php composer-setup.php --quiet +if [ $? -ne 0 ]; then + >&2 echo 'ERROR: Unable to set up Composer' + exit 1 +fi + +rm composer-setup.php