【发布时间】:2012-06-11 00:36:42
【问题描述】:
我正在尝试在我的本地机器上运行学说\mongo-odm 的测试套件。 php 在 is 测试中崩溃且没有错误消息(当我说崩溃时,我的意思是崩溃,php 进程终止):Doctrine\ODM\MongoDB\Test\Functional\FilesTest::testFiles。
测试内容如下:
public function testFiles()
{
$image = new File();
$image->setName('Test');
$image->setFile(__DIR__ . '/file.txt');
$profile = new Profile();
$profile->setFirstName('Jon');
$profile->setLastName('Wage');
$profile->setImage($image);
$this->dm->persist($profile);
$this->dm->flush();
$this->assertInstanceOf('Doctrine\MongoDB\GridFSFile', $image->getFile());
$this->assertFalse($image->getFile()->isDirty());
$this->assertEquals(__DIR__ . '/file.txt', $image->getFile()->getFilename());
$this->assertTrue(file_exists($image->getFile()->getFilename()));
$this->assertEquals('These are the bytes...', $image->getFile()->getBytes());
$image->setName('testing');
$this->dm->flush();
$this->dm->clear();
fails here ===>>$image = $this->dm->find('Documents\File', $image->getId());
$this->assertNotNull($image);
$this->assertEquals('testing', $image->getName());
$this->assertEquals('These are the bytes...', $image->getFile()->getBytes());
}
我已在Doctrine\MongoDB\Cursor::key() 中更深入地跟踪故障至mongoCursor->key()。
我已经使用 MongoFiles 命令行工具在我的系统上测试了 Mongo Grid FS,它运行良好。
没有错误消息,我不知道去哪里找。有人有建议吗?
【问题讨论】:
-
您使用的是哪个版本的驱动程序?
-
@Derick mongo 驱动程序版本 1.2.10,php 5.4 msvc9 ts
-
请在jira.mongodb.org提交错误报告。
-
德里克,感谢您的支持。我还没有提出错误报告,因为听起来它已经在开发版本中修复了 - 请参阅下面的 @bojori 的 cmets。
标签: mongodb doctrine-orm phpunit