/** * Get an activation. * * @api * * @since 1.0 * * @param int $id * * @return \ITELIC\Activation */ function itelic_get_activation($id) { $activation = \ITELIC\Activation::get($id); /** * Filters the activation as it is retrieved from the database. * * @since 1.0 * * @param \ITELIC\Activation $activation */ $filtered = apply_filters('itelic_get_activation', $activation); if ($filtered instanceof \ITELIC\Activation) { $activation = $filtered; } return $activation; }
/** * @depends test_expiring_license_expires_activations */ public function test_expiring_license_does_not_expire_deactivated_activations() { /** @var Key $key */ $key = $this->key_factory->create_and_get(array('product' => $this->product_factory->create(), 'customer' => 1)); $activation = $this->activation_factory->create(array('location' => 'a.com', 'key' => $key, 'status' => Activation::DEACTIVATED, 'deactivated' => \ITELIC\make_date_time())); $key->expire(); $activation = Activation::get($activation); $this->assertEquals(Activation::DEACTIVATED, $activation->get_status()); }