示例#1
0
 /**
  * @covers sAdmin::sGetPaymentmean
  */
 public function testsGetPaymentmean()
 {
     // Empty argument, return false
     $this->assertFalse($this->module->sGetPaymentmean(''));
     // No matching payment mean, return empty array
     $this->assertEquals(array('country_surcharge' => array()), $this->module->sGetPaymentmean(-1));
     // Valid country returns valid data
     $result = $this->module->sGetPaymentmean(Shopware()->Db()->fetchOne('SELECT id FROM s_core_paymentmeans WHERE name = "debit"'));
     $this->assertEquals(array('id' => '2', 'name' => 'debit', 'description' => 'Lastschrift', 'template' => 'debit.tpl', 'class' => 'debit.php', 'table' => 's_user_debit', 'hide' => '0', 'additionaldescription' => 'Zusatztext', 'debit_percent' => '-10', 'surcharge' => '0', 'surchargestring' => '', 'position' => '4', 'active' => '1', 'esdactive' => '0', 'embediframe' => '', 'hideprospect' => '0', 'action' => '', 'pluginID' => NULL, 'source' => NULL, 'country_surcharge' => array()), $result);
     // Fetching for id or iso code gives the same result
     $this->assertEquals($this->module->sGetPaymentmean($result['name']), $result);
 }
 /**
  * @covers sAdmin::sGetPaymentmean
  */
 public function testsGetPaymentmean()
 {
     // Empty argument, return false
     $this->assertFalse($this->module->sGetPaymentmean(''));
     // No matching payment mean, return empty array
     $this->assertEquals(array('country_surcharge' => array()), $this->module->sGetPaymentmean(-1));
     // Valid country returns valid data
     $result = $this->module->sGetPaymentmean(Shopware()->Db()->fetchOne('SELECT id FROM s_core_paymentmeans WHERE name = "prepayment"'));
     $this->assertEquals(array('id' => '5', 'name' => 'prepayment', 'description' => 'Vorkasse', 'template' => 'prepayment.tpl', 'class' => 'prepayment.php', 'table' => '', 'hide' => '0', 'additionaldescription' => 'Sie zahlen einfach vorab und erhalten die Ware bequem und günstig bei Zahlungseingang nach Hause geliefert.', 'debit_percent' => '0', 'surcharge' => '0', 'surchargestring' => '', 'position' => '1', 'active' => '1', 'esdactive' => '0', 'mobile_inactive' => '0', 'embediframe' => '', 'hideprospect' => '0', 'action' => null, 'pluginID' => null, 'source' => null, 'country_surcharge' => array()), $result);
     // Fetching for id or iso code gives the same result
     $this->assertEquals($this->module->sGetPaymentmean($result['name']), $result);
 }