Upgrade tests to PhpUnit 10 (#5252)
This commit is contained in:
@@ -108,7 +108,7 @@ class InvoiceCreateCommandTest extends KernelTestCase
|
||||
$commandTester = $this->createInvoice($options);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('[ERROR] ' . $errorMessage, $output);
|
||||
self::assertStringContainsString('[ERROR] ' . $errorMessage, $output);
|
||||
}
|
||||
|
||||
public function testCreateWithUnknownExportFilter(): void
|
||||
@@ -174,13 +174,13 @@ class InvoiceCreateCommandTest extends KernelTestCase
|
||||
$commandTester = $this->createInvoice(['--user' => UserFixtures::USERNAME_SUPER_ADMIN, '--customer' => 1, '--template' => 'Invoice', '--start' => '2020-01-01', '--end' => '2020-03-01']);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('Created 1 invoice(s)', $output);
|
||||
$this->assertStringContainsString('| ID', $output);
|
||||
$this->assertStringContainsString('| Customer', $output);
|
||||
$this->assertStringContainsString('| Total', $output);
|
||||
$this->assertStringContainsString('| Filename', $output);
|
||||
$this->assertStringContainsString('0 EUR', $output);
|
||||
$this->assertStringContainsString('/tests/_data/invoices/' . ((new \DateTime())->format('Y')) . '-001-Test.html |', $output);
|
||||
self::assertStringContainsString('Created 1 invoice(s)', $output);
|
||||
self::assertStringContainsString('| ID', $output);
|
||||
self::assertStringContainsString('| Customer', $output);
|
||||
self::assertStringContainsString('| Total', $output);
|
||||
self::assertStringContainsString('| Filename', $output);
|
||||
self::assertStringContainsString('0 EUR', $output);
|
||||
self::assertStringContainsString('/tests/_data/invoices/' . ((new \DateTime())->format('Y')) . '-001-Test.html |', $output);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,7 +224,7 @@ class InvoiceCreateCommandTest extends KernelTestCase
|
||||
$commandTester = $this->createInvoice(['--user' => UserFixtures::USERNAME_SUPER_ADMIN, '--by-customer' => null, '--start' => $start->format('Y-m-d'), '--end' => $end->format('Y-m-d')]);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
self::assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
}
|
||||
|
||||
public function testCreateInvoiceByCustomerId(): void
|
||||
@@ -238,7 +238,7 @@ class InvoiceCreateCommandTest extends KernelTestCase
|
||||
$commandTester = $this->createInvoice(['--user' => UserFixtures::USERNAME_SUPER_ADMIN, '--customer' => $customer . ',1', '--start' => $start->format('Y-m-d'), '--end' => $end->format('Y-m-d')]);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
self::assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
}
|
||||
|
||||
public function testCreateInvoiceByProject(): void
|
||||
@@ -251,7 +251,7 @@ class InvoiceCreateCommandTest extends KernelTestCase
|
||||
$commandTester = $this->createInvoice(['--user' => UserFixtures::USERNAME_SUPER_ADMIN, '--exported' => 'all', '--by-project' => null, '--start' => $start->format('Y-m-d'), '--end' => $end->format('Y-m-d')]);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
self::assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
}
|
||||
|
||||
public function testCreateInvoiceByProjectId(): void
|
||||
@@ -264,7 +264,7 @@ class InvoiceCreateCommandTest extends KernelTestCase
|
||||
$commandTester = $this->createInvoice(['--user' => UserFixtures::USERNAME_SUPER_ADMIN, '--exported' => 'all', '--project' => '1', '--template' => 'Invoice', '--start' => $start->format('Y-m-d'), '--end' => $end->format('Y-m-d')]);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
self::assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
}
|
||||
|
||||
public function testCreateInvoiceByProjectWithPreview(): void
|
||||
@@ -277,6 +277,6 @@ class InvoiceCreateCommandTest extends KernelTestCase
|
||||
$commandTester = $this->createInvoice(['--user' => UserFixtures::USERNAME_SUPER_ADMIN, '--exported' => 'all', '--preview' => sys_get_temp_dir(), '--by-project' => null, '--start' => $start->format('Y-m-d'), '--end' => $end->format('Y-m-d')]);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
self::assertStringContainsString('Created 1 invoice(s) ', $output);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user