Example #1
0
 /**
  * Test that flush resets all data and that keys returns the correct keys.
  */
 public function testFlushAndKeys()
 {
     $test = [];
     for ($i = 1; $i <= 10; $i++) {
         Registry::set(new Base(), 'key' . $i);
         $test[] = 'key' . $i;
     }
     $registered = Registry::keys();
     $this->assertEquals($test, $registered);
     $this->assertEquals(10, count($registered));
     Registry::flush();
     $registered = Registry::keys();
     $this->assertEquals(0, count($registered));
 }