Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
add test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Apr 6, 2023
1 parent c62efcd commit 3f9108f
Show file tree
Hide file tree
Showing 26 changed files with 125 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor/
.phpunit.result.cache
phpunit.xml.bak
28 changes: 12 additions & 16 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</phpunit>
15 changes: 15 additions & 0 deletions tests/MatchesSnapshots.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Peerme\MxProviders\Tests;

use Spatie\Snapshots\MatchesSnapshots as MatchesSnapshotsBase;

trait MatchesSnapshots
{
use MatchesSnapshotsBase;

protected function getSnapshotDirectory(): string
{
return __DIR__.DIRECTORY_SEPARATOR.'__snapshots__';
}
}
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Psr7\Response;
use Peerme\MxProviders\ClientFactory;
use Peerme\MxProviders\Tests\MatchesSnapshots;
use Peerme\MxProviders\Tests\ResponseSnapshotDriver;
use Spatie\Snapshots\MatchesSnapshots;

uses()->compact();
uses(MatchesSnapshots::class)->in(__DIR__);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
O:52:"Peerme\MxProviders\Entities\TokenDetailedWithBalance":19:{s:10:"identifier";s:12:"WHALE-b018f0";s:4:"name";s:9:"Whalecoin";s:5:"owner";s:62:"erd1660va6y429mxz4dkgek0ssny8tccaaaaaaaaaabbbbbbbbbbxxxxxxxxxx";s:8:"decimals";i:6;s:8:"isPaused";b:0;s:6:"assets";N;s:10:"canUpgrade";b:1;s:7:"canMint";b:1;s:7:"canBurn";b:1;s:14:"canChangeOwner";b:1;s:8:"canPause";b:1;s:9:"canFreeze";b:1;s:7:"canWipe";b:1;s:7:"balance";O:21:"Brick\Math\BigInteger":1:{s:5:"value";s:13:"1000000000000";}s:6:"ticker";s:12:"WHALE-b018f0";s:5:"burnt";s:1:"0";s:6:"minted";s:19:"2644244444444000000";s:6:"supply";s:19:"3000000000000000000";s:11:"rawResponse";a:17:{s:10:"identifier";s:12:"WHALE-b018f0";s:4:"name";s:9:"Whalecoin";s:6:"ticker";s:12:"WHALE-b018f0";s:5:"owner";s:62:"erd1660va6y429mxz4dkgek0ssny8tccaaaaaaaaaabbbbbbbbbbxxxxxxxxxx";s:6:"minted";s:19:"2644244444444000000";s:5:"burnt";s:1:"0";s:8:"decimals";i:6;s:8:"isPaused";b:0;s:10:"canUpgrade";b:1;s:7:"canMint";b:1;s:7:"canBurn";b:1;s:14:"canChangeOwner";b:1;s:8:"canPause";b:1;s:9:"canFreeze";b:1;s:7:"canWipe";b:1;s:6:"supply";s:19:"3000000000000000000";s:7:"balance";s:13:"1000000000000";}}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
O:44:"Peerme\MxProviders\Entities\NetworkConstants":6:{s:7:"chainId";s:1:"1";s:14:"gasPerDataByte";i:1500;s:11:"minGasLimit";i:50000;s:11:"minGasPrice";i:1000000000;s:21:"minTransactionVersion";i:1;s:11:"rawResponse";a:5:{s:7:"chainId";s:1:"1";s:14:"gasPerDataByte";i:1500;s:11:"minGasLimit";i:50000;s:11:"minGasPrice";i:1000000000;s:21:"minTransactionVersion";i:1;}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
O:37:"Peerme\MxProviders\Entities\Economics":9:{s:11:"totalSupply";i:22738134;s:17:"circulatingSupply";i:20078134;s:6:"staked";i:12077642;s:5:"price";d:308.29;s:9:"marketCap";i:6087314698;s:3:"apr";d:0.145813;s:8:"topUpApr";d:0.110942;s:7:"baseApr";d:0.165715;s:11:"rawResponse";a:8:{s:11:"totalSupply";i:22738134;s:17:"circulatingSupply";i:20078134;s:6:"staked";i:12077642;s:5:"price";d:308.29;s:9:"marketCap";i:6087314698;s:3:"apr";d:0.145813;s:8:"topUpApr";d:0.110942;s:7:"baseApr";d:0.165715;}}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
i:0;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

0 comments on commit 3f9108f

Please sign in to comment.