Skip to content

Commit

Permalink
Enhance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed Feb 27, 2019
1 parent 5114b2a commit 0521b1c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3
- nightly

matrix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ composer require --dev adhocore/asserts

## Usage
```php
use Ahc\Asserts;
use Ahc\Asserts\Asserts;

class MyTest extends PHPUnit\Framework\Testcase
{
Expand Down
52 changes: 52 additions & 0 deletions tests/AssertsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

/*
* This file is part of the ASSERTS package.
*
* (c) Jitendra Adhikari <[email protected]>
* <https://github.com/adhocore>
*
* Licensed under MIT license.
*/

namespace Ahc\Asserts\Test;

use Ahc\Asserts\Asserts;
use PHPUnit\Framework\TestCase;

class AssertsTest extends TestCase
{
use Asserts;

public function testAssertJsonSubset()
{
$expected = [
'key1' => 'value1',
];

$actual = [
'key1' => 'value1',
'key2' => 'value2',
];

$this->assertJsonSubset($expected, $actual);
}

public function testAssertJsonSubsets()
{
$expected = [
'key1' => 'value1',
];

$expected2 = [
'key2' => 'value2',
];

$actual = [
'key1' => 'value1',
'key2' => 'value2',
];

$this->assertJsonSubsets($expected, $expected2, $actual);
}
}

0 comments on commit 0521b1c

Please sign in to comment.