/** * Test: get_billing_email */ function test_get_billing_email() { $object = new WC_Order(); $set_to = '*****@*****.**'; $object->set_billing_email($set_to); $this->assertEquals($set_to, $object->get_billing_email()); $set_to = 'not an email'; $this->setExpectedException('WC_Data_Exception'); $object->set_billing_email($set_to); $this->assertEquals('*****@*****.**', $object->get_billing_email()); }
/** * Test: get_billing_email */ function test_get_billing_email() { $object = new WC_Order(); $set_to = '*****@*****.**'; $object->set_billing_email($set_to); $this->assertEquals($set_to, $object->get_billing_email()); $set_to = 'not an email'; $object->set_billing_email($set_to); $this->assertEquals('', $object->get_billing_email()); }