Page MenuHomePhorge

MandateTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

MandateTest.php

<?php
namespace Tests\Feature\Console\Wallet;
use Illuminate\Support\Facades\Queue;
use Tests\TestCase;
class MandateTest extends TestCase
{
/**
* {@inheritDoc}
*/
public function setUp(): void
{
parent::setUp();
$this->deleteTestUser('wallets-controller@kolabnow.com');
}
/**
* {@inheritDoc}
*/
public function tearDown(): void
{
$this->deleteTestUser('wallets-controller@kolabnow.com');
parent::tearDown();
}
/**
* Test command run for a specified wallet
*/
public function testHandle(): void
{
Queue::fake();
$user = $this->getTestUser('wallets-controller@kolabnow.com');
$wallet = $user->wallets()->first();
// Non-existing wallet
$code = \Artisan::call("wallet:mandate 123");
$output = trim(\Artisan::output());
$this->assertSame(1, $code);
$this->assertSame("Wallet not found.", $output);
// No mandate
$code = \Artisan::call("wallet:mandate {$wallet->id}");
$output = trim(\Artisan::output());
$this->assertSame(0, $code);
$this->assertSame("Auto-payment: none", $output);
// TODO: Test an existing mandate
$this->markTestIncomplete();
}
}

File Metadata

Mime Type
text/x-php
Expires
Thu, Nov 20, 9:10 PM (23 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387092
Default Alt Text
MandateTest.php (1 KB)

Event Timeline