expectException('PHPUnit\Framework\Error\Deprecated'); $this->expectExceptionMessage( "Isbn->format is deprecated and will be removed in the future. Use the Isbn::convertToIsbn13 method instead. Learn more: https://git.io/JtAEx" ); $isbn = new Isbn('9782207258040'); $isbn->format('ISBN-13'); } public function testFormatIsbn13() { $isbn = new Isbn('9782207258040'); $this->assertEquals($isbn->format('ISBN-13'), "978-2-207-25804-0"); } public function testFormatIsbn10() { $isbn10 = new Isbn('9783464603529'); $this->assertEquals($isbn10->format('ISBN-10'), "3-464-60352-0"); } public function testFormatEan13() { $isbn10 = new Isbn("978-2-207-25804-0"); $this->assertEquals($isbn10->format('EAN'), "9782207258040"); } public function testFormatEan_13() { $isbn10 = new Isbn("978-2-207-25804-0"); $this->assertEquals($isbn10->format('EAN-13'), "9782207258040"); } public function testFormatGtin14() { $isbn = new Isbn('9783464603529'); $this->assertEquals($isbn->format('GTIN-14'), '19783464603526'); } public function testMauritiusRange() { $isbn = new Isbn('9786130971311'); $this->assertEquals($isbn->format('ISBN-13'), "978-613-0-97131-1"); } }