dataObjectHelper = Bootstrap::getObjectManager()->get(DataObjectHelper::class); $this->dataObjectFactory = Bootstrap::getObjectManager()->get(DataObjectFactory::class); } /** * Test object is populated with data from array. * * @return void */ public function testPopulateWithArray(): void { $inputArray = [ 'first_a_second' => '1', 'first_at_second' => '1', 'first_a_t_m_second' => '1', 'random_attribute' => 'random' ]; $expectedData = [ 'first_a_second' => '1', 'first_at_second' => '1', 'first_a_t_m_second' => '1', ]; $object = $this->dataObjectFactory->create(); $this->dataObjectHelper->populateWithArray($object, $inputArray, DataObjectInterface::class); $this->assertEquals($expectedData, $object->getData()); } }