Данные берутся из другого метода

/**
* @depends testChargeback
*/
public function testChargebackRepeal(array $iBalance)

/**
* @dataProvider cases
*/
public function testRun($xml, $restrictions, $wrongParams) {
$this->object->setXml($xml);
$this->object->setRestrictions($restrictions);

$result = $this->object->run();

$this->assertEquals(count($wrongParams), count($result));

}

public function cases() {
return array(
// case 0: без ошибок
array(
// xml
'<items>
<item>
<id>1381287</id>
<prx>3</prx>
</item>
<item>
<id>1381288</id>
<prx>3</prx>
</item>
</items>',

// restrictions
array(
'level' => array(
'min' => 0,
'max' => 5,
'required' => false
),
'auth_count' => array(
'min' => 0,
'max' => null,
'required' => false
),
),

// wrongParams
array(
// 'level' => 0,
// 'auth_count' => 0,
),
),

// case 1: без ошибок
array(
// xml
'<items>
<item>
<id>1381287</id>
<prx>3</prx>
<level>0</level>
</item>
<item>
<id>1381288</id>
<prx>3</prx>
<level>5</level>
</item>
</items>',

// restrictions
array(
'level' => array(
'min' => 0,
'max' => 5,
'required' => true
),
),

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

© 2012 Программирование в удовольствие Яндекс.Метрика Suffusion theme by Sayontan Sinha