-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #390: Use opis/closure to serialize data
- Loading branch information
Showing
8 changed files
with
21 additions
and
36 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
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
use yii\debug\FlattenException; | ||
use yii\web\NotFoundHttpException; | ||
use Opis\Closure; | ||
|
||
/** | ||
* @author Dmitry Bashkarev <[email protected]> | ||
|
@@ -85,7 +86,7 @@ public function testArguments() | |
$dh = opendir(__DIR__); | ||
$fh = tmpfile(); | ||
|
||
$incomplete = unserialize('O:14:"BogusTestClass":0:{}'); | ||
$incomplete = Closure\unserialize('O:14:"BogusTestClass":0:{}'); | ||
|
||
$exception = $this->createException([ | ||
(object)['foo' => 1], | ||
|
@@ -151,7 +152,7 @@ public function testClosureSerialize() | |
}); | ||
|
||
$flattened = new FlattenException($exception); | ||
$this->assertContains('Closure', serialize($flattened)); | ||
$this->assertContains('Closure', Closure\serialize($flattened)); | ||
} | ||
|
||
public function testRecursionInArguments() | ||
|
@@ -162,7 +163,7 @@ public function testRecursionInArguments() | |
|
||
$flattened = new FlattenException($exception); | ||
$trace = $flattened->getTrace(); | ||
$this->assertContains('*DEEP NESTED ARRAY*', serialize($trace)); | ||
$this->assertContains('*DEEP NESTED ARRAY*', Closure\serialize($trace)); | ||
} | ||
|
||
public function testTooBigArray() | ||
|
@@ -184,7 +185,7 @@ public function testTooBigArray() | |
|
||
$this->assertSame($trace[0]['args'][0], ['array', ['array', '*SKIPPED over 10000 entries*']]); | ||
|
||
$serializeTrace = serialize($trace); | ||
$serializeTrace = Closure\serialize($trace); | ||
|
||
$this->assertContains('*SKIPPED over 10000 entries*', $serializeTrace); | ||
$this->assertNotContains('*value1*', $serializeTrace); | ||
|