forked from the-crucible/phpunit-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path32JsonFileEqualsJsonFile.php
More file actions
36 lines (34 loc) · 922 Bytes
/
32JsonFileEqualsJsonFile.php
File metadata and controls
36 lines (34 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* assertJsonFileEqualsJsonFile(
* mixed $expectedFile,
* mixed $actualFile[,
* string $message = '']
* )
*
* Reports an error identified by $message if the value
* of $actualFile does not match the value of $expectedFile.
*/
define('DS', DIRECTORY_SEPARATOR);
define('D_DIR' , dirname(__FILE__) . DS . 'data' . DS);
class JsonFileEqualsJsonFileTest extends PHPUnit_Framework_TestCase
{
/**
* File is different so this test will fail
*/
public function testFailure()
{
$this->assertJsonFileEqualsJsonFile(
D_DIR . 'file2.json', D_DIR . 'file3.json');
}
/**
* Content of file is different (white spaces added at the end).
* But the json is same so it will pass.
*/
public function testSuccess()
{
$this->assertJsonFileEqualsJsonFile(
D_DIR . 'file1.json', D_DIR . 'file2.json');
}
}
?>