-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from patrykgruszka/DPMMA-2550_point-groups-api
DPMMA-2550 Point Groups API
- Loading branch information
Showing
4 changed files
with
294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* @copyright 2014 Mautic, NP. All rights reserved. | ||
* @author Mautic | ||
* | ||
* @see http://mautic.org | ||
* | ||
* @license MIT http://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace Mautic\Api; | ||
|
||
/** | ||
* Points Context. | ||
*/ | ||
class PointGroups extends Api | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected $endpoint = 'points/groups'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected $listName = 'pointGroups'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected $itemName = 'pointGroup'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected $searchCommands = [ | ||
'ids', | ||
'is:published', | ||
'is:unpublished', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mautic\Tests\Api; | ||
|
||
class PointGroupsTest extends MauticApiTestCase | ||
{ | ||
public function setUp(): void | ||
{ | ||
$this->api = $this->getContext('pointGroups'); | ||
$this->testPayload = [ | ||
'name' => 'New Point Group', | ||
'description' => 'Description of the new point group', | ||
]; | ||
} | ||
|
||
public function testGetList(): void | ||
{ | ||
$this->standardTestGetList(); | ||
} | ||
|
||
public function testGetListOfSpecificIds(): void | ||
{ | ||
$this->standardTestGetListOfSpecificIds(); | ||
} | ||
|
||
public function testCreateGetAndDelete(): void | ||
{ | ||
$this->standardTestCreateGetAndDelete(); | ||
} | ||
|
||
public function testEditPatch(): void | ||
{ | ||
$editTo = [ | ||
'name' => 'Updated Point Group Name', | ||
]; | ||
$this->standardTestEditPatch($editTo); | ||
} | ||
|
||
public function testEditPut(): void | ||
{ | ||
$this->standardTestEditPut(); | ||
} | ||
|
||
public function testBatchEndpoints(): void | ||
{ | ||
$this->standardTestBatchEndpoints(); | ||
} | ||
} |