public function InvoiceNumberGenerationWebTestCase::testSimpleIdNumberGeneration in Commerce Invoice 7
File
- tests/
number_generation.test, line 69 - Implements tests for the theme switching rules.
Class
- InvoiceNumberGenerationWebTestCase
- @file Implements tests for the theme switching rules.
Code
public function testSimpleIdNumberGeneration() {
$this
->chooseNumberGenerationStrategy('[invoice_id]');
foreach (array(
1 => 1,
2 => 2,
) as $order_id => $invoice_number) {
$this
->createEmptyOrder();
// completing the order is supposed to create an invoice via rules
$this
->completeOrder($order_id);
$this
->drupalGet('admin/commerce/orders/' . $order_id . '/invoice');
$this
->assertPattern('@Invoice number:\\s*</div>\\s*' . preg_quote($invoice_number, '@') . '\\s@s');
}
}