Skip to content

Commit d9b70ae

Browse files
committedSep 29, 2017
cli test
1 parent 12b5c60 commit d9b70ae

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
 

‎composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swaggest/json-diff",
3-
"description": "JSON diff and merge tool for PHP",
3+
"description": "JSON diff and rearrange tool for PHP",
44
"type": "tool",
55
"license": "MIT",
66
"authors": [

‎tests/src/CliTest.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
namespace Swaggest\JsonDiff\Tests;
3+
4+
use Swaggest\JsonDiff\Cli\Diff;
5+
use Yaoi\Command\Definition;
6+
7+
class CliTest extends \PHPUnit_Framework_TestCase
8+
{
9+
public function testCli()
10+
{
11+
Diff::setUpDefinition(new Definition(), new \stdClass());
12+
13+
$d = new Diff();
14+
$d->originalPath = __DIR__ . '/../../composer.json';
15+
$d->newPath = __DIR__ . '/../../composer.json';
16+
17+
$d->action = Diff::ACTION_CHANGES;
18+
$d->performAction();
19+
20+
$d->action = Diff::ACTION_REARRANGE;
21+
$d->performAction();
22+
23+
$d->action = Diff::ACTION_ADDITIONS;
24+
$d->performAction();
25+
26+
$d->action = Diff::ACTION_MODIFICATIONS;
27+
$d->performAction();
28+
29+
$d->action = Diff::ACTION_REMOVALS;
30+
$d->performAction();
31+
}
32+
33+
34+
}

0 commit comments

Comments
 (0)
Please sign in to comment.