1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace N98\Magento\Command\Integration; |
4
|
|
|
|
5
|
|
|
use N98\Magento\Command\TestCase; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class ListCommandTest |
9
|
|
|
* @package N98\Magento\Command\Script\Repository |
10
|
|
|
*/ |
11
|
|
|
class CreateReadDeleteTest extends TestCase |
12
|
|
|
{ |
13
|
|
|
public function testExecute() |
14
|
|
|
{ |
15
|
|
|
$generatedEmail = uniqid('', true) . '@example.com'; |
16
|
|
|
$generatedIntegrationName = uniqid('', true); |
17
|
|
|
|
18
|
|
|
$input = [ |
19
|
|
|
'command' => 'integration:create', |
20
|
|
|
'name' => $generatedIntegrationName, |
21
|
|
|
'email' => $generatedEmail, |
22
|
|
|
'endpoint' => 'https://example.com' |
23
|
|
|
]; |
24
|
|
|
$this->assertDisplayContains($input, $generatedIntegrationName); |
25
|
|
|
$this->assertDisplayContains($input, $generatedEmail); |
26
|
|
|
$this->assertDisplayContains($input, 'Access Token'); |
27
|
|
|
$this->assertDisplayContains($input, 'Access Token Secret'); |
28
|
|
|
$this->assertDisplayContains($input, 'Consumer Key'); |
29
|
|
|
|
30
|
|
|
$input = [ |
31
|
|
|
'command' => 'integration:show', |
32
|
|
|
'name' => $generatedIntegrationName, |
33
|
|
|
]; |
34
|
|
|
$this->assertDisplayContains($input, $generatedIntegrationName); |
35
|
|
|
|
36
|
|
|
$input = [ |
37
|
|
|
'command' => 'integration:delete', |
38
|
|
|
'name' => $generatedIntegrationName, |
39
|
|
|
]; |
40
|
|
|
$this->assertDisplayContains($input, $generatedIntegrationName); |
41
|
|
|
$this->assertDisplayContains($input, 'Successfully deleted integration'); |
42
|
|
|
} |
43
|
|
|
} |
44
|
|
|
|