-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from eclipxe13/master
Version 0.6.1
- Loading branch information
Showing
8 changed files
with
110 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\SatEstadoCfdi\Tests\Unit; | ||
|
||
use PhpCfdi\SatEstadoCfdi\CfdiStatus; | ||
use PhpCfdi\SatEstadoCfdi\Status\CancellableStatus; | ||
use PhpCfdi\SatEstadoCfdi\Status\CancellationStatus; | ||
use PhpCfdi\SatEstadoCfdi\Status\DocumentStatus; | ||
use PhpCfdi\SatEstadoCfdi\Status\QueryStatus; | ||
use PhpCfdi\SatEstadoCfdi\Tests\TestCase; | ||
use PHPUnit\Framework\Error\Deprecated; | ||
|
||
class CfdiStatusTest extends TestCase | ||
{ | ||
public function testActivePropertyThrowsDeprecationNotice(): void | ||
{ | ||
$cfdiStatus = new CfdiStatus( | ||
QueryStatus::found(), | ||
DocumentStatus::active(), | ||
CancellableStatus::notCancellable(), | ||
CancellationStatus::undefined() | ||
); | ||
|
||
// silence errors on this call to check that active returns the same as document | ||
$this->assertSame($cfdiStatus->document(), @$cfdiStatus->active()); | ||
|
||
// now call active without silence operator, this error will be catched as exception by phpunit | ||
$this->expectException(Deprecated::class); | ||
$cfdiStatus->active(); | ||
} | ||
|
||
public function testRequestPropertyThrowsDeprecationNotice(): void | ||
{ | ||
$cfdiStatus = new CfdiStatus( | ||
QueryStatus::found(), | ||
DocumentStatus::active(), | ||
CancellableStatus::notCancellable(), | ||
CancellationStatus::undefined() | ||
); | ||
|
||
// silence errors on this call to check that active returns the same as document | ||
$this->assertSame($cfdiStatus->query(), @$cfdiStatus->request()); | ||
|
||
// now call active without silence operator, this error will be catched as exception by phpunit | ||
$this->expectException(Deprecated::class); | ||
$cfdiStatus->request(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters