Commit 51f551dd authored by Mark Harding's avatar Mark Harding

(fix): failing tests

1 merge request!327Subscription Requests - #604
Pipeline #82714849 passed with stages
in 10 minutes and 46 seconds
......@@ -105,7 +105,7 @@ class Manager
throw new SubscriptionRequestDoesntExistException();
}
if ($existing->getAccepted() !== null) {
if ($existing->isDeclined()) {
throw new SubscriptionRequestAlreadyCompletedException();
}
......@@ -130,7 +130,7 @@ class Manager
throw new SubscriptionRequestDoesntExistException();
}
if ($existing->getAccepted() !== null) {
if ($existing->isDeclined()) {
throw new SubscriptionRequestAlreadyCompletedException();
}
......
......@@ -67,9 +67,7 @@ class ManagerSpec extends ObjectBehavior
$this->repository->get("urn:subscription-request:123-456")
->willReturn($subscriptionRequest);
$this->repository->update(Argument::that(function ($sr) {
return $sr->getAccepted() === true;
}))
$this->repository->delete(Argument::any())
->willReturn(true);
$this->notificationsDelegate->onAccept($subscriptionRequest)
......@@ -92,7 +90,7 @@ class ManagerSpec extends ObjectBehavior
->willReturn($subscriptionRequest);
$this->repository->update(Argument::that(function ($sr) {
return $sr->getAccepted() === false;
return $sr->isDeclined() === true;
}))
->willReturn(true);
......
......@@ -31,8 +31,8 @@ class RepositorySpec extends ObjectBehavior
{
$this->db->request(Argument::that(function ($prepared) {
$query = $prepared->build();
return $query['values'][0] === '123'
&& $query['values'][1] === '456';
return $query['values'][0]->value() == '123'
&& $query['values'][1]->value() == '456';
}))
->willReturn(new Rows([
[
......@@ -54,7 +54,7 @@ class RepositorySpec extends ObjectBehavior
{
$this->db->request(Argument::that(function ($prepared) {
$query = $prepared->build();
return $query['values'][0] === '123';
return $query['values'][0]->value() == '123';
}))
->willReturn(new Rows([
[
......@@ -115,7 +115,7 @@ class RepositorySpec extends ObjectBehavior
$this->db->request(Argument::that(function ($prepared) {
$values = $prepared->build()['values'];
return $values[0]->value() == true
return $values[0] == true
&& $values[1]->value() === '123'
&& $values[2]->value() === '456';
}))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment