Skip to content

Commit

Permalink
Fix failing intergration test (RAD-1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
foglcz committed Apr 13, 2018
1 parent 3948c9b commit 81f858f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/integration/RequestBuilder/EventsRequestBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@
use Lmc\Matej\IntegrationTests\IntegrationTestCase;
use Lmc\Matej\Model\Command\Interaction;
use Lmc\Matej\Model\Command\ItemProperty;
use Lmc\Matej\Model\Command\ItemPropertySetup;
use Lmc\Matej\Model\Command\UserMerge;
use Lmc\Matej\RequestBuilder\ItemPropertiesSetupRequestBuilder;

/**
* @covers \Lmc\Matej\RequestBuilder\EventsRequestBuilder
*/
class EventsRequestBuilderTest extends IntegrationTestCase
{
protected function setup(): void
{
$builder = $this->createMatejInstance()->request()->setupItemProperties();

$this->buildAndSendPropertySetupRequest($builder);
}

protected function tearDown(): void
{
$builder = $this->createMatejInstance()->request()->deleteItemProperties();

$this->buildAndSendPropertySetupRequest($builder);
}

/** @test */
public function shouldThrowExceptionWhenSendingBlankRequest(): void
{
Expand Down Expand Up @@ -51,4 +67,12 @@ public function shouldExecuteInteractionAndUserMergeAndItemPropertyCommands(): v

$this->assertResponseCommandStatuses($response, ...$this->generateOkStatuses(10));
}

private function buildAndSendPropertySetupRequest(ItemPropertiesSetupRequestBuilder $builder): void
{
$builder->addProperty(ItemPropertySetup::string('test_property_a'))
->addProperty(ItemPropertySetup::string('test_property_b'))
->addProperty(ItemPropertySetup::string('test_property_c'))
->send();
}
}

0 comments on commit 81f858f

Please sign in to comment.