Question: I have the following table Items:

```
Id          MemberId          MemberGuid        ExpiryYear         Hash    
--------------------------------------------------------------------------- 
1           1                 Guid1             2017               Hash1
2           1                 Guid2             2018               Hash2
3           2                 Guid3             2020               Hash3
4           2                 Guid4             2017               Hash1

```

I need to copy the items from a member to another (not just to update MemberId, to insert a new record). The rule is: if I want to migrate all the items from a member to another, I will have to check that that item does not exists in the new member. 

For example, if I want to move the items from member 1 to member 2, I will move only item with id 2, because I already have an item at member 2 with the same hash and with the same expiry year (this are the columns that I need to check before inserting the new items). 

How to write a query that migrates only the non-existing items from a member to another and get the old id and the new id of the records? Somehow with an upsert?

Answer: 
In case this is useful to anyone:

The following code should work:

```
public function dataProvider()
{
    return [ [ /* dataset 1 */] , ... ]
}

protected setUp() {
    parent::setUp();
    $arguments = $this->getProvidedData();
    // $arguments should match the provided arguments for this test case
}

/** 
 * @dataProvider dataProvider
 */
public function testCase(...$arguments) {

}

```

The `getProvidedData` method seems to have been available since PHPUnit 5.6 (which was either shortly before or after this question was originally asked)
we can make the xmlCnf to static

```
private static $xmlCnf;

public function provider(){
    self::$xmlCnf = 'hello';
    var_dump(self::$xmlCnf); //hello
    return [...];
}

public function setUp() {
    var_dump(self::$xmlCnf); //hello
    parent::setUp();
}

```