/** * @dataProvider getErrorProvider */ public function testGetError($provided, $expected) { $SofortLibAbstractMock = new SofortLibAbstractMock(self::$configkey); if (count($provided) == 4) { $SofortLibAbstractMock->setError($provided[0], $provided[1], $provided[2], $provided[3]); } else { if (count($provided) == 3) { $SofortLibAbstractMock->setError($provided[0], $provided[1], $provided[2]); } else { if (count($provided) == 2) { $SofortLibAbstractMock->setError($provided[0], $provided[1]); } else { $SofortLibAbstractMock->setError($provided[0]); } } } if (isset($provided[1]) && in_array($provided[1], array('global', 'su', 'sr', 'not'))) { $provided[1] = $provided[1] == 'not' ? 'all' : $provided[1]; $this->assertFalse($SofortLibAbstractMock->getError($provided[1], 'test')); $this->assertEquals($expected, $SofortLibAbstractMock->getError($provided[1])); } else { $this->assertEquals($expected, $SofortLibAbstractMock->getError()); } $this->assertFalse($SofortLibAbstractMock->getError('su', array('testen' => 'test'))); }