Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump minimum version requirement and upgrade phpunit #84

Merged
merged 2 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 7.2
- 7.3
- 7.4
- nightly
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.3",
"symfony/polyfill-mbstring": "^1.12"
},
"require-dev": {
"php": "^7.2",
"phpunit/phpunit": "^8.0",
"php": "^7.3",
"phpunit/phpunit": "^9.0",
"phpdocumentor/phpdocumentor": "^2",
"squizlabs/php_codesniffer": "^3.2"
},
Expand All @@ -54,7 +54,7 @@
},
"config": {
"platform": {
"php": "7.2"
"php": "7.3"
},
"bin-dir": "bin"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/CodeCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private function executeGarbageRemovalTest(int $subpath_recursion)

// can't check for reparse, because PHPTAL uses function_exists() as a shortcut!
foreach ($files as $file) {
$this->assertFileNotExists($file);
$this->assertFileDoesNotExist($file);
}
}
}
4 changes: 2 additions & 2 deletions tests/PhptalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testSource(): void
$res = $tpl->execute();
static::assertSame('<span>foo value</span>', $res);

static::assertRegExp('/^tpl_\d{8}_/', $tpl->getFunctionName());
static::assertMatchesRegularExpression('/^tpl_\d{8}_/', $tpl->getFunctionName());
static::assertStringContainsString('string', $tpl->getFunctionName());
static::assertStringNotContainsString(PHPTAL::PHPTAL_VERSION, $tpl->getFunctionName());
}
Expand All @@ -125,7 +125,7 @@ public function testSourceWithPath(): void
$tpl->setSource($source, $fakename = 'abc12345');
$res = $tpl->execute();
static::assertSame('<span>foo value</span>', $res);
static::assertRegExp('/^tpl_\d{8}_/', $tpl->getFunctionName());
static::assertMatchesRegularExpression('/^tpl_\d{8}_/', $tpl->getFunctionName());
static::assertStringContainsString($fakename, $tpl->getFunctionName());
static::assertStringNotContainsString(PHPTAL::PHPTAL_VERSION, $tpl->getFunctionName());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TalTestCaseRepeatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function testReset(): void
$res,
$tpl->getCodePath()
);
static::assertRegExp("/rewind.*rewind/s", $i->log);
static::assertMatchesRegularExpression("/rewind.*rewind/s", $i->log);
static::assertSame(
"1[0]00[1]00[2]00[3]00[4]00[5]00[6]00[7]00[8]00[9]11[0]00[1]00[2]00[3]00[4]00[5]00[6]00[7]00[8]00[9]1",
$tpl->execute()
Expand Down
10 changes: 5 additions & 5 deletions tests/TalesStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ public function testDoubleDollar(): void
public function testSubPathSimple(): void
{
$res = TalesInternal::string('hello $name how are you ?');
static::assertRegExp('/\'hello \'.*?\$ctx->name.*?\' how are you \?\'$/', $res);
static::assertMatchesRegularExpression('/\'hello \'.*?\$ctx->name.*?\' how are you \?\'$/', $res);
}

public function testSubPath(): void
{
$res = TalesInternal::string('${name}');
static::assertRegExp('/^(\'\'\s*?\.*)?\$ctx->name(.*?\'\')?$/', $res);
static::assertMatchesRegularExpression('/^(\'\'\s*?\.*)?\$ctx->name(.*?\'\')?$/', $res);
}

public function testSubPathExtended(): void
{
$res = TalesInternal::string('hello ${user/name} how are you ?');
static::assertRegExp('/\'hello \'.*?\$ctx->user, \'name\'.*?\' how are you \?\'$/', $res);
static::assertMatchesRegularExpression('/\'hello \'.*?\$ctx->user, \'name\'.*?\' how are you \?\'$/', $res);
}

public function testQuote(): void
Expand All @@ -65,8 +65,8 @@ public function testQuote(): void
public function testDoubleVar(): void
{
$res = TalesInternal::string('hello $foo $bar');
static::assertRegExp('/ctx->foo/', $res, '$foo not interpolated');
static::assertRegExp('/ctx->bar/', $res, '$bar not interpolated');
static::assertMatchesRegularExpression('/ctx->foo/', $res, '$foo not interpolated');
static::assertMatchesRegularExpression('/ctx->bar/', $res, '$bar not interpolated');
}

public function testDoubleDotComa(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/XmlParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function testNotClosing(): void
$this->fail("Accepted invalid XML");
} catch (ParserException $e) {
static::assertStringNotContainsString("documentElement", $e->getMessage());
static::assertRegExp("/element_e.*element_d.*element_c.*element_b.*element_a/", $e->getMessage());
static::assertMatchesRegularExpression("/element_e.*element_d.*element_c.*element_b.*element_a/", $e->getMessage());
}
}

Expand Down