[PhpSpecToPHPUnit] Restore PhpSpecToPHPUnitRector behaviour on namespaced name usage (#1163)

* [PhpSpecToPHPUnit] Restore PhpSpecToPHPUnitRector behaviour on namespaced name usage

* Fixed 🎉
This commit is contained in:
Abdul Malik Ikhsan 2021-11-06 09:42:38 +07:00 committed by GitHub
parent c31cabf0b3
commit c3e5507d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -64,7 +64,7 @@ use PhpSpec\ObjectBehavior;
class RatesTest extends \PHPUnit\Framework\TestCase
{
private \Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Fixture\Rates $rates;
private \PHPUnit\Framework\MockObject\MockObject|\Provider $provider;
private \PHPUnit\Framework\MockObject\MockObject|\spec\Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Fixture\Provider $provider;
protected function setUp()
{
$this->provider = $this->createMock(Provider::class);

View File

@ -67,7 +67,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class PageLinksGeneratorTest extends \PHPUnit\Framework\TestCase
{
private \Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Fixture\PageLinksGenerator $pageLinksGenerator;
private \PHPUnit\Framework\MockObject\MockObject|\Router $router;
private \PHPUnit\Framework\MockObject\MockObject|\Symfony\Bundle\FrameworkBundle\Routing\Router $router;
public function testInitializable()
{
$this->assertInstanceOf(PageLinksGenerator::class, $this->pageLinksGenerator);

View File

@ -33,7 +33,7 @@ use PhpSpec\ObjectBehavior;
class CurrencyTest extends \PHPUnit\Framework\TestCase
{
private \Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Fixture\Currency $currency;
private \CurrencyData|\PHPUnit\Framework\MockObject\MockObject $data;
private \PHPUnit\Framework\MockObject\MockObject|\spec\Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Fixture\CurrencyData $data;
protected function setUp()
{
$this->data = $this->createMock(CurrencyData::class);

View File

@ -31,7 +31,7 @@ use Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Source\
class MockPropertiesTest extends \PHPUnit\Framework\TestCase
{
private \Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Fixture\MockProperties $mockProperties;
private \OrderFactory|\PHPUnit\Framework\MockObject\MockObject $factory;
private \PHPUnit\Framework\MockObject\MockObject|\Rector\Tests\PhpSpecToPHPUnit\Rector\Variable\PhpSpecToPHPUnitRector\Source\OrderFactory $factory;
protected function setUp()
{
$this->factory = $this->createMock(OrderFactory::class);

View File

@ -113,7 +113,7 @@ final class PhpSpecMockCollector
throw new ShouldNotHappenException();
}
$paramType = (string) ($param->type->getAttribute(AttributeKey::ORIGINAL_NAME) ?: $param->type);
$paramType = (string) ($param->type ?? $param->type->getAttribute(AttributeKey::ORIGINAL_NAME));
$this->mocksWithsTypes[$class][$variable] = $paramType;
}
}