public function testIsModifiedBypass() { $dataObjectMock = $this->getMockBuilder('Magento\\Framework\\DataObject')->disableOriginalConstructor()->setMethods(['getId', 'getData'])->getMock(); $dataObjectMock->expects($this->any())->method('getId')->willReturn(null); $dataObjectMock->expects($this->once())->method('getData')->willReturn(['is_billing_address' => 1]); $this->metadataMock->expects($this->once())->method('getFields')->with($dataObjectMock)->willReturn(['is_billing_address' => null]); $this->model->registerSnapshot($dataObjectMock); $this->assertEquals(true, $this->model->isModified($dataObjectMock)); }