$file = TEST_PATH . 'Toolkit/Members/files/memberdb.sql';
Toolkit_Common::createTables($this->pdo, $file);
-
- $this->object = new Toolkit_Members_Billing_Billing;
+
+ $this->object = new Toolkit_Members_Billing_Billing();
}
protected function getDatabaseTester()
$ret = $this->object->setMember_id(12);
$this->assertInstanceOf('Toolkit_Members_Billing_Billing', $ret);
}
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testSetBadMember_id() {
- $ret = $this->object->setMember_id('hhh');
+
+ public function testSetBadMemberId() {
+
+ $this->setExpectedException('InvalidArgumentException');
+ $this->object->setMemberId('hhh');
}
/**
$this->assertInstanceOf('Toolkit_Members_Billing_Billing', $ret);
}
- /**
- * @expectedException InvalidArgumentException
- */
public function testExceptionFromBadSetBillingType()
{
- $ret = $this->object->setBilling_type(null);
- $ret = $this->object->setBilling_type(9);
+ $this->setExpectedException('InvalidArgumentException');
+ $this->object->setBillingType(null);
+ $this->object->setBillingType(9);
}
/**
*/
public function testExceptionFromBadSetBillingTypeNumber()
{
- $ret = $this->object->setBilling_type(9);
+ $ret = $this->object->setBillingType(9);
}
/**
*/
public function testExceptionFromBadSetPaymentMethod()
{
- $ret = $this->object->setPayment_method('nen');
+ $ret = $this->object->setPaymentMethod('nen');
}
public function testInsertBilling()
{
$tester = $this->getDatabaseTester();
$tester->onSetUp();
-
+
$stub = $this->getMock(
'Toolkit_Members_Billing_Billing',
array('insert')
$stub->expects($this->once())
->method('insert');
$stub->insert($this->pdo);
-
+
// $ret = Toolkit_Members_Billing_Factory::createDbObjectByValues(
// 'Toolkit_Members_Billing_Billing',
// array(
// );
// $this->assertInstanceOf('Toolkit_Members_Billing_Billing', $ret);
// $ret->save($this->pdo);
-
+
$tester->onTearDown();
}
{
$tester = $this->getDatabaseTester();
$tester->onSetUp();
-
+
// $ret = Toolkit_Members_Billing_Factory::createDbObjectById(
// $this->pdo,
// 'Toolkit_Members_Billing_Billing',
// );
// $this->assertInstanceOf('Toolkit_Members_Billing_Billing', $ret);
// $ret->save($this->pdo);
-
+
$stub = $this->getMock('Toolkit_Members_Billing_Billing');
$stub->update($this->pdo);
-
+
$tester->onTearDown();
}
}
$file = TEST_PATH . 'Toolkit/Members/files/memberdb.sql';
Toolkit_Common::createTables($this->pdo, $file);
-
+
$this->object = new Toolkit_Members_Billing_MemberAccount();
}
protected function getDatabaseTester()
* This method is called after a test is executed.
*/
protected function tearDown() {
-
+
}
/**
$ret = $this->object->setMember_id(1);
$this->assertInstanceOf('Toolkit_Members_Billing_MemberAccount', $ret);
}
-
+
/**
* @expectedException InvalidArgumentException
*/
public function testSetMemberIdBadThrowsException()
{
$member_id = 'five';
- $this->object->setMember_id($member_id);
+ $this->object->setMemberId($member_id);
}
-
+
/**
* @expectedException InvalidArgumentException
*/
public function testSetPaymentTypeBadThrowsException()
{
$payment_type = 'five';
- $this->object->setPayment_type($payment_type);
+ $this->object->setPaymentType($payment_type);
}
-
+
/**
* @expectedException Exception
*/