4) Tests\AppBundle\Form\AssetStatusTypeTest::testValidForm with data set #0 (array('active'))
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
'status' => 'active'
'type' => null
'amount' => null
- 'createdAt' => 2018-09-20T20:34:47.047520+0200
+ 'createdAt' => 2018-09-20T20:34:47.047870+0200
'updatedAt' => null
'contract' => null
'admin' => null
public function testValidForm($data)
{
$form = $this->factory->create(AssetStatusType::class);
$object = Entity::fromArray(new Asset(), $data);
$form->submit($data);
$this->assertTrue($form->isSynchronized());
$this->assertEquals($object, $form->getData());
$view = $form->createView();
$children = $view->children;
foreach (array_keys($data) as $key) {
$this->assertArrayHasKey($key, $children);
}
}
多少是
copied from the docs
.
createdAt
字段设置如下:
public function __construct()
{
if (empty($this->createdAt)) {
$this->createdAt = new \DateTime();
}
}
我的主要观点是:这个测试通过了我们的詹金斯。它不在几个开发人员机器上本地运行。我的第一个冲动是检查ini时区设置。
object
已创建,实际值为提交表单时的值。所以两个物体不能有相同的
precision
可能是超低。