Exemplo n.º 1
0
 /**
  * @param mixed $certificate
  *
  * @return bool
  */
 public static function isPemFormat($certificate) : bool
 {
     if (!is_string($certificate)) {
         return FALSE;
     }
     return StringTools::contains($certificate, '-----BEGIN CERTIFICATE-----');
 }
Exemplo n.º 2
0
 public function testContains()
 {
     $this->assertTrue(StringTools::contains('foobar', 'foobar'));
     $this->assertTrue(StringTools::contains('foobar', 'foo'));
     $this->assertTrue(StringTools::contains('foobar', 'bar'));
     $this->assertTrue(StringTools::contains('foobar', 'ooba'));
     $this->assertTrue(StringTools::contains('foobar', 'ob'));
     $this->assertFalse(StringTools::contains('foobar', '42'));
 }