This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test for compareArray used in withMessage
- Loading branch information
speckmaier
committed
Oct 8, 2020
1 parent
b43ca66
commit 27a011c
Showing
4 changed files
with
145 additions
and
23 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,10 @@ | ||
<?php namespace Ipunkt\RabbitMQTests; | ||
|
||
/** | ||
* Class TestCase | ||
* @package Ipunkt\RabbitMQTests | ||
*/ | ||
class TestCase extends \Orchestra\Testbench\TestCase | ||
{ | ||
|
||
} |
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,89 @@ | ||
<?php namespace Ipunkt\RabbitMQTests\Unit; | ||
|
||
use Ipunkt\RabbitMQ\Test\TestsRabbitMQ; | ||
use Ipunkt\RabbitMQTests\TestCase; | ||
|
||
/** | ||
* Class TestsRabbitMQTest | ||
* @package Ipunkt\RabbitMQTests\Unit | ||
*/ | ||
class TestsRabbitMQTest extends TestCase | ||
{ | ||
use TestsRabbitMQ; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function compare_array_works_with_simple_values() | ||
{ | ||
$expected = [ | ||
'a' => 5, | ||
]; | ||
$actual = [ | ||
'a' => 5, | ||
]; | ||
|
||
$result = $this->compareArray($expected, $actual); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function compare_array_finds_differences_in_simple_values() | ||
{ | ||
$expected = [ | ||
'a' => 5, | ||
]; | ||
$actual = [ | ||
'a' => 6, | ||
]; | ||
|
||
$result = $this->compareArray($expected, $actual); | ||
|
||
$this->assertFalse($result); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function compare_array_works_with_nested_arrays() | ||
{ | ||
$expected = [ | ||
'a' => [ | ||
'b' => 5, | ||
] | ||
]; | ||
$actual = [ | ||
'a' => [ | ||
'b' => 5, | ||
] | ||
]; | ||
|
||
$result = $this->compareArray($expected, $actual); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function compare_array_finds_differences_with_nested_arrays() | ||
{ | ||
$expected = [ | ||
'a' => [ | ||
'b' => 5, | ||
] | ||
]; | ||
$actual = [ | ||
'a' => [ | ||
'b' => 6, | ||
] | ||
]; | ||
|
||
$result = $this->compareArray($expected, $actual); | ||
|
||
$this->assertFalse($result); | ||
} | ||
} |