-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add textmasters parameters in create project (#95)
- Loading branch information
1 parent
dec7c31
commit 1754907
Showing
5 changed files
with
131 additions
and
12 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
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,70 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Textmaster Api v1 client package. | ||
* | ||
* (c) Christian Daguerre <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Textmaster\Functional\Api; | ||
|
||
use Textmaster\Api\Author; | ||
use Textmaster\Client; | ||
use Textmaster\HttpClient\HttpClient; | ||
|
||
class AuthorTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Wait time between calls because the sandbox environment is not as fast as prod. | ||
*/ | ||
const WAIT_TIME = 3; | ||
|
||
/** | ||
* Author api. | ||
* | ||
* @var Author | ||
*/ | ||
protected $api; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$httpClient = new HttpClient('GFHunwb2DHw', 'gqvE7aZS_JM', | ||
['base_uri' => 'http://api.sandbox.textmaster.com/%s']); | ||
$client = new Client($httpClient); | ||
$this->api = $client->author(); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldShowAuthors() | ||
{ | ||
$result = $this->api->mine()->all(); | ||
|
||
$this->assertGreaterThan(0, $result['count']); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldShowAuthorsFiltered() | ||
{ | ||
$status = 'my_textmaster'; | ||
|
||
$result = $this->api->mine()->all($status); | ||
|
||
$this->assertGreaterThan(0, $result['count']); | ||
|
||
foreach ($result['my_authors'] as $author) { | ||
$this->assertSame($author['status'], $status); | ||
} | ||
} | ||
} |
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