assertNull($obj); unset($obj); // call dtor if object created $this->assertFileNotExists(sugar_cached("testevil.php")); } public function getDestructors() { return array( array("SugarCacheFile"), array("SugarTheme"), array("tcpdf"), array("ImportFile"), array("Zend_Http_Response_Stream"), ); } /** * @dataProvider getDestructors * */ public function testUnserializeExcept($name) { $len = strlen($name); $obj = 'test'; try { $obj = unserialize("O:$len:\"$name\":1:{s:4:\"test\";b:1;}"); } catch(Exception $e) { $obj = null; } $this->assertEmpty($obj); } }