Skip to content

Commit

Permalink
Remove unnecessary onRejected callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Jul 8, 2015
1 parent 57a58ee commit 44a5cbb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
12 changes: 5 additions & 7 deletions tests/Connector/ConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testConnect()
$callback->method('__invoke')
->with($this->isInstanceOf(ClientInterface::class));

$promise->done($callback, $this->createCallback(0));
$promise->done($callback);

Loop\run();
}
Expand Down Expand Up @@ -115,7 +115,6 @@ public function testResolveEmpty()
$port = 443;
$timeout = 0.1;
$retries = 2;
$ips = ['127.0.0.1'];
$options = ['timeout' => 0.1, 'name' => '*.example.com'];

$this->resolver->shouldReceive('resolve')
Expand All @@ -139,7 +138,6 @@ public function testResolveFailure()
$port = 443;
$timeout = 0.1;
$retries = 2;
$ips = ['127.0.0.1'];
$options = ['timeout' => 0.1, 'name' => '*.example.com'];

$this->resolver->shouldReceive('resolve')
Expand Down Expand Up @@ -187,7 +185,7 @@ public function testConnectWithMultipleIPs()
$callback->method('__invoke')
->with($this->isInstanceOf(ClientInterface::class));

$promise->done($callback, $this->createCallback(0));
$promise->done($callback);

Loop\run();
}
Expand All @@ -210,7 +208,7 @@ public function testDomainUsedAsDefaultName()

$promise = new Coroutine($this->connector->connect($domain, $port));

$promise->done($this->createCallback(1), $this->createCallback(0));
$promise->done($this->createCallback(1));

Loop\run();
}
Expand Down Expand Up @@ -248,7 +246,7 @@ public function testConnectWithIPv4Address($ip)
$callback->method('__invoke')
->with($this->isInstanceOf(ClientInterface::class));

$promise->done($callback, $this->createCallback(0));
$promise->done($callback);

Loop\run();
}
Expand Down Expand Up @@ -286,7 +284,7 @@ public function testConnectWithIPv6Address($ip)
$callback->method('__invoke')
->with($this->isInstanceOf(ClientInterface::class));

$promise->done($callback, $this->createCallback(0));
$promise->done($callback);

Loop\run();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/ExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function execute($type, $domain, $request, $response, array $answers = nu
}
};

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run();
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Executor/MultiExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function execute($type, $domain, $request, $response, array $answers = nu
$callback->method('__invoke')
->with($this->identicalTo($message));

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run();
}
Expand Down Expand Up @@ -116,7 +116,7 @@ public function testRetriesAfterThrownMessageException()
$callback->method('__invoke')
->with($this->isInstanceOf(Message::class));

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run();
}
Expand Down Expand Up @@ -145,7 +145,7 @@ public function testNextRequestUsesLastRespondingExecutor()
$callback->method('__invoke')
->with($this->isInstanceOf(Message::class));

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run(); // Should shift first executor to back of list.

Expand All @@ -155,7 +155,7 @@ public function testNextRequestUsesLastRespondingExecutor()
$callback->method('__invoke')
->with($this->isInstanceOf(Message::class));

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run(); // Should call second executor first.
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Resolver/ResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testResolve($domain, $request, $response, array $answers = null,
$callback->method('__invoke')
->with($this->equalTo($result));

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run();
}
Expand All @@ -81,7 +81,7 @@ public function testNotFound()
$callback->method('__invoke')
->with($this->identicalTo([]));

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run();
}
Expand All @@ -97,7 +97,7 @@ public function testLocalhost()
$callback->method('__invoke')
->with($this->equalTo(['127.0.0.1']));

$coroutine->done($callback, $this->createCallback(0));
$coroutine->done($callback);

Loop\run();
}
Expand Down

0 comments on commit 44a5cbb

Please sign in to comment.