File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 2424 <testsuite name =" Datatables" >
2525 <directory suffix =" Test.php" >./tests/Datatables</directory >
2626 </testsuite >
27+ <testsuite name =" Helpers" >
28+ <directory suffix =" Test.php" >./tests/Helpers</directory >
29+ </testsuite >
2730 <testsuite name =" Menu" >
2831 <directory suffix =" Test.php" >./tests/Menu</directory >
2932 </testsuite >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Sebastienheyd \Boilerplate \Tests \Helpers ;
4+
5+ use Sebastienheyd \Boilerplate \Tests \TestCase ;
6+
7+ class ChannelHashTest extends TestCase
8+ {
9+ public function testChannelHashGeneratesSignature ()
10+ {
11+ $ signature = md5 ('Notifications|1 ' .config ('app.key ' ).config ('app.url ' ));
12+ $ expected = 'Notifications.1. ' .$ signature ;
13+
14+ $ this ->assertEquals ($ expected , channel_hash ('Notifications ' , 1 ));
15+ }
16+
17+ public function testChannelHashEqualsSuccess ()
18+ {
19+ $ signature = md5 ('Notifications|1 ' .config ('app.key ' ).config ('app.url ' ));
20+
21+ $ this ->assertTrue (channel_hash_equals ($ signature , 'Notifications ' , 1 ));
22+ }
23+
24+ public function testChannelHashEqualsFailure ()
25+ {
26+ $ signature = md5 ('Notifications|2 ' .config ('app.key ' ).config ('app.url ' ));
27+
28+ $ this ->assertFalse (channel_hash_equals ($ signature , 'Notifications ' , 1 ));
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments