mirror of
https://github.com/getgrav/grav.git
synced 2026-07-09 13:53:30 +02:00
Fix tests for latest Codeception version
This commit is contained in:
@@ -2,7 +2,7 @@ actor: Tester
|
||||
bootstrap: _bootstrap.php
|
||||
paths:
|
||||
tests: tests
|
||||
log: tests/_output
|
||||
output: tests/_output
|
||||
data: tests/_data
|
||||
support: tests/_support
|
||||
envs: tests/_envs
|
||||
|
||||
@@ -68,13 +68,13 @@
|
||||
"multiavatar/multiavatar-php": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": "^5.0",
|
||||
"codeception/codeception": "^5.1",
|
||||
"phpstan/phpstan": "^1.12",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.2",
|
||||
"phpunit/php-code-coverage": "~9.2",
|
||||
"getgrav/markdowndocs": "^2.0",
|
||||
"codeception/module-asserts": "^3.0",
|
||||
"codeception/module-phpbrowser": "^3.0"
|
||||
"codeception/module-asserts": "*",
|
||||
"codeception/module-phpbrowser": "*"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
|
||||
40
composer.lock
generated
40
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "a11f7fe97247357a2dfe64210d20615b",
|
||||
"content-hash": "f0dd39cd25f1a10bfd5277beac4e826e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "antoligy/dom-string-iterators",
|
||||
@@ -3885,25 +3885,25 @@
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "behat/gherkin",
|
||||
"version": "v4.9.0",
|
||||
"version": "v4.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Behat/Gherkin.git",
|
||||
"reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4"
|
||||
"reference": "cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4",
|
||||
"reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4",
|
||||
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6",
|
||||
"reference": "cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~7.2|~8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"cucumber/cucumber": "dev-gherkin-22.0.0",
|
||||
"cucumber/cucumber": "dev-gherkin-24.1.0",
|
||||
"phpunit/phpunit": "~8|~9",
|
||||
"symfony/yaml": "~3|~4|~5"
|
||||
"symfony/yaml": "~3|~4|~5|~6|~7"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/yaml": "If you want to parse features, represented in YAML files"
|
||||
@@ -3942,9 +3942,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Behat/Gherkin/issues",
|
||||
"source": "https://github.com/Behat/Gherkin/tree/v4.9.0"
|
||||
"source": "https://github.com/Behat/Gherkin/tree/v4.10.0"
|
||||
},
|
||||
"time": "2021-10-12T13:05:09+00:00"
|
||||
"time": "2024-10-19T14:46:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "codeception/codeception",
|
||||
@@ -4641,16 +4641,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/promises.git",
|
||||
"reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8"
|
||||
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8",
|
||||
"reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
|
||||
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4704,7 +4704,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/promises/issues",
|
||||
"source": "https://github.com/guzzle/promises/tree/2.0.3"
|
||||
"source": "https://github.com/guzzle/promises/tree/2.0.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -4720,7 +4720,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-18T10:29:17+00:00"
|
||||
"time": "2024-10-17T10:06:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "masterminds/html5",
|
||||
@@ -5027,16 +5027,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.12.6",
|
||||
"version": "1.12.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae"
|
||||
"reference": "dc2b9976bd8b0f84ec9b0e50cc35378551de7af0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc4d2f145a88ea7141ae698effd64d9df46527ae",
|
||||
"reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc2b9976bd8b0f84ec9b0e50cc35378551de7af0",
|
||||
"reference": "dc2b9976bd8b0f84ec9b0e50cc35378551de7af0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5081,7 +5081,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-10-06T15:03:59+00:00"
|
||||
"time": "2024-10-18T11:12:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-deprecation-rules",
|
||||
|
||||
@@ -60,31 +60,4 @@ class Unit extends Codeception\Module
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* HOOK: before each suite
|
||||
*
|
||||
* @param Codeception\TestCase $test
|
||||
*/
|
||||
public function _before(Codeception\TestCase $test)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* HOOK: before each suite
|
||||
*
|
||||
* @param Codeception\TestCase $test
|
||||
*/
|
||||
public function _after(Codeception\TestCase $test)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* HOOK: on fail
|
||||
*
|
||||
* @param Codeception\TestCase $test
|
||||
* @param $fail
|
||||
*/
|
||||
public function _failed(Codeception\TestCase $test, $fail)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Perform tests in browser using the WebDriver or PhpBrowser.
|
||||
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
|
||||
|
||||
class_name: AcceptanceTester
|
||||
class: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
- PhpBrowser:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Emulate web requests and make application process them
|
||||
# Include one of framework modules (Symfony2, Yii2, Laravel5) to use it
|
||||
|
||||
class_name: FunctionalTester
|
||||
class: FunctionalTester
|
||||
modules:
|
||||
enabled:
|
||||
# add framework module here
|
||||
|
||||
@@ -7,7 +7,7 @@ use Grav\Console\Gpm\DirectInstallCommand;
|
||||
/**
|
||||
* Class DirectInstallCommandTest
|
||||
*/
|
||||
class DirectInstallCommandTest extends \Codeception\TestCase\Test
|
||||
class DirectInstallCommandTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -16,9 +16,10 @@ class DirectInstallCommandTest extends \Codeception\TestCase\Test
|
||||
protected $directInstall;
|
||||
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->grav = Fixtures::get('grav');
|
||||
parent::setUp();
|
||||
$this->grav = Fixtures::get('grav');
|
||||
$this->directInstallCommand = new DirectInstallCommand();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Suite for unit (internal) tests.
|
||||
|
||||
class_name: UnitTester
|
||||
class: UnitTester
|
||||
modules:
|
||||
enabled:
|
||||
- Asserts
|
||||
|
||||
@@ -7,7 +7,7 @@ use Grav\Common\Assets;
|
||||
/**
|
||||
* Class AssetsTest
|
||||
*/
|
||||
class AssetsTest extends \Codeception\TestCase\Test
|
||||
class AssetsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -15,14 +15,15 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
/** @var Assets $assets */
|
||||
protected $assets;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
$this->assets = $this->grav['assets'];
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
@@ -565,12 +566,12 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
$this->assets->add('test.css', null, true);
|
||||
$this->assets->setCssPipeline(true);
|
||||
$css = $this->assets->css();
|
||||
self::assertRegExp('#<link href=\"\/assets\/(.*).css\" type=\"text\/css\" rel=\"stylesheet\">#', $css);
|
||||
self::assertMatchesRegularExpression('#<link href=\"\/assets\/(.*).css\" type=\"text\/css\" rel=\"stylesheet\">#', $css);
|
||||
|
||||
//Add a core Grav CSS file, which is found. Pipeline will now return a file
|
||||
$this->assets->add('/system/assets/debugger/phpdebugbar', null, true);
|
||||
$css = $this->assets->css();
|
||||
self::assertRegExp('#<link href=\"\/assets\/(.*).css\" type=\"text\/css\" rel=\"stylesheet\">#', $css);
|
||||
self::assertMatchesRegularExpression('#<link href=\"\/assets\/(.*).css\" type=\"text\/css\" rel=\"stylesheet\">#', $css);
|
||||
}
|
||||
|
||||
public function testPipelineWithTimestamp(): void
|
||||
@@ -582,7 +583,7 @@ class AssetsTest extends \Codeception\TestCase\Test
|
||||
//Add a core Grav CSS file, which is found. Pipeline will now return a file
|
||||
$this->assets->add('/system/assets/debugger.css', null, true);
|
||||
$css = $this->assets->css();
|
||||
self::assertRegExp('#<link href=\"\/assets\/(.*).css\?foo\" type=\"text\/css\" rel=\"stylesheet\">#', $css);
|
||||
self::assertMatchesRegularExpression('#<link href=\"\/assets\/(.*).css\?foo\" type=\"text\/css\" rel=\"stylesheet\">#', $css);
|
||||
}
|
||||
|
||||
public function testInline(): void
|
||||
|
||||
@@ -6,18 +6,19 @@ use Grav\Common\Grav;
|
||||
/**
|
||||
* Class BrowserTest
|
||||
*/
|
||||
class BrowserTest extends \Codeception\TestCase\Test
|
||||
class BrowserTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
use Codeception\Util\Fixtures;
|
||||
use Grav\Common\Composer;
|
||||
|
||||
class ComposerTest extends \Codeception\TestCase\Test
|
||||
class ComposerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use Grav\Common\Grav;
|
||||
/**
|
||||
* Class InstallCommandTest
|
||||
*/
|
||||
class BlueprintTest extends \Codeception\TestCase\Test
|
||||
class BlueprintTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ class GpmStub extends GPM
|
||||
/**
|
||||
* Class InstallCommandTest
|
||||
*/
|
||||
class GpmTest extends \Codeception\TestCase\Test
|
||||
class GpmTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -43,13 +43,15 @@ class GpmTest extends \Codeception\TestCase\Test
|
||||
/** @var GpmStub */
|
||||
protected $gpm;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->grav = Fixtures::get('grav');
|
||||
parent::setUp();
|
||||
|
||||
$this->grav = Fixtures::get('grav');
|
||||
$this->gpm = new GpmStub();
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
/**
|
||||
* Class ExcerptsTest
|
||||
*/
|
||||
class ExcerptsTest extends \Codeception\TestCase\Test
|
||||
class ExcerptsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Parsedown $parsedown */
|
||||
protected $parsedown;
|
||||
@@ -38,8 +38,9 @@ class ExcerptsTest extends \Codeception\TestCase\Test
|
||||
|
||||
protected $old_home;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
$this->pages = $this->grav['pages'];
|
||||
@@ -70,7 +71,7 @@ class ExcerptsTest extends \Codeception\TestCase\Test
|
||||
$this->uri->initializeWithURL('http://testing.dev/item2/item2-2')->init();
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->config->set('system.home.alias', $this->old_home);
|
||||
}
|
||||
@@ -78,11 +79,11 @@ class ExcerptsTest extends \Codeception\TestCase\Test
|
||||
|
||||
public function testProcessImageHtml(): void
|
||||
{
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<img alt="Sample Image" src="\/images\/.*-sample-image.jpe?g\" data-src="sample-image\.jpg\?cropZoom=300,300" \/>|',
|
||||
Excerpts::processImageHtml('<img src="sample-image.jpg?cropZoom=300,300" alt="Sample Image" />', $this->page)
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<img alt="Sample Image" class="foo" src="\/images\/.*-sample-image.jpe?g\" data-src="sample-image\.jpg\?classes=foo" \/>|',
|
||||
Excerpts::processImageHtml('<img src="sample-image.jpg?classes=foo" alt="Sample Image" />', $this->page)
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ use Grav\Common\Utils;
|
||||
/**
|
||||
* Class InflectorTest
|
||||
*/
|
||||
class InflectorTest extends \Codeception\TestCase\Test
|
||||
class InflectorTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -16,14 +16,15 @@ class InflectorTest extends \Codeception\TestCase\Test
|
||||
/** @var Inflector $uri */
|
||||
protected $inflector;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
$this->inflector = $this->grav['inflector'];
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use Grav\Common\Language\LanguageCodes;
|
||||
/**
|
||||
* Class ParsedownTest
|
||||
*/
|
||||
class LanguageCodesTest extends \Codeception\TestCase\Test
|
||||
class LanguageCodesTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testRtl(): void
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
/**
|
||||
* Class ParsedownTest
|
||||
*/
|
||||
class ParsedownTest extends \Codeception\TestCase\Test
|
||||
class ParsedownTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Parsedown $parsedown */
|
||||
protected $parsedown;
|
||||
@@ -35,8 +35,9 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
|
||||
protected $old_home;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
$this->pages = $this->grav['pages'];
|
||||
@@ -72,7 +73,7 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
$this->parsedown = new Parsedown($excerpts);
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->config->set('system.home.alias', $this->old_home);
|
||||
}
|
||||
@@ -88,7 +89,7 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
'<p><img alt="" src="/tests/fake/nested-site/user/pages/02.item2/02.item2-2/sample-image.jpg" /></p>',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="\/images\/.*-cache-image.jpe?g\?foo=1" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -99,11 +100,11 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
'<p><img alt="" src="/tests/fake/nested-site/user/pages/02.item2/02.item2-2/sample-image.jpg" /></p>',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="\/images\/.*-cache-image.jpe?g\?foo=1" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="\/images\/.*-home-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -130,7 +131,7 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
$this->config->set('system.images.cache_all', false);
|
||||
$this->uri->initializeWithUrlAndRootPath('http://testing.dev/subdir/item2/item2-2', '/subdir')->init();
|
||||
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="\/subdir\/images\/.*-home-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -138,7 +139,7 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
'<p><img alt="" src="/subdir/tests/fake/nested-site/user/pages/02.item2/02.item2-2/sample-image.jpg" /></p>',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="\/subdir\/images\/.*-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -161,11 +162,11 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
'<p><img alt="" src="http://testing.dev/tests/fake/nested-site/user/pages/02.item2/02.item2-2/sample-image.jpg" /></p>',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="http:\/\/testing.dev\/images\/.*-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="http:\/\/testing.dev\/images\/.*-home-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -188,11 +189,11 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
'<p><img alt="" src="http://testing.dev/subdir/tests/fake/nested-site/user/pages/02.item2/02.item2-2/sample-image.jpg" /></p>',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="http:\/\/testing.dev\/subdir\/images\/.*-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="http:\/\/testing.dev\/subdir\/images\/.*-home-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -320,7 +321,7 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
|
||||
self::assertRegExp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'/width="400" height="200"/',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -328,33 +329,33 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
$this->config->set('system.images.cls.retina_scale', 2);
|
||||
|
||||
|
||||
self::assertRegExp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'/width="400" height="200"/',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
|
||||
$this->config->set('system.images.cls.retina_scale', 4);
|
||||
|
||||
self::assertRegExp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'/width="200" height="100"/',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
|
||||
self::assertRegExp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'/width="266" height="133"/',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
|
||||
$this->config->set('system.images.cls.aspect_ratio', true);
|
||||
|
||||
self::assertRegExp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'/style="--aspect-ratio: 800\/400;"/',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
|
||||
$this->config->set('system.images.cls.aspect_ratio', false);
|
||||
|
||||
self::assertRegExp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'/style="--aspect-ratio: 800\/400;"/',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -383,11 +384,11 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
'<p><img alt="" src="/tests/fake/nested-site/user/pages/01.item1/home-sample-image.jpg" /></p>',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="\/images\/.*-home-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="\/images\/.*-home-cache-image.jpe?g\?foo=1" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
@@ -416,11 +417,11 @@ class ParsedownTest extends \Codeception\TestCase\Test
|
||||
'<p><img alt="" src="http://testing.dev/subdir/tests/fake/nested-site/user/pages/02.item2/02.item2-2/sample-image.jpg" /></p>',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="http:\/\/testing.dev\/subdir\/images\/.*-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
self::assertRegexp(
|
||||
self::assertMatchesRegularExpression(
|
||||
'|<p><img alt="" src="http:\/\/testing.dev\/subdir\/images\/.*-home-cache-image.jpe?g" \/><\/p>|',
|
||||
$this->parsedown->text('')
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
/**
|
||||
* Class PagesTest
|
||||
*/
|
||||
class PagesTest extends \Codeception\TestCase\Test
|
||||
class PagesTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -21,8 +21,9 @@ class PagesTest extends \Codeception\TestCase\Test
|
||||
/** @var PageInterface $root_page */
|
||||
protected $root_page;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
$this->pages = $this->grav['pages'];
|
||||
|
||||
@@ -7,7 +7,7 @@ use Grav\Common\Twig\Extension\GravExtension;
|
||||
/**
|
||||
* Class GravExtensionTest
|
||||
*/
|
||||
class GravExtensionTest extends \Codeception\TestCase\Test
|
||||
class GravExtensionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -15,8 +15,9 @@ class GravExtensionTest extends \Codeception\TestCase\Test
|
||||
/** @var GravExtension $twig_ext */
|
||||
protected $twig_ext;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->grav = Fixtures::get('grav');
|
||||
$this->twig_ext = new GravExtension();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use Grav\Common\Utils;
|
||||
/**
|
||||
* Class UriTest
|
||||
*/
|
||||
class UriTest extends \Codeception\TestCase\Test
|
||||
class UriTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -858,15 +858,16 @@ class UriTest extends \Codeception\TestCase\Test
|
||||
],
|
||||
];
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
$this->uri = $this->grav['uri'];
|
||||
$this->config = $this->grav['config'];
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use Grav\Common\Utils;
|
||||
/**
|
||||
* Class UtilsTest
|
||||
*/
|
||||
class UtilsTest extends \Codeception\TestCase\Test
|
||||
class UtilsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -16,14 +16,15 @@ class UtilsTest extends \Codeception\TestCase\Test
|
||||
/** @var Uri $uri */
|
||||
protected $uri;
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$grav = Fixtures::get('grav');
|
||||
$this->grav = $grav();
|
||||
$this->uri = $this->grav['uri'];
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use Grav\Console\Gpm\InstallCommand;
|
||||
/**
|
||||
* Class InstallCommandTest
|
||||
*/
|
||||
class InstallCommandTest extends \Codeception\TestCase\Test
|
||||
class InstallCommandTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/** @var Grav $grav */
|
||||
protected $grav;
|
||||
@@ -16,13 +16,14 @@ class InstallCommandTest extends \Codeception\TestCase\Test
|
||||
protected $installCommand;
|
||||
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->grav = Fixtures::get('grav');
|
||||
$this->installCommand = new InstallCommand();
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ use Grav\Framework\File\Formatter\CsvFormatter;
|
||||
/**
|
||||
* Class CsvFormatterTest
|
||||
*/
|
||||
class CsvFormatterTest extends \Codeception\TestCase\Test
|
||||
class CsvFormatterTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEncodeWithAssocColumns(): void
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ use Grav\Framework\Filesystem\Filesystem;
|
||||
/**
|
||||
* Class FilesystemTest
|
||||
*/
|
||||
class FilesystemTest extends \Codeception\TestCase\Test
|
||||
class FilesystemTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $class;
|
||||
|
||||
@@ -280,12 +280,14 @@ class FilesystemTest extends \Codeception\TestCase\Test
|
||||
],
|
||||
];
|
||||
|
||||
protected function _before(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->class = Filesystem::getInstance();
|
||||
parent::setUp();
|
||||
|
||||
$this->class = Filesystem::getInstance();
|
||||
}
|
||||
|
||||
protected function _after(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user