Exemplo n.º 1
0
 public function test02()
 {
     ### startsWith($needle, $haystack)
     $this->assertTrue(Util::starts_with('Odd', 'Odd Greg'));
     $this->assertFalse(Util::starts_with('Greg', 'Odd Greg'));
     ### endsWith($needle, $haystack)
     $this->assertTrue(Util::ends_with('Greg', 'Odd Greg'));
     $this->assertFalse(Util::ends_with('Odd', 'Odd Greg'));
     ### stripTrailing($characters, $string)
     $this->assertEquals('All_The_Things', Util::strip_tail('_', "All_The_Things__"));
     $this->assertNotEquals('All_The_Things', Util::strip_tail('_', "All_The_Things--"));
     ### truncate($string, $endlength = "30", $end = "...")
     $this->assertEquals('A line tha...', Util::truncate("A line that is in need of shortening and I ain't talking about cooking.", $endlength = "10", $end = "..."));
 }
Exemplo n.º 2
0
 /**
  * Forget all of the queued listeners.
  *
  * @return void
  */
 function forgetQueued()
 {
     foreach ($this->listeners as $key => $value) {
         if (Util::ends_with('_queue', $key)) {
             $this->forget($key);
         }
     }
 }