Beispiel #1
0
 public function testToStringShouldReturnReadableNames()
 {
     $this->assertEquals("GTIN-8", (string) GtinFormat::GTIN_8());
     $this->assertEquals("GTIN-12", (string) GtinFormat::GTIN_12());
     $this->assertEquals("GTIN-13", (string) GtinFormat::GTIN_13());
     $this->assertEquals("GTIN-14", (string) GtinFormat::GTIN_14());
 }
Beispiel #2
0
 public function testGtin12ShouldParseToGtin()
 {
     /*string*/
     $gtin12 = "734092309436";
     /*Gtin*/
     $gtin = Gtin::create($gtin12);
     $this->assertEquals(GtinFormat::GTIN_12(), $gtin->format());
     $this->assertEquals(12, $gtin->length());
     $this->assertEquals($gtin12, (string) $gtin);
 }
Beispiel #3
0
 /**
  * @return an array of all of the GtinFormats.
  */
 public static function values()
 {
     return array("GTIN_8" => GtinFormat::GTIN_8(), "GTIN_12" => GtinFormat::GTIN_12(), "GTIN_13" => GtinFormat::GTIN_13(), "GTIN_14" => GtinFormat::GTIN_14());
 }