public function testSuccesfulWhere() { setApiKey(); $charges = \Conekta\Charge::where(); $this->assertTrue(strpos(get_class($charges), 'Object') !== false); $this->assertTrue(strpos(get_class($charges[0]), 'Charge') !== false); }
public function testProcessingError() { $charges = \Conekta\Charge::where(); foreach ($charges as $charge) { if (strpos($charge->status, 'pre_authorized') !== false) { $ok = true; continue; } } try { if (isset($ok)) { $charge->capture(); } } catch (Exception $e) { $this->assertTrue(strpos(get_class($e), 'ProcessingError') !== false); } }