Skip to content

Commit

Permalink
Fix: Remove TestDouble\ProphecyCreated
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
localheinz committed Aug 15, 2020
1 parent 7dc0dfe commit f66f52b
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 124 deletions.
8 changes: 1 addition & 7 deletions .psalm/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
</PossiblyUnusedMethod>
</file>
<file src="src/Event/DispatchingEmitter.php">
<MissingThrowsDocblock occurrences="41">
<code>dispatch</code>
<MissingThrowsDocblock occurrences="40">
<code>dispatch</code>
<code>dispatch</code>
<code>dispatch</code>
Expand Down Expand Up @@ -298,11 +297,6 @@
<code>PartialMockCreatedSubscriber</code>
</UnusedClass>
</file>
<file src="src/Event/TestDouble/ProphecyCreatedSubscriber.php">
<UnusedClass occurrences="1">
<code>ProphecyCreatedSubscriber</code>
</UnusedClass>
</file>
<file src="src/Event/TestDouble/TestProxyCreatedSubscriber.php">
<UnusedClass occurrences="1">
<code>TestProxyCreatedSubscriber</code>
Expand Down
5 changes: 0 additions & 5 deletions src/Event/DispatchingEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,6 @@ public function testDoublePartialMockCreated(): void
$this->dispatcher->dispatch(new TestDouble\PartialMockCreated($this->telemetryInfo()));
}

public function testDoubleProphecyCreated(): void
{
$this->dispatcher->dispatch(new TestDouble\ProphecyCreated($this->telemetryInfo()));
}

public function testDoubleTestProxyCreated(): void
{
$this->dispatcher->dispatch(new TestDouble\TestProxyCreated($this->telemetryInfo()));
Expand Down
2 changes: 0 additions & 2 deletions src/Event/Emitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public function testDoubleMockForTraitCreated(): void;

public function testDoublePartialMockCreated(): void;

public function testDoubleProphecyCreated(): void;

public function testDoubleTestProxyCreated(): void;

public function testSuiteAfterClassFinished(): void;
Expand Down
1 change: 0 additions & 1 deletion src/Event/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ private static function registerDefaultTypes(): void
TestDouble\MockCreated::class,
TestDouble\MockForTraitCreated::class,
TestDouble\PartialMockCreated::class,
TestDouble\ProphecyCreated::class,
TestDouble\TestProxyCreated::class,
Test\RunConfigured::class,
Test\RunErrored::class,
Expand Down
31 changes: 0 additions & 31 deletions src/Event/TestDouble/ProphecyCreated.php

This file was deleted.

17 changes: 0 additions & 17 deletions src/Event/TestDouble/ProphecyCreatedSubscriber.php

This file was deleted.

6 changes: 1 addition & 5 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1962,11 +1962,7 @@ protected function prophesize(?string $classOrInterface = null): ObjectProphecy
$this->recordDoubledType($classOrInterface);
}

$prophecy = $this->getProphet()->prophesize($classOrInterface);

Event\Registry::emitter()->testDoubleProphecyCreated();

return $prophecy;
return $this->getProphet()->prophesize($classOrInterface);
}

/**
Expand Down
4 changes: 0 additions & 4 deletions tests/_files/NullEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ public function testDoublePartialMockCreated(): void
{
}

public function testDoubleProphecyCreated(): void
{
}

public function testDoubleTestProxyCreated(): void
{
}
Expand Down
25 changes: 0 additions & 25 deletions tests/unit/Event/DispatchingEmitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -769,31 +769,6 @@ public function testTestDoublePartialMockCreatedDispatchesTestDoublePartialMockC
$emitter->testDoublePartialMockCreated();
}

public function testTestDoubleProphecyCreatedDispatchesTestDoubleProphecyCreatedEvent(): void
{
$subscriber = $this->createMock(TestDouble\ProphecyCreatedSubscriber::class);

$subscriber
->expects($this->once())
->method('notify')
->with($this->isInstanceOf(TestDouble\ProphecyCreated::class));

$dispatcher = self::createDispatcherWithRegisteredSubscriber(
TestDouble\ProphecyCreatedSubscriber::class,
TestDouble\ProphecyCreated::class,
$subscriber
);

$telemetrySystem = self::createTelemetrySystem();

$emitter = new DispatchingEmitter(
$dispatcher,
$telemetrySystem
);

$emitter->testDoubleProphecyCreated();
}

public function testTestDoubleTestProxyCreatedDispatchesTestDoubleTestProxyCreatedEvent(): void
{
$subscriber = $this->createMock(TestDouble\TestProxyCreatedSubscriber::class);
Expand Down
27 changes: 0 additions & 27 deletions tests/unit/Event/TestDouble/ProphecyCreatedTest.php

This file was deleted.

0 comments on commit f66f52b

Please sign in to comment.