Permalink
Browse files

Closes #277: serialize(): "comment" is returned …

… from __sleep multiple times in store in FileCacheDriver.php
  • Loading branch information...
manuelpichler committed Nov 23, 2016
1 parent cc609c8 commit 31cf053030310dcb1548c71968c1c127b585a2c7
@@ -236,7 +236,7 @@ public function accept(ASTVisitor $visitor, $data = null)
*/
public function __sleep()
{
return array_merge(array('comment', 'metadata', 'nodes'), parent::__sleep());
return array_merge(array('metadata'), parent::__sleep());
}
/**
@@ -42,6 +42,8 @@
namespace PDepend\Source\AST;
use PDepend\Util\Cache\Driver\MemoryCacheDriver;
/**
* Test case for the {@link \PDepend\Source\AST\ASTCatchStatement} class.
*
@@ -91,6 +93,38 @@ public function testAnonymousClassHasExpectedEndColumn()
$this->assertEquals(5, $expr->getEndColumn());
}
/**
* testMagicSleepMethodReturnsExpectedSetOfPropertyNames
*
* @return void
*/
public function testMagicSleepMethodReturnsExpectedSetOfPropertyNames()
{
$class = new ASTAnonymousClass(__CLASS__);
$class->setCache(new MemoryCacheDriver());
$this->assertEquals(
array(
'metadata',
'constants',
'interfaceReferences',
'parentClassReference',
'cache',
'context',
'comment',
'endLine',
'modifiers',
'name',
'nodes',
'namespaceName',
'startLine',
'userDefined',
'id'
),
$class->__sleep()
);
}
/**
* @return \PDepend\Source\AST\ASTAnonymousClass
*/

0 comments on commit 31cf053

Please sign in to comment.