mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-25 20:32:35 +00:00
[PhpSpecToPHPUnit] Restore PhpSpecToPHPUnitRector behaviour on namespaced name usage (#1163)
* [PhpSpecToPHPUnit] Restore PhpSpecToPHPUnitRector behaviour on namespaced name usage
* Fixed 🎉
This commit is contained in:
parent
c31cabf0b3
commit
c3e5507d9a
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user