Setup code quality and tests
This commit is contained in:
26
tests/Gateway_Functions_Test.php
Normal file
26
tests/Gateway_Functions_Test.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace WP_Ultimo\Tests;
|
||||
|
||||
use WP_Ultimo\Gateways\Manual_Gateway;
|
||||
use WP_Ultimo\Managers\Gateway_Manager;
|
||||
|
||||
class Gateway_Functions_Test extends \WP_UnitTestCase {
|
||||
|
||||
public function test_wu_get_gateway_returns_false_for_invalid_id() {
|
||||
$invalid_gateway_id = 'non_existent_gateway';
|
||||
|
||||
$result = wu_get_gateway($invalid_gateway_id);
|
||||
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
public function test_wu_get_gateway_returns_instance_for_valid_id() {
|
||||
$valid_gateway_id = 'manual';
|
||||
|
||||
$gateway = wu_get_gateway($valid_gateway_id);
|
||||
|
||||
$this->assertInstanceOf(Manual_Gateway::class, $gateway);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user