/** * Get all valid identifiers as an associative array. * * @return array */ protected function getIdentifiers() { $ids = []; if ($this->isbn && $this->isbn->isValid()) { $ids['isbn'] = $this->isbn; } if ($this->issn && strlen($this->issn) == 8) { $ids['issn'] = $this->issn; } if ($this->oclc && strlen($this->oclc) > 0) { $ids['oclc'] = $this->oclc; } if ($this->upc && strlen($this->upc) > 0) { $ids['upc'] = $this->upc; } return $ids; }
/** * Test Invalid ISBN-10. * * @return void */ public function testInvalidISBN10() { // Invalid ISBN-10: $isbn = new ISBN('2314346323'); $this->assertFalse($isbn->get10()); $this->assertFalse($isbn->get13()); $this->assertFalse($isbn->isValid()); }