function testProcessMailRecepients() { $mailer = new lmbMailer(array()); $recs = $mailer->processMailRecipients("bob@localhost"); $this->assertEqual(sizeof($recs), 1); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], ""); $recs = $mailer->processMailRecipients("Bob<bob@localhost>"); $this->assertEqual(sizeof($recs), 1); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], "Bob"); $recs = $mailer->processMailRecipients(array("bob@localhost")); $this->assertEqual(sizeof($recs), 1); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], ""); $recs = $mailer->processMailRecipients(array("name" => "Bob", "address" => "bob@localhost")); $this->assertEqual(sizeof($recs), 1); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], "Bob"); $recs = $mailer->processMailRecipients(array("Bob<bob@localhost>")); $this->assertEqual(sizeof($recs), 1); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], "Bob"); $recs = $mailer->processMailRecipients(array("bob@localhost", "todd@localhost")); $this->assertEqual(sizeof($recs), 2); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], ""); $this->assertEqual($recs[1]['address'], "todd@localhost"); $this->assertEqual($recs[1]['name'], ""); $recs = $mailer->processMailRecipients(array("Bob<bob@localhost>", "todd@localhost")); $this->assertEqual(sizeof($recs), 2); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], "Bob"); $this->assertEqual($recs[1]['address'], "todd@localhost"); $this->assertEqual($recs[1]['name'], ""); $recs = $mailer->processMailRecipients(array(array("name" => "Bob", "address" => "bob@localhost"), "todd@localhost")); $this->assertEqual(sizeof($recs), 2); $this->assertEqual($recs[0]['address'], "bob@localhost"); $this->assertEqual($recs[0]['name'], "Bob"); $this->assertEqual($recs[1]['address'], "todd@localhost"); $this->assertEqual($recs[1]['name'], ""); }