/** * testMagicSleepMethodReturnsExpectedSetOfPropertyNames * * @return void */ public function testMagicSleepMethodReturnsExpectedSetOfPropertyNames() { $class = new ASTClass(__CLASS__); $class->setCache(new MemoryCacheDriver()); $class->setNamespace(new ASTNamespace(__FUNCTION__)); $this->assertEquals(array('constants', 'interfaceReferences', 'parentClassReference', 'cache', 'context', 'docComment', 'endLine', 'modifiers', 'name', 'nodes', 'namespaceName', 'startLine', 'userDefined', 'id'), $class->__sleep()); }
/** * The magic sleep method will be called by PHP's runtime environment right * before an instance of this class gets serialized. It should return an * array with those property names that should be serialized for this class. * * @return array * @since 0.10.0 */ public function __sleep() { return array_merge(array('metadata'), parent::__sleep()); }