public function testCustomTypeAndDiscard() { $this->assertFalse($this->flash->has("custom", "foo")); $this->assertFalse($this->flash->hasAny("custom")); $this->assertEquals("bar", $this->flash->get("custom", "foo", "bar")); $this->assertNull($this->flash->get("custom", "foo")); $this->assertEmpty($this->flash->getAllTypes()); $this->assertEmpty($this->flash->getAll("custom")); $this->flash->set("custom", "foo", "bar"); $this->flash = new FlashMessages($this->storage, $this->key); $this->assertArrayHasKey($this->key, $this->storage); $this->assertEmpty($this->storage[$this->key]); $this->assertEquals(["custom" => ["foo" => "bar"]], $this->flash->getAllTypes()); $this->assertEquals(["foo" => "bar"], $this->flash->getAll("custom")); $this->assertTrue($this->flash->has("custom", "foo")); $this->assertTrue($this->flash->hasAny("custom")); $this->assertEquals("bar", $this->flash->get("custom", "foo")); $this->flash->set("custom", "foo", "bar"); $this->assertArrayHasKey("custom", $this->storage[$this->key]); $this->assertEquals("bar", $this->storage[$this->key]["custom"]["foo"]); $this->flash->remove("custom", "foo"); $this->assertArrayNotHasKey("foo", $this->storage[$this->key]["custom"]); $this->flash = new FlashMessages($this->storage, $this->key); $this->assertFalse($this->flash->has("custom", "foo")); $this->assertNull($this->flash->get("custom", "foo")); }