-
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.
- Loading branch information
Showing
1 changed file
with
79 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the haveibeenpwned-library package. | ||
* | ||
* (c) 2018 WEBEWEB | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace WBW\Library\HaveIBeenPwned\Tests\Fixtures\App; | ||
|
||
use WBW\Library\Core\Helper\Argument\StringHelper; | ||
|
||
/** | ||
* Test fixtures. | ||
* | ||
* @author webeweb <https://github.com/webeweb/> | ||
* @package WBW\Library\HaveIBeenPwned\Tests\Fixtures\App | ||
* @final | ||
*/ | ||
final class TestFixtures { | ||
|
||
/** | ||
* Sample breach response. | ||
* | ||
* @var string | ||
*/ | ||
const SAMPLE_BREACH_RESPONSE = <<<'EOTXT' | ||
[ | ||
{ | ||
"Name":"Adobe", | ||
"Title":"Adobe", | ||
"Domain":"adobe.com", | ||
"BreachDate":"2013-10-04", | ||
"AddedDate":"2013-12-04T00:00Z", | ||
"ModifiedDate":"2013-12-04T00:00Z", | ||
"PwnCount":152445165, | ||
"Description":"In October 2013, 153 million Adobe accounts were breached with each containing an internal ID, username, email, <em>encrypted</em> password and a password hint in plain text. The password cryptography was poorly done and <a href=\"http://stricture-group.com/files/adobe-top100.txt\" target=\"_blank\" rel=\"noopener\">many were quickly resolved back to plain text</a>. The unencrypted hints also <a href=\"http://www.troyhunt.com/2013/11/adobe-credentials-and-serious.html\" target=\"_blank\" rel=\"noopener\">disclosed much about the passwords</a> adding further to the risk that hundreds of millions of Adobe customers already faced.", | ||
"DataClasses":["Email addresses","Password hints","Passwords","Usernames"], | ||
"IsVerified":True, | ||
"IsSensitive":False, | ||
"IsRetired":False, | ||
"IsSpamList":False | ||
}, | ||
{ | ||
"Name":"BattlefieldHeroes", | ||
"Title":"Battlefield Heroes", | ||
"Domain":"battlefieldheroes.com", | ||
"BreachDate":"2011-06-26", | ||
"AddedDate":"2014-01-23T13:10Z", | ||
"ModifiedDate":"2014-01-23T13:10Z", | ||
"PwnCount":530270, | ||
"Description":"In June 2011 as part of a final breached data dump, the hacker collective "LulzSec" <a href=\"http://www.rockpapershotgun.com/2011/06/26/lulzsec-over-release-battlefield-heroes-data\" target=\"_blank\" rel=\"noopener\">obtained and released over half a million usernames and passwords from the game Battlefield Heroes</a>. The passwords were stored as MD5 hashes with no salt and many were easily converted back to their plain text versions.", | ||
"DataClasses":["Passwords","Usernames"], | ||
"IsVerified":True, | ||
"IsSensitive":False, | ||
"IsRetired":False, | ||
"IsSpamList":False | ||
} | ||
] | ||
EOTXT; | ||
|
||
/** | ||
* Get a sample breach response. | ||
* | ||
* @return array Returns a sample breach response. | ||
*/ | ||
public static function getSampleBreachResponse() { | ||
|
||
// Clean the response. | ||
$cleanResponse = StringHelper::replace(self::SAMPLE_BREACH_RESPONSE, [":True", ":False"], [":true", ":false"]); | ||
|
||
// Return the response. | ||
return json_decode($cleanResponse, true); | ||
} | ||
|
||
} |