Craft\ImportServiceTest::testRowShouldCallCallbackWhenSaveSucceeds PHP Method

testRowShouldCallCallbackWhenSaveSucceeds() public method

    public function testRowShouldCallCallbackWhenSaveSucceeds()
    {
        $row = 1;
        $historyId = 2;
        $settings = array('map' => array('field1', 'field2', 'dont'), 'type' => 'TypeExists', 'unique' => false, 'history' => $historyId);
        $data = array('settings1' => array(), 'settings2' => array(), 'dont' => array());
        $fields = array_combine($settings['map'], $data);
        unset($fields['dont']);
        $mockEntry = $this->getMockEntry();
        $mockEntry->expects($this->exactly(1))->method('setContentFromPost')->with($fields);
        $mockImportEntryService = $this->setMockImportEntryService($settings, $mockEntry, $fields, true);
        $mockImportEntryService->expects($this->exactly(1))->method('callback')->with($fields, $mockEntry);
        $service = new ImportService();
        $service->row($row, $data, $settings);
    }