Refactor dynamic segments get endpoint to doctrine
[MAILPOET-3177]
This commit is contained in:
committed by
Veljko V
parent
d42752fa99
commit
bd63ae508f
@ -13,6 +13,27 @@ class DynamicSegmentsResponseBuilderTest extends \MailPoetTest {
|
||||
$this->cleanup();
|
||||
}
|
||||
|
||||
public function testItBuildsGetResponse() {
|
||||
$name = 'Response Listings Builder Test';
|
||||
$description = 'Testing description';
|
||||
$segment = $this->createDynamicSegmentEntity($name, $description);
|
||||
$this->entityManager->flush();
|
||||
|
||||
/** @var DynamicSegmentsResponseBuilder $responseBuilder */
|
||||
$responseBuilder = $this->diContainer->get(DynamicSegmentsResponseBuilder::class);
|
||||
$response = $responseBuilder->build($segment);
|
||||
expect($response)->array();
|
||||
expect($response['id'])->equals($segment->getId());
|
||||
expect($response['name'])->equals($name);
|
||||
expect($response['description'])->equals($description);
|
||||
expect($response['type'])->equals(SegmentEntity::TYPE_DYNAMIC);
|
||||
expect($response['segmentType'])->equals(DynamicSegmentFilterEntity::TYPE_USER_ROLE);
|
||||
expect($response['wordpressRole'])->equals('editor');
|
||||
expect($response)->hasKey('created_at');
|
||||
expect($response)->hasKey('updated_at');
|
||||
expect($response)->hasKey('deleted_at');
|
||||
}
|
||||
|
||||
public function testItBuildsListingsResponse() {
|
||||
$name = 'Response Listings Builder Test';
|
||||
$description = 'Testing description';
|
||||
|
Reference in New Issue
Block a user