From 4b8a9a5189a625bf99fedec7fd31f6e146410a14 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 26 Apr 2018 01:00:12 +0200 Subject: Update FB API library --- .../RandomBytesPseudoRandomStringGeneratorTest.php | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lib/facebook-graph-sdk/tests/PseudoRandomString/RandomBytesPseudoRandomStringGeneratorTest.php (limited to 'lib/facebook-graph-sdk/tests/PseudoRandomString/RandomBytesPseudoRandomStringGeneratorTest.php') diff --git a/lib/facebook-graph-sdk/tests/PseudoRandomString/RandomBytesPseudoRandomStringGeneratorTest.php b/lib/facebook-graph-sdk/tests/PseudoRandomString/RandomBytesPseudoRandomStringGeneratorTest.php new file mode 100644 index 0000000..61f2a46 --- /dev/null +++ b/lib/facebook-graph-sdk/tests/PseudoRandomString/RandomBytesPseudoRandomStringGeneratorTest.php @@ -0,0 +1,44 @@ +markTestSkipped( + 'Must have PHP 7 or paragonie/random_compat installed to test random_bytes().' + ); + } + + $csprng = new RandomBytesPseudoRandomStringGenerator; + $randomString = $csprng->getPseudoRandomString(10); + + $this->assertEquals(1, preg_match('/^([0-9a-f]+)$/', $randomString)); + $this->assertEquals(10, strlen($randomString)); + } +} -- cgit v1.2.3