Skip to content

Commit 2cc3779

Browse files
committed
Test EthereumAddress
1 parent 4624c2d commit 2cc3779

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Arifszn\AdvancedValidation\Tests\Rules;
4+
5+
use Arifszn\AdvancedValidation\Rules\EthereumAddress;
6+
use Arifszn\AdvancedValidation\Tests\TestCase;
7+
8+
class EthereumAddressTest extends TestCase
9+
{
10+
/**
11+
* @dataProvider provider
12+
*/
13+
public function testValidation($result, $value)
14+
{
15+
$this->assertEquals($result, (new EthereumAddress())->passes('foo', $value));
16+
}
17+
18+
public function provider()
19+
{
20+
return [
21+
[true, '0x0000000000000000000000000000000000000001'],
22+
[true, '0x683E07492fBDfDA84457C16546ac3f433BFaa128'],
23+
[true, '0x88dA6B6a8D3590e88E0FcadD5CEC56A7C9478319'],
24+
[true, '0x8a718a84ee7B1621E63E680371e0C03C417cCaF6'],
25+
[true, '0xFCb5AFB808b5679b4911230Aa41FfCD0cd335b42'],
26+
27+
[false, '0xGHIJK05pwm37asdf5555QWERZCXV2345AoEuIdHt'],
28+
[false, '0xFCb5AFB808b5679b4911230Aa41FfCD0cd335b422222'],
29+
[false, '0xFCb5AFB808b5679b4911230Aa41FfCD0cd33'],
30+
[false, '0b0110100001100101011011000110110001101111'],
31+
[false, '683E07492fBDfDA84457C16546ac3f433BFaa128'],
32+
[false, '1C6o5CDkLxjsVpnLSuqRs1UBFozXLEwYvU'],
33+
];
34+
}
35+
}

0 commit comments

Comments
 (0)