dir = vfsStream::setup('foo'); $contents = "Let's imagine that this is a table dump.\n"; vfsStream::newFile('dump.php')->at($this->dir)->setContent($contents . '#' . md5($contents) . "\n"); } public function testMigrateTableValidation() { // Since it's not really possible to unit test a raw shell script, this // is the next best thing -- it tests the procedure used by migrate-db.sh // to validate that a table dump has not been manually altered. $contents = rtrim($this->dir->getChild('dump.php')->getContent()); $this->assertSame(substr($contents, -32), md5(substr($contents, 0, -33))); } }