fix fixtures

This commit is contained in:
TomasVotruba 2020-02-14 23:50:42 +01:00
parent 1c273c902c
commit 69c18b87ca
8 changed files with 1 additions and 150 deletions

View File

@ -15,6 +15,7 @@ $finder->files();
$finder->name('*.php.inc');
$finder->in(__DIR__ . '/../tests');
$finder->in(__DIR__ . '/../packages/*/tests');
$finder->in(__DIR__ . '/../rules/*/tests');
$finderSanitizer = new FinderSanitizer();
$smartFileInfos = $finderSanitizer->sanitize($finder);

View File

@ -9,19 +9,3 @@ function throwCustomExceptionAlreadyAnnotatedInFunction()
{
throw new \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException();
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
/**
* @throws \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException
*/
function throwCustomExceptionAlreadyAnnotatedInFunction()
{
throw new \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException();
}
?>

View File

@ -9,19 +9,3 @@ function throwRootExceptionAlreadyAnnotatedInFunction()
{
throw new \RuntimeException();
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
/**
* @throws \RuntimeException
*/
function throwRootExceptionAlreadyAnnotatedInFunction()
{
throw new \RuntimeException();
}
?>

View File

@ -12,22 +12,3 @@ class RootExceptionAlreadyAnnotatedInMethod
throw new \RuntimeException();
}
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
class RootExceptionAlreadyAnnotatedInMethod
{
/**
* @throws \RuntimeException
*/
public function throwException()
{
throw new \RuntimeException();
}
}
?>

View File

@ -11,21 +11,3 @@ function throwRootImportedExceptionAlreadyAnnotatedInFunction()
{
throw new RuntimeException();
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
use \RuntimeException;
/**
* @throws RuntimeException
*/
function throwRootImportedExceptionAlreadyAnnotatedInFunction()
{
throw new RuntimeException();
}
?>

View File

@ -14,24 +14,3 @@ class RootImportedExceptionAlreadyAnnotatedInMethod
throw new RuntimeException();
}
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
use \RuntimeException;
class RootImportedExceptionAlreadyAnnotatedInMethod
{
/**
* @throws RuntimeException
*/
public function throwException()
{
throw new RuntimeException();
}
}
?>

View File

@ -18,28 +18,3 @@ function throwWithFactoryMethodNoReturnTypeHinting()
{
throw ExceptionsFactoryNotAnnotated::createException(1);
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheSecond;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheThird;
class ExceptionsFactoryNoReturnTypeHingting
{
public static function createException(int $code)
{
return new TheException();
}
}
function throwWithFactoryMethodNoReturnTypeHinting()
{
throw ExceptionsFactoryNotAnnotated::createException(1);
}
?>

View File

@ -28,38 +28,3 @@ function throwWithFactoryMethodNotAnnotated()
$factory = new ExceptionsFactoryMethodNothingAnnotated();
throw $factory->cercoQuestoMetodoQui(1);
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheSecond;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheThird;
class ExceptionsFactoryMethodNothingAnnotated
{
public function cercoQuestoMetodoQui(int $code)
{
switch ($code) {
case 1:
return new TheException();
case 2:
return new TheExceptionTheSecond();
case 3:
return new TheExceptionTheThird();
default:
return new \RuntimeException();
}
}
}
function throwWithFactoryMethodNotAnnotated()
{
$factory = new ExceptionsFactoryMethodNothingAnnotated();
throw $factory->cercoQuestoMetodoQui(1);
}
?>