Небольшой рефакторинг по тестам

- `BasicTestCase::assertAtolable() => assertIsAtolable()`
- генерация тестовых объектов `Vat`, `Payment` и `Item` вынесены в `BasicTestCase`
This commit is contained in:
2021-12-07 20:04:03 +08:00
parent 1f3d5d2f3d
commit a34a6927d1
20 changed files with 220 additions and 168 deletions

View File

@@ -36,7 +36,7 @@ class AgentInfoTest extends BasicTestCase
*/
public function testConstructorWithoutArgs(): void
{
$this->assertAtolable(new AgentInfo(), []);
$this->assertIsAtolable(new AgentInfo(), []);
}
/**
@@ -63,20 +63,20 @@ class AgentInfoTest extends BasicTestCase
*/
public function testConstructorWithArgs(): void
{
$this->assertAtolable(new AgentInfo(null), []);
$this->assertAtolable(new AgentInfo(AgentTypes::ANOTHER), ['type' => AgentTypes::ANOTHER]);
$this->assertAtolable(new AgentInfo(pagent: new PayingAgent()), []);
$this->assertAtolable(new AgentInfo(mt_operator: new MoneyTransferOperator()), []);
$this->assertAtolable(new AgentInfo(rp_operator: new ReceivePaymentsOperator()), []);
$this->assertIsAtolable(new AgentInfo(null), []);
$this->assertIsAtolable(new AgentInfo(AgentTypes::ANOTHER), ['type' => AgentTypes::ANOTHER]);
$this->assertIsAtolable(new AgentInfo(pagent: new PayingAgent()), []);
$this->assertIsAtolable(new AgentInfo(mt_operator: new MoneyTransferOperator()), []);
$this->assertIsAtolable(new AgentInfo(rp_operator: new ReceivePaymentsOperator()), []);
$this->assertAtolable(new AgentInfo(
$this->assertIsAtolable(new AgentInfo(
AgentTypes::ANOTHER,
new PayingAgent(),
new ReceivePaymentsOperator(),
new MoneyTransferOperator(),
), ['type' => AgentTypes::ANOTHER]);
$this->assertAtolable(new AgentInfo(
$this->assertIsAtolable(new AgentInfo(
AgentTypes::ANOTHER,
new PayingAgent('test', ['+79518888888']),
new ReceivePaymentsOperator(['+79519999999']),