示例#1
0
 public function test_delete()
 {
     $input = ['name' => ['first' => 'Brad', 'last' => 'Bell'], 'spouse' => ['name' => ['first' => 'Brandon', 'last' => 'Kelly'], 'mood' => 'Happy', 'age' => '75'], 'mood' => 'Angry', 'age' => 25];
     $expect = ['name' => ['first' => 'Brad', 'last' => 'Bell'], 'spouse' => ['name' => ['first' => 'Brandon', 'last' => 'Kelly'], 'age' => '75'], 'mood' => 'Angry', 'age' => 25];
     $actual = $input;
     Dot::delete($actual, 'spouse.mood');
     $this->assertNotEquals($input, $actual);
     $this->assertEquals($expect, $actual);
 }
示例#2
0
 /**
  * @param string     $name
  * @param null|mixed $default
  *
  * @return null|Cookie
  */
 public function get($name, $default = null)
 {
     return Dot::get($this->cookies, $name, $default);
 }
示例#3
0
 /**
  * @return null|string
  */
 protected function getDefaultDomain()
 {
     return Dot::get($_SERVER, 'SERVER_NAME');
 }