function test_errors() { try { Event::find(99999); } catch (Artovenry\Wp\Error $e) { $this->assertInstanceOf("Artovenry\\Wp\\CustomPost\\Error", $e); $this->assertInstanceOf("Artovenry\\Wp\\CustomPost\\RecordNotFound", $e); } try { $event = Event::take(); $event->set_meta("hogehoge", 10); } catch (Artovenry\Wp\Error $e) { $this->assertInstanceOf("Artovenry\\Wp\\CustomPost\\AttributeNotDefined", $e); } try { $event = Event::take(); $event->set_meta("scheduled_on", []); } catch (Artovenry\Wp\Error $e) { $this->assertInstanceOf("Artovenry\\Wp\\CustomPost\\TypeIsNotScalar", $e); } }