From 388a07983440d99e833356fff22f8e00160a47bc Mon Sep 17 00:00:00 2001 From: alext Date: Wed, 9 Nov 2016 19:56:24 +0100 Subject: [PATCH] Renamed Alphanumeric type class to Text. --- src/application/controllers/Appointments.php | 22 +++++++++---------- src/application/controllers/Backend_api.php | 22 +++++++++---------- src/application/controllers/User.php | 4 ++-- .../controllers/api/v1/API_V1_Controller.php | 6 ++--- src/application/controllers/api/v1/Admins.php | 4 ++-- .../controllers/api/v1/Appointments.php | 4 ++-- .../controllers/api/v1/Categories.php | 4 ++-- .../controllers/api/v1/Customers.php | 4 ++-- .../controllers/api/v1/Providers.php | 4 ++-- .../controllers/api/v1/Secretaries.php | 4 ++-- .../controllers/api/v1/Services.php | 4 ++-- .../controllers/api/v1/Unavailabilities.php | 4 ++-- src/engine/Api/V1/Authorization.php | 8 +++---- src/engine/Api/V1/Response.php | 6 ++--- src/engine/Notifications/Email.php | 16 +++++++------- src/engine/Types/Email.php | 2 +- ...EmptyAlphanumeric.php => NonEmptyText.php} | 2 +- .../Types/{Alphanumeric.php => Text.php} | 2 +- src/engine/Types/Url.php | 2 +- test/php/engine/Api/V1/AuthorizationTest.php | 2 +- ...hanumericTest.php => NonEmptyTextTest.php} | 6 ++--- .../{AlphanumericTest.php => TextTest.php} | 6 ++--- 22 files changed, 69 insertions(+), 69 deletions(-) rename src/engine/Types/{NonEmptyAlphanumeric.php => NonEmptyText.php} (92%) rename src/engine/Types/{Alphanumeric.php => Text.php} (94%) rename test/php/engine/Types/{NonEmptyAlphanumericTest.php => NonEmptyTextTest.php} (88%) rename test/php/engine/Types/{AlphanumericTest.php => TextTest.php} (84%) diff --git a/src/application/controllers/Appointments.php b/src/application/controllers/Appointments.php index cc37605b..ba1d22c1 100755 --- a/src/application/controllers/Appointments.php +++ b/src/application/controllers/Appointments.php @@ -11,7 +11,7 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ -use \EA\Engine\Types\Alphanumeric; +use \EA\Engine\Types\Text; use \EA\Engine\Types\Email; use \EA\Engine\Types\Url; @@ -203,7 +203,7 @@ class Appointments extends CI_Controller { if ($send_provider === TRUE) { $email->sendDeleteAppointment($appointment, $provider, $service, $customer, $company_settings, new Email($provider['email']), - new Alphanumeric($_POST['cancel_reason'])); + new Text($_POST['cancel_reason'])); } $send_customer = filter_var($this->settings_model->get_setting('customer_notifications'), @@ -212,7 +212,7 @@ class Appointments extends CI_Controller { if ($send_customer === TRUE) { $email->sendDeleteAppointment($appointment, $provider, $service, $customer, $company_settings, new Email($customer['email']), - new Alphanumeric($_POST['cancel_reason'])); + new Text($_POST['cancel_reason'])); } } catch(Exception $exc) { @@ -431,16 +431,16 @@ class Appointments extends CI_Controller { $email = new \EA\Engine\Notifications\Email($this, $this->config->config); if ($post_data['manage_mode'] == FALSE) { - $customer_title = new Alphanumeric($this->lang->line('appointment_booked')); - $customer_message = new Alphanumeric($this->lang->line('thank_you_for_appointment')); - $provider_title = new Alphanumeric($this->lang->line('appointment_added_to_your_plan')); - $provider_message = new Alphanumeric($this->lang->line('appointment_link_description')); + $customer_title = new Text($this->lang->line('appointment_booked')); + $customer_message = new Text($this->lang->line('thank_you_for_appointment')); + $provider_title = new Text($this->lang->line('appointment_added_to_your_plan')); + $provider_message = new Text($this->lang->line('appointment_link_description')); } else { - $customer_title = new Alphanumeric($this->lang->line('appointment_changes_saved')); - $customer_message = new Alphanumeric(''); - $provider_title = new Alphanumeric($this->lang->line('appointment_details_changed')); - $provider_message = new Alphanumeric(''); + $customer_title = new Text($this->lang->line('appointment_changes_saved')); + $customer_message = new Text(''); + $provider_title = new Text($this->lang->line('appointment_details_changed')); + $provider_message = new Text(''); } $customer_link = new Url(site_url('appointments/index/' . $appointment['hash'])); diff --git a/src/application/controllers/Backend_api.php b/src/application/controllers/Backend_api.php index 0a744daf..2c76b7f7 100644 --- a/src/application/controllers/Backend_api.php +++ b/src/application/controllers/Backend_api.php @@ -11,7 +11,7 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ -use \EA\Engine\Types\Alphanumeric; +use \EA\Engine\Types\Text; use \EA\Engine\Types\Email; use \EA\Engine\Types\Url; @@ -295,15 +295,15 @@ class Backend_api extends CI_Controller { ->get_setting('notifications', $provider['id']); if (!$manage_mode) { - $customer_title = new Alphanumeric($this->lang->line('appointment_booked')); - $customer_message = new Alphanumeric($this->lang->line('thank_you_for_appointment')); - $provider_title = new Alphanumeric($this->lang->line('appointment_added_to_your_plan')); - $provider_message = new Alphanumeric($this->lang->line('appointment_link_description')); + $customer_title = new Text($this->lang->line('appointment_booked')); + $customer_message = new Text($this->lang->line('thank_you_for_appointment')); + $provider_title = new Text($this->lang->line('appointment_added_to_your_plan')); + $provider_message = new Text($this->lang->line('appointment_link_description')); } else { - $customer_title = new Alphanumeric($this->lang->line('appointment_changes_saved')); - $customer_message = new Alphanumeric(''); - $provider_title = new Alphanumeric($this->lang->line('appointment_details_changed')); - $provider_message = new Alphanumeric(''); + $customer_title = new Text($this->lang->line('appointment_changes_saved')); + $customer_message = new Text(''); + $provider_title = new Text($this->lang->line('appointment_details_changed')); + $provider_message = new Text(''); } $customer_link = new Url(site_url('appointments/index/' . $appointment['hash'])); @@ -410,7 +410,7 @@ class Backend_api extends CI_Controller { if ((bool)$send_provider === TRUE) { $email->sendDeleteAppointment($appointment, $provider, $service, $customer, $company_settings, new Email($provider['email']), - new Alphanumeric($_POST['delete_reason'])); + new Text($_POST['delete_reason'])); } $send_customer = $this->settings_model->get_setting('customer_notifications'); @@ -418,7 +418,7 @@ class Backend_api extends CI_Controller { if ((bool)$send_customer === TRUE) { $email->sendDeleteAppointment($appointment, $provider, $service, $customer, $company_settings, new Email($customer['email']), - new Alphanumeric($_POST['delete_reason'])); + new Text($_POST['delete_reason'])); } } catch(Exception $exc) { $warnings[] = exceptionToJavaScript($exc); diff --git a/src/application/controllers/User.php b/src/application/controllers/User.php index 83b558bc..3d1613e4 100644 --- a/src/application/controllers/User.php +++ b/src/application/controllers/User.php @@ -11,7 +11,7 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; use \EA\Engine\Types\Email; /** @@ -159,7 +159,7 @@ class User extends CI_Controller { 'company_email' => $this->settings_model->get_setting('company_email') ); - $email->sendPassword(new NonEmptyAlphanumeric($new_password), new Email($_POST['email']), $company_settings); + $email->sendPassword(new NonEmptyText($new_password), new Email($_POST['email']), $company_settings); } echo ($new_password != FALSE) ? json_encode(AJAX_SUCCESS) : json_encode(AJAX_FAILURE); diff --git a/src/application/controllers/api/v1/API_V1_Controller.php b/src/application/controllers/api/v1/API_V1_Controller.php index 866f96aa..c298e02f 100644 --- a/src/application/controllers/api/v1/API_V1_Controller.php +++ b/src/application/controllers/api/v1/API_V1_Controller.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * API V1 Controller @@ -41,8 +41,8 @@ class API_V1_Controller extends CI_Controller { parent::__construct(); try { - $username = new NonEmptyAlphanumeric($_SERVER['PHP_AUTH_USER']); - $password = new NonEmptyAlphanumeric($_SERVER['PHP_AUTH_PW']); + $username = new NonEmptyText($_SERVER['PHP_AUTH_USER']); + $password = new NonEmptyText($_SERVER['PHP_AUTH_PW']); $authorization = new \EA\Engine\Api\V1\Authorization($this); $authorization->basic($username, $password); } catch(\Exception $exception) { diff --git a/src/application/controllers/api/v1/Admins.php b/src/application/controllers/api/v1/Admins.php index 35a46809..e0643937 100644 --- a/src/application/controllers/api/v1/Admins.php +++ b/src/application/controllers/api/v1/Admins.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Admins Controller @@ -88,7 +88,7 @@ class Admins extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->admins_model->get_batch('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch (\Exception $exception) { $this->_handleException($exception); diff --git a/src/application/controllers/api/v1/Appointments.php b/src/application/controllers/api/v1/Appointments.php index d6c1ec53..ae3cec2a 100644 --- a/src/application/controllers/api/v1/Appointments.php +++ b/src/application/controllers/api/v1/Appointments.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Appointments Controller @@ -88,7 +88,7 @@ class Appointments extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->appointments_model->get_batch('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch(\Exception $exception) { exit($this->_handleException($exception)); diff --git a/src/application/controllers/api/v1/Categories.php b/src/application/controllers/api/v1/Categories.php index 9c321008..d1ab911f 100644 --- a/src/application/controllers/api/v1/Categories.php +++ b/src/application/controllers/api/v1/Categories.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Categories Controller @@ -88,7 +88,7 @@ class Categories extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->services_model->get_all_categories('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch (\Exception $exception) { $this->_handleException($exception); diff --git a/src/application/controllers/api/v1/Customers.php b/src/application/controllers/api/v1/Customers.php index ddbfeee8..e1615507 100644 --- a/src/application/controllers/api/v1/Customers.php +++ b/src/application/controllers/api/v1/Customers.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Customers Controller @@ -88,7 +88,7 @@ class Customers extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->customers_model->get_batch('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch (\Exception $exception) { $this->_handleException($exception); diff --git a/src/application/controllers/api/v1/Providers.php b/src/application/controllers/api/v1/Providers.php index 8249cd65..b02babbf 100644 --- a/src/application/controllers/api/v1/Providers.php +++ b/src/application/controllers/api/v1/Providers.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Providers Controller @@ -88,7 +88,7 @@ class Providers extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->providers_model->get_batch('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch (\Exception $exception) { $this->_handleException($exception); diff --git a/src/application/controllers/api/v1/Secretaries.php b/src/application/controllers/api/v1/Secretaries.php index 3ca8d84f..27f9ca52 100644 --- a/src/application/controllers/api/v1/Secretaries.php +++ b/src/application/controllers/api/v1/Secretaries.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Secretaries Controller @@ -88,7 +88,7 @@ class Secretaries extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->secretaries_model->get_batch('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch (\Exception $exception) { $this->_handleException($exception); diff --git a/src/application/controllers/api/v1/Services.php b/src/application/controllers/api/v1/Services.php index 2068157f..c481ad52 100644 --- a/src/application/controllers/api/v1/Services.php +++ b/src/application/controllers/api/v1/Services.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Services Controller @@ -88,7 +88,7 @@ class Services extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->services_model->get_batch('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch (\Exception $exception) { $this->_handleException($exception); diff --git a/src/application/controllers/api/v1/Unavailabilities.php b/src/application/controllers/api/v1/Unavailabilities.php index 2e4bdaf1..46509110 100644 --- a/src/application/controllers/api/v1/Unavailabilities.php +++ b/src/application/controllers/api/v1/Unavailabilities.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/API_V1_Controller.php'; use \EA\Engine\Api\V1\Response; use \EA\Engine\Api\V1\Request; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * Unavailabilities Controller @@ -88,7 +88,7 @@ class Unavailabilities extends API_V1_Controller { // Fetch the new object from the database and return it to the client. $batch = $this->appointments_model->get_batch('id = ' . $id); $response = new Response($batch); - $status = new NonEmptyAlphanumeric('201 Created'); + $status = new NonEmptyText('201 Created'); $response->encode($this->parser)->singleEntry(true)->output($status); } catch(\Exception $exception) { exit($this->_handleException($exception)); diff --git a/src/engine/Api/V1/Authorization.php b/src/engine/Api/V1/Authorization.php index 42961e84..7621c75b 100644 --- a/src/engine/Api/V1/Authorization.php +++ b/src/engine/Api/V1/Authorization.php @@ -13,7 +13,7 @@ namespace EA\Engine\Api\V1; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; /** * API v1 Authorization Class @@ -40,12 +40,12 @@ class Authorization { /** * Perform Basic Authentication * - * @param NonEmptyAlphanumeric $username Admin Username - * @param NonEmptyAlphanumeric $password Admin Password + * @param NonEmptyText $username Admin Username + * @param NonEmptyText $password Admin Password * * @throws \EA\Engine\Api\V1\Exception Throws 401-Unauthorized exception if the authentication fails. */ - public function basic(NonEmptyAlphanumeric $username, NonEmptyAlphanumeric $password) { + public function basic(NonEmptyText $username, NonEmptyText $password) { $this->framework->load->model('user_model'); if (!$this->framework->user_model->check_login($username->get(), $password->get())) { diff --git a/src/engine/Api/V1/Response.php b/src/engine/Api/V1/Response.php index 9c7e04d8..04c29aec 100644 --- a/src/engine/Api/V1/Response.php +++ b/src/engine/Api/V1/Response.php @@ -13,7 +13,7 @@ namespace EA\Engine\Api\V1; -use EA\Engine\Types\NonEmptyAlphanumeric; +use EA\Engine\Types\NonEmptyText; /** * API v1 Response @@ -124,12 +124,12 @@ class Response { /** * Output the response as a JSON with the provided status header. * - * @param \EA\Engine\Types\NonEmptyAlphanumeric $status Optional (null), if provided it must contain the status + * @param \EA\Engine\Types\NonEmptyText $status Optional (null), if provided it must contain the status * header value. Default string: '200 OK'. * * @return \EA\Engine\Api\V1\Response */ - public function output(NonEmptyAlphanumeric $status = null) { + public function output(NonEmptyText $status = null) { $header = $status ? $status->get() : '200 OK'; header('HTTP/1.0 ' . $header); diff --git a/src/engine/Notifications/Email.php b/src/engine/Notifications/Email.php index f17dc3a2..2ef7293d 100644 --- a/src/engine/Notifications/Email.php +++ b/src/engine/Notifications/Email.php @@ -13,8 +13,8 @@ namespace EA\Engine\Notifications; -use \EA\Engine\Types\Alphanumeric; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\Text; +use \EA\Engine\Types\NonEmptyText; use \EA\Engine\Types\Url; use \EA\Engine\Types\Email as EmailAddress; @@ -82,14 +82,14 @@ class Email { * @param array $customer Contains the customer data. * @param array $company Contains settings of the company. By the time the * "company_name", "company_link" and "company_email" values are required in the array. - * @param \EA\Engine\Types\Alphanumeric $title The email title may vary depending the receiver. - * @param \EA\Engine\Types\Alphanumeric $message The email message may vary depending the receiver. + * @param \EA\Engine\Types\Text $title The email title may vary depending the receiver. + * @param \EA\Engine\Types\Text $message The email message may vary depending the receiver. * @param \EA\Engine\Types\Url $appointmentLink This link is going to enable the receiver to make changes * to the appointment record. * @param \EA\Engine\Types\Email $recipientEmail The recipient email address. */ public function sendAppointmentDetails(array $appointment, array $provider, array $service, - array $customer, array $company, Alphanumeric $title, Alphanumeric $message, Url $appointmentLink, + array $customer, array $company, Text $title, Text $message, Url $appointmentLink, EmailAddress $recipientEmail) { // Prepare template replace array. @@ -159,7 +159,7 @@ class Email { */ public function sendDeleteAppointment(array $appointment, array $provider, array $service, array $customer, array $company, EmailAddress $recipientEmail, - Alphanumeric $reason) { + Text $reason) { // Prepare email template data. $replaceArray = array( '$email_title' => $this->framework->lang->line('appointment_cancelled_title'), @@ -211,11 +211,11 @@ class Email { /** * This method sends an email with the new password of a user. * - * @param \EA\Engine\Types\NonEmptyAlphanumeric $password Contains the new password. + * @param \EA\Engine\Types\NonEmptyText $password Contains the new password. * @param \EA\Engine\Types\Email $recipientEmail The receiver's email address. * @param array $company The company settings to be included in the email. */ - public function sendPassword(NonEmptyAlphanumeric $password, EmailAddress $recipientEmail, array $company) { + public function sendPassword(NonEmptyText $password, EmailAddress $recipientEmail, array $company) { $replaceArray = array( '$email_title' => $this->framework->lang->line('new_account_password'), '$email_message' => $this->framework->lang->line('new_password_is'), diff --git a/src/engine/Types/Email.php b/src/engine/Types/Email.php index e40c73b1..b2c461ff 100644 --- a/src/engine/Types/Email.php +++ b/src/engine/Types/Email.php @@ -13,7 +13,7 @@ namespace EA\Engine\Types; -class Email extends NonEmptyAlphanumeric { +class Email extends NonEmptyText { protected function _validate($value) { return parent::_validate($value) && filter_var($value, FILTER_VALIDATE_EMAIL); } diff --git a/src/engine/Types/NonEmptyAlphanumeric.php b/src/engine/Types/NonEmptyText.php similarity index 92% rename from src/engine/Types/NonEmptyAlphanumeric.php rename to src/engine/Types/NonEmptyText.php index f3f1c3d7..ad71df11 100644 --- a/src/engine/Types/NonEmptyAlphanumeric.php +++ b/src/engine/Types/NonEmptyText.php @@ -13,7 +13,7 @@ namespace EA\Engine\Types; -class NonEmptyAlphanumeric extends Alphanumeric { +class NonEmptyText extends Text { protected function _validate($value) { return parent::_validate($value) && $value !== ''; } diff --git a/src/engine/Types/Alphanumeric.php b/src/engine/Types/Text.php similarity index 94% rename from src/engine/Types/Alphanumeric.php rename to src/engine/Types/Text.php index 43c46246..ad635f17 100644 --- a/src/engine/Types/Alphanumeric.php +++ b/src/engine/Types/Text.php @@ -13,7 +13,7 @@ namespace EA\Engine\Types; -class Alphanumeric extends Type { +class Text extends Type { protected function _validate($value) { return is_string($value); } diff --git a/src/engine/Types/Url.php b/src/engine/Types/Url.php index 4cdaa910..26134866 100644 --- a/src/engine/Types/Url.php +++ b/src/engine/Types/Url.php @@ -13,7 +13,7 @@ namespace EA\Engine\Types; -class Url extends NonEmptyAlphanumeric { +class Url extends NonEmptyText { protected function _validate($value) { return parent::_validate($value) && filter_var($value, FILTER_VALIDATE_URL); } diff --git a/test/php/engine/Api/V1/AuthorizationTest.php b/test/php/engine/Api/V1/AuthorizationTest.php index 7cc8085a..ca3c5ab1 100644 --- a/test/php/engine/Api/V1/AuthorizationTest.php +++ b/test/php/engine/Api/V1/AuthorizationTest.php @@ -13,7 +13,7 @@ namespace EA\Engine\Api\V1; -use \EA\Engine\Types\NonEmptyAlphanumeric; +use \EA\Engine\Types\NonEmptyText; class AuthorizationTest extends \PHPUnit_Framework_TestCase { public function testBasicMethodPerformsBasicAuthentication() { diff --git a/test/php/engine/Types/NonEmptyAlphanumericTest.php b/test/php/engine/Types/NonEmptyTextTest.php similarity index 88% rename from test/php/engine/Types/NonEmptyAlphanumericTest.php rename to test/php/engine/Types/NonEmptyTextTest.php index 92939825..b4b07dde 100644 --- a/test/php/engine/Types/NonEmptyAlphanumericTest.php +++ b/test/php/engine/Types/NonEmptyTextTest.php @@ -15,17 +15,17 @@ namespace EA\Engine\Types; class NonEmptyAlphanumericTest extends \PHPUnit_Framework_TestCase { public function testNonEmptyStringType() { - $type = new NonEmptyAlphanumeric('Hello!'); + $type = new NonEmptyText('Hello!'); $this->assertEquals('Hello!', $type->get()); } public function testNonEmptyStringTypeThrowsExceptionWithEmptyString() { $this->setExpectedException('\InvalidArgumentException'); - new NonEmptyAlphanumeric(''); + new NonEmptyText(''); } public function testNonEmptyStringTypeThrowsExceptionWithInvalidValue() { $this->setExpectedException('\InvalidArgumentException'); - new NonEmptyAlphanumeric(null); + new NonEmptyText(null); } } diff --git a/test/php/engine/Types/AlphanumericTest.php b/test/php/engine/Types/TextTest.php similarity index 84% rename from test/php/engine/Types/AlphanumericTest.php rename to test/php/engine/Types/TextTest.php index 25df5548..7f89732e 100644 --- a/test/php/engine/Types/AlphanumericTest.php +++ b/test/php/engine/Types/TextTest.php @@ -13,14 +13,14 @@ namespace EA\Engine\Types; -class AlphanumericTest extends \PHPUnit_Framework_TestCase { +class TextTest extends \PHPUnit_Framework_TestCase { public function testStringType() { - $type = new Alphanumeric('Hello!'); + $type = new Text('Hello!'); $this->assertEquals('Hello!', $type->get()); } public function testStringTypeThrowsExceptionWithInvalidValue() { $this->setExpectedException('\InvalidArgumentException'); - new Alphanumeric(null); + new Text(null); } }