Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 1, 2020
1 parent 303897f commit c416694
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"phpunit/php-code-coverage": "^8.0",
"phpunit/php-file-iterator": "^3.0",
"phpunit/php-invoker": "^3.0",
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-text-template": "^2.0",
"phpunit/php-timer": "^3.0",
"sebastian/comparator": "^4.0",
"sebastian/diff": "^4.0",
Expand Down
7 changes: 4 additions & 3 deletions src/Framework/MockObject/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Doctrine\Instantiator\Exception\ExceptionInterface as InstantiatorException;
use Doctrine\Instantiator\Instantiator;
use PHPUnit\Framework\InvalidArgumentException;
use SebastianBergmann\Template\Template;

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
Expand Down Expand Up @@ -40,7 +41,7 @@ final class Generator
private static $cache = [];

/**
* @var \Text_Template[]
* @var Template[]
*/
private static $templates = [];

Expand Down Expand Up @@ -867,12 +868,12 @@ private function isMethodNameBlacklisted(string $name): bool
return isset(self::BLACKLISTED_METHOD_NAMES[$name]);
}

private function getTemplate(string $template): \Text_Template
private function getTemplate(string $template): Template
{
$filename = __DIR__ . \DIRECTORY_SEPARATOR . 'Generator' . \DIRECTORY_SEPARATOR . $template;

if (!isset(self::$templates[$filename])) {
self::$templates[$filename] = new \Text_Template($filename);
self::$templates[$filename] = new Template($filename);
}

return self::$templates[$filename];
Expand Down
7 changes: 4 additions & 3 deletions src/Framework/MockObject/MockMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace PHPUnit\Framework\MockObject;

use SebastianBergmann\Template\Template;
use SebastianBergmann\Type\ObjectType;
use SebastianBergmann\Type\Type;
use SebastianBergmann\Type\UnknownType;
Expand All @@ -20,7 +21,7 @@
final class MockMethod
{
/**
* @var \Text_Template[]
* @var Template[]
*/
private static $templates = [];

Expand Down Expand Up @@ -228,12 +229,12 @@ public function getReturnType(): Type
return $this->returnType;
}

private function getTemplate(string $template): \Text_Template
private function getTemplate(string $template): Template
{
$filename = __DIR__ . \DIRECTORY_SEPARATOR . 'Generator' . \DIRECTORY_SEPARATOR . $template;

if (!isset(self::$templates[$filename])) {
self::$templates[$filename] = new \Text_Template($filename);
self::$templates[$filename] = new Template($filename);
}

return self::$templates[$filename];
Expand Down
7 changes: 4 additions & 3 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
use SebastianBergmann\GlobalState\Restorer;
use SebastianBergmann\GlobalState\Snapshot;
use SebastianBergmann\ObjectEnumerator\Enumerator;
use SebastianBergmann\Template\Template;

abstract class TestCase extends Assert implements SelfDescribing, Test
{
Expand Down Expand Up @@ -668,11 +669,11 @@ public function run(TestResult $result = null): TestResult
// @codeCoverageIgnoreEnd

if ($runEntireClass) {
$template = new \Text_Template(
$template = new Template(
__DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl'
);
} else {
$template = new \Text_Template(
$template = new Template(
__DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl'
);
}
Expand Down Expand Up @@ -2202,10 +2203,10 @@ private function createGlobalStateSnapshot(bool $backupGlobals): Snapshot
$blacklist->addClassNamePrefix('SebastianBergmann\CodeCoverage');
$blacklist->addClassNamePrefix('SebastianBergmann\FileIterator');
$blacklist->addClassNamePrefix('SebastianBergmann\Invoker');
$blacklist->addClassNamePrefix('SebastianBergmann\Template');
$blacklist->addClassNamePrefix('SebastianBergmann\Timer');
$blacklist->addClassNamePrefix('PHP_Token');
$blacklist->addClassNamePrefix('Symfony');
$blacklist->addClassNamePrefix('Text_Template');
$blacklist->addClassNamePrefix('Doctrine\Instantiator');
$blacklist->addClassNamePrefix('Prophecy');

Expand Down
4 changes: 2 additions & 2 deletions src/Runner/PhptTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestResult;
use PHPUnit\Util\PHP\AbstractPhpProcess;
use SebastianBergmann\Template\Template;
use SebastianBergmann\Timer\Timer;
use Text_Template;
use Throwable;

/**
Expand Down Expand Up @@ -556,7 +556,7 @@ private function renderForCoverage(string &$job): void
{
$files = $this->getCoverageFiles();

$template = new Text_Template(
$template = new Template(
__DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl'
);

Expand Down
4 changes: 2 additions & 2 deletions src/Util/Blacklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
use SebastianBergmann\ObjectEnumerator\Enumerator;
use SebastianBergmann\RecursionContext\Context;
use SebastianBergmann\ResourceOperations\ResourceOperations;
use SebastianBergmann\Template\Template;
use SebastianBergmann\Timer\Timer;
use SebastianBergmann\Type\TypeName;
use SebastianBergmann\Version;
use Text_Template;
use TheSeer\Tokenizer\Tokenizer;
use Webmozart\Assert\Assert;

Expand Down Expand Up @@ -88,7 +88,7 @@ final class Blacklist
Invoker::class => 1,

// phpunit/php-text-template
Text_Template::class => 1,
Template::class => 1,

// phpunit/php-timer
Timer::class => 1,
Expand Down

0 comments on commit c416694

Please sign in to comment.