diff --git a/.env.example b/.env.example
index b0316636..c2f7250d 100644
--- a/.env.example
+++ b/.env.example
@@ -1,6 +1,6 @@
APP_CRYPT_SALT=eEAfR|_&G&f,+vU]:jFr!!A&+71w1Ms9~8_4L!<@[N@DyaIP_2My|:+.u>/6m,$D
APP_BASE_URI=/
-APP_PUBLIC_URL=vokuro.phalcon.io
+APP_PUBLIC_URL=dev.vokuro.phalcon.io
# Supported adapters are:
# - mysql
diff --git a/.gitignore b/.gitignore
index 08dca21a..20950ec5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,5 @@
composer.lock
vendor/
-app/config/config.dev.php
.env
boxfile.yml
diff --git a/.travis.yml b/.travis.yml
index 263daa44..4d9c2f90 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -59,5 +59,8 @@ script:
vendor/bin/phpcs
fi
+#after_success:
+# - bash <(curl -s https://codecov.io/bash)
+
notifications:
email: false
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..3fa91370
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,25 @@
+# Contributor Covenant Code of Conduct
+
+## TL;DR
+
+Common sense rules. Treat people the same way you want to be treated.
+
+## Detail
+
+This is an open source project. Everyone and anyone is welcome to contribute
+to it as much or as little as they want to.
+
+Personal views of contributors have no effect on the project and should be
+kept in the personal realm not this project.
+
+It is a requirement to treat other contributors as well as maintainers with
+respect, when communicating in the realm of this project. It is OK to agree to
+disagree.
+
+## Conflict
+
+If ever conflict arises, please bring it to the attention of the maintainers
+privately. You can always find us on our [Discord](https://phalcon.link/discord)
+server or you can send us an email at team@phalconphp.com
+
+The core team maintains the final decision on any conflict that may arise.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..ec3d6b00
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2013-2019, Phalcon PHP Framework
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 4ee7fbb6..00000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-New BSD License
-
-Copyright (c) 2011-2019, Phalcon Framework Team
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Phalcon nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL PHALCON FRAMEWORK TEAM BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
index f4a5a897..5e603451 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ If you want something to be improved or you want a new feature please submit a P
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)]
-
+
## Backers
@@ -64,7 +64,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/phalcon#backer)]
-
+
## License
diff --git a/codeception.yml b/codeception.yml
index e23c040e..e6cc38eb 100644
--- a/codeception.yml
+++ b/codeception.yml
@@ -32,3 +32,9 @@ params:
- tests/.env.test
error_level: "E_ALL"
+
+#coverage:
+# enabled: true
+# remote: false
+# include:
+# - src/*
diff --git a/composer.json b/composer.json
index b66aa978..1e8bd137 100644
--- a/composer.json
+++ b/composer.json
@@ -44,11 +44,11 @@
},
"autoload": {
"psr-4": {
- "Vokuro\\": "app/",
- "Phalcon\\": "app/Phalcon"
+ "Vokuro\\": "src/",
+ "Phalcon\\": "src/Phalcon"
},
"files": [
- "app/Helpers.php"
+ "src/Helpers.php"
]
}
}
diff --git a/configs/acl.php b/config/acl.php
similarity index 91%
rename from configs/acl.php
rename to config/acl.php
index aceab7fd..3751a2a1 100644
--- a/configs/acl.php
+++ b/config/acl.php
@@ -12,7 +12,7 @@
return [
'private' => [
- 'users' => [
+ 'users' => [
'index',
'search',
'edit',
@@ -20,7 +20,7 @@
'delete',
'changePassword',
],
- 'profiles' => [
+ 'profiles' => [
'index',
'search',
'edit',
diff --git a/configs/config.php b/config/config.php
similarity index 100%
rename from configs/config.php
rename to config/config.php
diff --git a/configs/providers.php b/config/providers.php
similarity index 100%
rename from configs/providers.php
rename to config/providers.php
diff --git a/configs/routes.php b/config/routes.php
similarity index 100%
rename from configs/routes.php
rename to config/routes.php
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 27bba4be..c893a954 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -8,8 +8,8 @@
- app
- configs
+ src
+ config
db
public/index.php
tests/acceptance
diff --git a/psalm.xml.dist b/psalm.xml.dist
index b88e5694..a67c29cd 100644
--- a/psalm.xml.dist
+++ b/psalm.xml.dist
@@ -9,7 +9,7 @@
autoloader="vendor/autoload.php"
>
-
+
diff --git a/resources/Dockerfile b/resources/Dockerfile
index 6336eb06..f47e41c5 100644
--- a/resources/Dockerfile
+++ b/resources/Dockerfile
@@ -36,7 +36,6 @@ RUN export PHALCON_REPO="https://packagecloud.io/phalcon/$PHALCON_BRANCH" \
&& echo "extension=psr.so" > "$PHP_INI_DIR/conf.d/docker-php-ext-psr.ini" \
&& echo "extension=phalcon.so" > "$PHP_INI_DIR/conf.d/docker-php-ext-phalcon.ini" \
&& php -m | grep -i "opcache\|mysql\|phalcon\|psr\|pdo\|mbstring" \
- && unset PHALCON_REPO PHALCON_PKG \
&& mv /code/.env.example /code/.env \
&& apt-get autoremove -y \
&& apt-get autoclean -y \
diff --git a/app/Application.php b/src/Application.php
similarity index 97%
rename from app/Application.php
rename to src/Application.php
index 1bfcd266..92c64027 100644
--- a/app/Application.php
+++ b/src/Application.php
@@ -93,7 +93,7 @@ protected function createApplication(): AbstractApplication
*/
protected function initializeProviders(): void
{
- $filename = $this->rootPath . '/configs/providers.php';
+ $filename = $this->rootPath . '/config/providers.php';
if (!file_exists($filename) || !is_readable($filename)) {
throw new Exception('File providers.php does not exist or is not readable.');
}
diff --git a/app/Controllers/AboutController.php b/src/Controllers/AboutController.php
similarity index 92%
rename from app/Controllers/AboutController.php
rename to src/Controllers/AboutController.php
index 340d17a4..59914d24 100644
--- a/app/Controllers/AboutController.php
+++ b/src/Controllers/AboutController.php
@@ -15,7 +15,7 @@
/**
* Display the "About" page.
*/
-final class AboutController extends ControllerBase
+class AboutController extends ControllerBase
{
/**
* Default action. Set the public layout (layouts/public.volt)
diff --git a/app/Controllers/ControllerBase.php b/src/Controllers/ControllerBase.php
similarity index 100%
rename from app/Controllers/ControllerBase.php
rename to src/Controllers/ControllerBase.php
diff --git a/app/Controllers/IndexController.php b/src/Controllers/IndexController.php
similarity index 92%
rename from app/Controllers/IndexController.php
rename to src/Controllers/IndexController.php
index 38b077a9..a18b1388 100644
--- a/app/Controllers/IndexController.php
+++ b/src/Controllers/IndexController.php
@@ -15,7 +15,7 @@
/**
* Display the default index page.
*/
-final class IndexController extends ControllerBase
+class IndexController extends ControllerBase
{
/**
* Default action. Set the public layout (layouts/public.volt)
diff --git a/app/Controllers/PermissionsController.php b/src/Controllers/PermissionsController.php
similarity index 97%
rename from app/Controllers/PermissionsController.php
rename to src/Controllers/PermissionsController.php
index cb7c1f08..bb9f074e 100644
--- a/app/Controllers/PermissionsController.php
+++ b/src/Controllers/PermissionsController.php
@@ -18,7 +18,7 @@
/**
* View and define permissions for the various profile levels.
*/
-final class PermissionsController extends ControllerBase
+class PermissionsController extends ControllerBase
{
/**
* View the permissions for a profile level, and change them if we have a
diff --git a/app/Controllers/PrivacyController.php b/src/Controllers/PrivacyController.php
similarity index 90%
rename from app/Controllers/PrivacyController.php
rename to src/Controllers/PrivacyController.php
index 1f4bb051..674353cf 100644
--- a/app/Controllers/PrivacyController.php
+++ b/src/Controllers/PrivacyController.php
@@ -15,7 +15,7 @@
/**
* Display the privacy page.
*/
-final class PrivacyController extends ControllerBase
+class PrivacyController extends ControllerBase
{
/**
* Default action. Set the public layout (layouts/public.volt)
diff --git a/app/Controllers/ProfilesController.php b/src/Controllers/ProfilesController.php
similarity index 98%
rename from app/Controllers/ProfilesController.php
rename to src/Controllers/ProfilesController.php
index 3af01805..bacf5a20 100644
--- a/app/Controllers/ProfilesController.php
+++ b/src/Controllers/ProfilesController.php
@@ -21,7 +21,7 @@
* Vokuro\Controllers\ProfilesController
* CRUD to manage profiles
*/
-final class ProfilesController extends ControllerBase
+class ProfilesController extends ControllerBase
{
/**
* Default action. Set the private (authenticated) layout
diff --git a/app/Controllers/SessionController.php b/src/Controllers/SessionController.php
similarity index 89%
rename from app/Controllers/SessionController.php
rename to src/Controllers/SessionController.php
index 2522adc9..09a08c12 100644
--- a/app/Controllers/SessionController.php
+++ b/src/Controllers/SessionController.php
@@ -23,7 +23,7 @@
* Controller used handle non-authenticated session actions like login/logout,
* user signup, and forgotten passwords
*/
-final class SessionController extends ControllerBase
+class SessionController extends ControllerBase
{
/**
* Default action. Set the public layout (layouts/public.volt)
@@ -45,15 +45,13 @@ public function signupAction()
$form = new SignUpForm();
if ($this->request->isPost()) {
- if ($form->isValid($this->request->getPost()) != false) {
- $user = new Users(
- [
- 'name' => $this->request->getPost('name', 'striptags'),
- 'email' => $this->request->getPost('email'),
- 'password' => $this->security->hash($this->request->getPost('password')),
- 'profilesId' => 2,
- ]
- );
+ if ($form->isValid($this->request->getPost())) {
+ $user = new Users([
+ 'name' => $this->request->getPost('name', 'striptags'),
+ 'email' => $this->request->getPost('email'),
+ 'password' => $this->security->hash($this->request->getPost('password')),
+ 'profilesId' => 2,
+ ]);
if ($user->save()) {
return $this->dispatcher->forward([
diff --git a/app/Controllers/TermsController.php b/src/Controllers/TermsController.php
similarity index 91%
rename from app/Controllers/TermsController.php
rename to src/Controllers/TermsController.php
index 4625474a..e4a9dba7 100644
--- a/app/Controllers/TermsController.php
+++ b/src/Controllers/TermsController.php
@@ -15,7 +15,7 @@
/**
* Display the terms and conditions page.
*/
-final class TermsController extends ControllerBase
+class TermsController extends ControllerBase
{
/**
* Default action. Set the public layout (layouts/public.volt)
diff --git a/app/Controllers/UserControlController.php b/src/Controllers/UserControlController.php
similarity index 87%
rename from app/Controllers/UserControlController.php
rename to src/Controllers/UserControlController.php
index 79fc0491..47bb7b5a 100644
--- a/app/Controllers/UserControlController.php
+++ b/src/Controllers/UserControlController.php
@@ -14,12 +14,13 @@
use Vokuro\Models\EmailConfirmations;
use Vokuro\Models\ResetPasswords;
+use Vokuro\Models\Users;
/**
* UserControlController
* Provides help to users to confirm their passwords or reset them
*/
-final class UserControlController extends ControllerBase
+class UserControlController extends ControllerBase
{
public function initialize(): void
{
@@ -28,10 +29,6 @@ public function initialize(): void
}
}
- public function indexAction(): void
- {
- }
-
/**
* Confirms an e-mail, if the user must change their password then changes
* it
@@ -56,12 +53,26 @@ public function confirmEmailAction()
]);
}
- $confirmation->confirmed = 'Y';
- $confirmation->user->active = 'Y';
+ /**
+ * Activate user
+ */
+ $user = Users::findFirst($confirmation->user->id);
+ $user->active = 'Y';
+ if (!$user->save()) {
+ foreach ($confirmation->user->getMessages() as $message) {
+ $this->flash->error((string) $message);
+ }
+
+ return $this->dispatcher->forward([
+ 'controller' => 'index',
+ 'action' => 'index',
+ ]);
+ }
/**
* Change the confirmation to 'confirmed' and update the user to 'active'
*/
+ $confirmation->confirmed = 'Y';
if (!$confirmation->save()) {
foreach ($confirmation->getMessages() as $message) {
$this->flash->error((string) $message);
diff --git a/app/Controllers/UsersController.php b/src/Controllers/UsersController.php
similarity index 99%
rename from app/Controllers/UsersController.php
rename to src/Controllers/UsersController.php
index 13121e9a..1941a612 100644
--- a/app/Controllers/UsersController.php
+++ b/src/Controllers/UsersController.php
@@ -23,7 +23,7 @@
* Vokuro\Controllers\UsersController
* CRUD to manage users
*/
-final class UsersController extends ControllerBase
+class UsersController extends ControllerBase
{
public function initialize(): void
{
diff --git a/app/Forms/ChangePasswordForm.php b/src/Forms/ChangePasswordForm.php
similarity index 100%
rename from app/Forms/ChangePasswordForm.php
rename to src/Forms/ChangePasswordForm.php
diff --git a/app/Forms/ForgotPasswordForm.php b/src/Forms/ForgotPasswordForm.php
similarity index 100%
rename from app/Forms/ForgotPasswordForm.php
rename to src/Forms/ForgotPasswordForm.php
diff --git a/app/Forms/LoginForm.php b/src/Forms/LoginForm.php
similarity index 100%
rename from app/Forms/LoginForm.php
rename to src/Forms/LoginForm.php
diff --git a/app/Forms/ProfilesForm.php b/src/Forms/ProfilesForm.php
similarity index 100%
rename from app/Forms/ProfilesForm.php
rename to src/Forms/ProfilesForm.php
diff --git a/app/Forms/SignUpForm.php b/src/Forms/SignUpForm.php
similarity index 100%
rename from app/Forms/SignUpForm.php
rename to src/Forms/SignUpForm.php
diff --git a/app/Forms/UsersForm.php b/src/Forms/UsersForm.php
similarity index 100%
rename from app/Forms/UsersForm.php
rename to src/Forms/UsersForm.php
diff --git a/app/Helpers.php b/src/Helpers.php
similarity index 67%
rename from app/Helpers.php
rename to src/Helpers.php
index c47d6b67..b0af6fd3 100644
--- a/app/Helpers.php
+++ b/src/Helpers.php
@@ -22,26 +22,6 @@ function container()
return call_user_func_array([$default, 'get'], $args);
}
-/**
- * Get configuration value
- *
- * Also can access nested values.
- * Example: config('config.db.name')
- *
- * @return mixed
- */
-function config()
-{
- $args = func_get_args();
- $config = Di::getDefault()->getShared('config');
-
- if (empty($args)) {
- return $config;
- }
-
- return call_user_func_array([$config, 'path'], $args);
-}
-
/**
* Get projects relative root path
*
diff --git a/app/Models/EmailConfirmations.php b/src/Models/EmailConfirmations.php
similarity index 98%
rename from app/Models/EmailConfirmations.php
rename to src/Models/EmailConfirmations.php
index 36ad065f..6b29a789 100644
--- a/app/Models/EmailConfirmations.php
+++ b/src/Models/EmailConfirmations.php
@@ -19,6 +19,7 @@
* Stores the reset password codes and their evolution
*
* @method static EmailConfirmations findFirstByCode(string $code)
+ * @property Users $user
*/
class EmailConfirmations extends Model
{
diff --git a/app/Models/FailedLogins.php b/src/Models/FailedLogins.php
similarity index 100%
rename from app/Models/FailedLogins.php
rename to src/Models/FailedLogins.php
diff --git a/app/Models/PasswordChanges.php b/src/Models/PasswordChanges.php
similarity index 100%
rename from app/Models/PasswordChanges.php
rename to src/Models/PasswordChanges.php
diff --git a/app/Models/Permissions.php b/src/Models/Permissions.php
similarity index 100%
rename from app/Models/Permissions.php
rename to src/Models/Permissions.php
diff --git a/app/Models/Profiles.php b/src/Models/Profiles.php
similarity index 100%
rename from app/Models/Profiles.php
rename to src/Models/Profiles.php
diff --git a/app/Models/RememberTokens.php b/src/Models/RememberTokens.php
similarity index 100%
rename from app/Models/RememberTokens.php
rename to src/Models/RememberTokens.php
diff --git a/app/Models/ResetPasswords.php b/src/Models/ResetPasswords.php
similarity index 100%
rename from app/Models/ResetPasswords.php
rename to src/Models/ResetPasswords.php
diff --git a/app/Models/SuccessLogins.php b/src/Models/SuccessLogins.php
similarity index 100%
rename from app/Models/SuccessLogins.php
rename to src/Models/SuccessLogins.php
diff --git a/app/Models/Users.php b/src/Models/Users.php
similarity index 84%
rename from app/Models/Users.php
rename to src/Models/Users.php
index 9a868694..5e707b3d 100644
--- a/app/Models/Users.php
+++ b/src/Models/Users.php
@@ -13,6 +13,7 @@
namespace Vokuro\Models;
use Phalcon\Mvc\Model;
+use Phalcon\Security;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Uniqueness;
@@ -107,11 +108,10 @@ public function beforeValidationOnCreate()
// The user must change its password in first login
$this->mustChangePassword = 'Y';
+ /** @var Security $security */
+ $security = $this->getDI()->getShared('security');
// Use this password as default
- $this->password = $this->getDI()
- ->getSecurity()
- ->hash($tempPassword)
- ;
+ $this->password = $security->hash($tempPassword);
} else {
// The user must not change its password in first login
$this->mustChangePassword = 'N';
@@ -135,20 +135,17 @@ public function beforeValidationOnCreate()
/**
* Send a confirmation e-mail to the user if the account is not active
*/
- public function afterSave()
+ public function afterCreate()
{
// Only send the confirmation email if emails are turned on in the config
- if ($this->getDI()->get('config')->useMail) {
- if ($this->active == 'N') {
- $emailConfirmation = new EmailConfirmations();
- $emailConfirmation->usersId = $this->id;
-
- if ($emailConfirmation->save()) {
- $this->getDI()
- ->getFlash()
- ->notice('A confirmation mail has been sent to ' . $this->email)
- ;
- }
+ if ($this->getDI()->get('config')->useMail && $this->active == 'N') {
+ $emailConfirmation = new EmailConfirmations();
+ $emailConfirmation->usersId = $this->id;
+
+ if ($emailConfirmation->save()) {
+ $this->getDI()
+ ->getFlash()
+ ->notice('A confirmation mail has been sent to ' . $this->email);
}
}
}
diff --git a/app/Phalcon/Beta2FixSecurity.php b/src/Phalcon/Beta2FixSecurity.php
similarity index 100%
rename from app/Phalcon/Beta2FixSecurity.php
rename to src/Phalcon/Beta2FixSecurity.php
diff --git a/app/Phalcon/Session/Adapter/Beta2FixStream.php b/src/Phalcon/Session/Adapter/Beta2FixStream.php
similarity index 100%
rename from app/Phalcon/Session/Adapter/Beta2FixStream.php
rename to src/Phalcon/Session/Adapter/Beta2FixStream.php
diff --git a/app/Plugins/Acl/Acl.php b/src/Plugins/Acl/Acl.php
similarity index 100%
rename from app/Plugins/Acl/Acl.php
rename to src/Plugins/Acl/Acl.php
diff --git a/app/Plugins/Auth/Auth.php b/src/Plugins/Auth/Auth.php
similarity index 100%
rename from app/Plugins/Auth/Auth.php
rename to src/Plugins/Auth/Auth.php
diff --git a/app/Plugins/Auth/Exception.php b/src/Plugins/Auth/Exception.php
similarity index 100%
rename from app/Plugins/Auth/Exception.php
rename to src/Plugins/Auth/Exception.php
diff --git a/app/Plugins/Mail/Exception.php b/src/Plugins/Mail/Exception.php
similarity index 100%
rename from app/Plugins/Mail/Exception.php
rename to src/Plugins/Mail/Exception.php
diff --git a/app/Plugins/Mail/Mail.php b/src/Plugins/Mail/Mail.php
similarity index 100%
rename from app/Plugins/Mail/Mail.php
rename to src/Plugins/Mail/Mail.php
diff --git a/app/Providers/AclProvider.php b/src/Providers/AclProvider.php
similarity index 95%
rename from app/Providers/AclProvider.php
rename to src/Providers/AclProvider.php
index 1acc98dd..f4bbcf65 100644
--- a/app/Providers/AclProvider.php
+++ b/src/Providers/AclProvider.php
@@ -37,7 +37,7 @@ public function register(DiInterface $di): void
$rootPath = $application->getRootPath();
$di->setShared($this->providerName, function () use ($rootPath) {
- $filename = $rootPath . '/configs/acl.php';
+ $filename = $rootPath . '/config/acl.php';
$privateResources = [];
if (is_readable($filename)) {
$privateResources = include $filename;
diff --git a/app/Providers/AuthProvider.php b/src/Providers/AuthProvider.php
similarity index 100%
rename from app/Providers/AuthProvider.php
rename to src/Providers/AuthProvider.php
diff --git a/app/Providers/ConfigProvider.php b/src/Providers/ConfigProvider.php
similarity index 94%
rename from app/Providers/ConfigProvider.php
rename to src/Providers/ConfigProvider.php
index 1cce9d63..ca96ccb4 100644
--- a/app/Providers/ConfigProvider.php
+++ b/src/Providers/ConfigProvider.php
@@ -40,7 +40,7 @@ public function register(DiInterface $di): void
$rootPath = $application->getRootPath();
$di->setShared($this->providerName, function () use ($rootPath) {
- $config = include $rootPath . '/configs/config.php';
+ $config = include $rootPath . '/config/config.php';
return new Config($config);
});
diff --git a/app/Providers/CryptProvider.php b/src/Providers/CryptProvider.php
similarity index 91%
rename from app/Providers/CryptProvider.php
rename to src/Providers/CryptProvider.php
index 3a784659..7af441b7 100644
--- a/app/Providers/CryptProvider.php
+++ b/src/Providers/CryptProvider.php
@@ -15,7 +15,6 @@
use Phalcon\Crypt;
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;
-use function Vokuro\config;
class CryptProvider implements ServiceProviderInterface
{
@@ -32,7 +31,7 @@ class CryptProvider implements ServiceProviderInterface
public function register(DiInterface $di): void
{
/** @var string $cryptSalt */
- $cryptSalt = config('application.cryptSalt');
+ $cryptSalt = $di->getShared('config')->path('application.cryptSalt');
$di->set($this->providerName, function () use ($cryptSalt) {
$crypt = new Crypt();
diff --git a/app/Providers/DbProvider.php b/src/Providers/DbProvider.php
similarity index 96%
rename from app/Providers/DbProvider.php
rename to src/Providers/DbProvider.php
index 22328904..ecae3b0f 100644
--- a/app/Providers/DbProvider.php
+++ b/src/Providers/DbProvider.php
@@ -17,7 +17,6 @@
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;
use RuntimeException;
-use function Vokuro\config;
use function Vokuro\root_path;
class DbProvider implements ServiceProviderInterface
@@ -47,7 +46,8 @@ class DbProvider implements ServiceProviderInterface
*/
public function register(DiInterface $di): void
{
- $config = config('database');
+ /** @var Config $config */
+ $config = $di->getShared('config')->get('database');
$class = $this->getClass($config);
$config = $this->createConfig($config);
diff --git a/app/Providers/DispatcherProvider.php b/src/Providers/DispatcherProvider.php
similarity index 100%
rename from app/Providers/DispatcherProvider.php
rename to src/Providers/DispatcherProvider.php
diff --git a/app/Providers/FlashProvider.php b/src/Providers/FlashProvider.php
similarity index 100%
rename from app/Providers/FlashProvider.php
rename to src/Providers/FlashProvider.php
diff --git a/app/Providers/LoggerProvider.php b/src/Providers/LoggerProvider.php
similarity index 94%
rename from app/Providers/LoggerProvider.php
rename to src/Providers/LoggerProvider.php
index f6547992..0eadca08 100644
--- a/app/Providers/LoggerProvider.php
+++ b/src/Providers/LoggerProvider.php
@@ -17,7 +17,6 @@
use Phalcon\Di\ServiceProviderInterface;
use Phalcon\Logger\Adapter\Stream as FileLogger;
use Phalcon\Logger\Formatter\Line as FormatterLine;
-use function Vokuro\config;
/**
* Logger service
@@ -37,7 +36,7 @@ class LoggerProvider implements ServiceProviderInterface
public function register(DiInterface $di): void
{
/** @var Config $loggerConfigs */
- $loggerConfigs = config('logger');
+ $loggerConfigs = $di->getShared('config')->get('logger');
$di->set($this->providerName, function () use ($loggerConfigs) {
$filename = trim($loggerConfigs->get('filename'), '\\/');
diff --git a/app/Providers/MailProvider.php b/src/Providers/MailProvider.php
similarity index 100%
rename from app/Providers/MailProvider.php
rename to src/Providers/MailProvider.php
diff --git a/app/Providers/ModelsMetadataProvider.php b/src/Providers/ModelsMetadataProvider.php
similarity index 76%
rename from app/Providers/ModelsMetadataProvider.php
rename to src/Providers/ModelsMetadataProvider.php
index b5bb6c2c..57f1ae61 100644
--- a/app/Providers/ModelsMetadataProvider.php
+++ b/src/Providers/ModelsMetadataProvider.php
@@ -15,7 +15,6 @@
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;
use Phalcon\Mvc\Model\Metadata\Stream as MetaDataAdapter;
-use function Vokuro\config;
class ModelsMetadataProvider implements ServiceProviderInterface
{
@@ -31,9 +30,11 @@ class ModelsMetadataProvider implements ServiceProviderInterface
*/
public function register(DiInterface $di): void
{
- $di->set($this->providerName, function () {
+ /** @var string $cacheDir */
+ $cacheDir = $di->getShared('config')->path('application.cacheDir');
+ $di->set($this->providerName, function () use ($cacheDir) {
return new MetaDataAdapter([
- 'metaDataDir' => config('application.cacheDir') . 'metaData/',
+ 'metaDataDir' => $cacheDir . 'metaData/',
]);
});
}
diff --git a/app/Providers/RouterProvider.php b/src/Providers/RouterProvider.php
similarity index 95%
rename from app/Providers/RouterProvider.php
rename to src/Providers/RouterProvider.php
index 1e6f6c00..d8d52b5e 100644
--- a/app/Providers/RouterProvider.php
+++ b/src/Providers/RouterProvider.php
@@ -40,7 +40,7 @@ public function register(DiInterface $di): void
$di->set($this->providerName, function () use ($basePath) {
$router = new Router();
- $routes = $basePath . '/configs/routes.php';
+ $routes = $basePath . '/config/routes.php';
if (!file_exists($routes) || !is_readable($routes)) {
throw new Exception($routes . ' file does not exist or is not readable.');
}
diff --git a/app/Providers/SecurityProvider.php b/src/Providers/SecurityProvider.php
similarity index 100%
rename from app/Providers/SecurityProvider.php
rename to src/Providers/SecurityProvider.php
diff --git a/app/Providers/SessionBagProvider.php b/src/Providers/SessionBagProvider.php
similarity index 100%
rename from app/Providers/SessionBagProvider.php
rename to src/Providers/SessionBagProvider.php
diff --git a/app/Providers/SessionProvider.php b/src/Providers/SessionProvider.php
similarity index 95%
rename from app/Providers/SessionProvider.php
rename to src/Providers/SessionProvider.php
index 74eecc79..dd7e3c8c 100644
--- a/app/Providers/SessionProvider.php
+++ b/src/Providers/SessionProvider.php
@@ -19,7 +19,6 @@
use Phalcon\Session\Adapter\Stream as SessionAdapter;
use Phalcon\Session\Manager as SessionManager;
use Phalcon\Version;
-use function Vokuro\config;
class SessionProvider implements ServiceProviderInterface
{
@@ -36,7 +35,7 @@ class SessionProvider implements ServiceProviderInterface
public function register(DiInterface $di): void
{
/** @var string $savePath */
- $savePath = config('application.sessionSavePath');
+ $savePath = $di->getShared('config')->path('application.sessionSavePath');
$handler = $this->getSessionAdapter($savePath);
$di->set($this->providerName, function () use ($handler) {
diff --git a/app/Providers/UrlProvider.php b/src/Providers/UrlProvider.php
similarity index 91%
rename from app/Providers/UrlProvider.php
rename to src/Providers/UrlProvider.php
index 5b8d9b7f..baa88023 100644
--- a/app/Providers/UrlProvider.php
+++ b/src/Providers/UrlProvider.php
@@ -15,7 +15,6 @@
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;
use Phalcon\Url as UrlResolver;
-use function Vokuro\config;
class UrlProvider implements ServiceProviderInterface
{
@@ -30,7 +29,7 @@ class UrlProvider implements ServiceProviderInterface
public function register(DiInterface $di): void
{
/** @var string $baseUri */
- $baseUri = config('application.baseUri');
+ $baseUri = $di->getShared('config')->path('application.baseUri');
$di->setShared($this->providerName, function () use ($baseUri) {
$url = new UrlResolver();
diff --git a/app/Providers/ViewProvider.php b/src/Providers/ViewProvider.php
similarity index 85%
rename from app/Providers/ViewProvider.php
rename to src/Providers/ViewProvider.php
index 25c75401..3d3cc5b8 100644
--- a/app/Providers/ViewProvider.php
+++ b/src/Providers/ViewProvider.php
@@ -12,11 +12,11 @@
namespace Vokuro\Providers;
+use Phalcon\Config;
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;
use Phalcon\Mvc\View;
use Phalcon\Mvc\View\Engine\Volt;
-use function Vokuro\config;
class ViewProvider implements ServiceProviderInterface
{
@@ -30,10 +30,12 @@ class ViewProvider implements ServiceProviderInterface
*/
public function register(DiInterface $di): void
{
+ /** @var Config $config */
+ $config = $di->getShared('config');
/** @var string $viewsDir */
- $viewsDir = config('application.viewsDir');
+ $viewsDir = $config->path('application.viewsDir');
/** @var string $cacheDir */
- $cacheDir = config('application.cacheDir');
+ $cacheDir = $config->path('application.cacheDir');
$di->setShared($this->providerName, function () use ($viewsDir, $cacheDir, $di) {
$view = new View();
diff --git a/tests/functional/.gitignore b/tests/functional/.gitignore
deleted file mode 100644
index d6b7ef32..00000000
--- a/tests/functional/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!.gitignore
diff --git a/tests/functional/forms/ChangePasswordFormTest.php b/tests/functional/forms/ChangePasswordFormTest.php
new file mode 100644
index 00000000..5ec6265e
--- /dev/null
+++ b/tests/functional/forms/ChangePasswordFormTest.php
@@ -0,0 +1,76 @@
+ '',
+ self::CONFIRM_PASS_KEY => '',
+ ];
+ $shortPasswordData = [
+ self::PASS_KEY => '123',
+ self::CONFIRM_PASS_KEY => '123',
+ ];
+ $emptyConfirmPasswordData = [
+ self::PASS_KEY => 'valid password empty config',
+ ];
+ $missMatchConfigPasswordData = [
+ self::PASS_KEY => '123456780',
+ self::CONFIRM_PASS_KEY => '123456789',
+ ];
+ $correctData1 = [
+ self::PASS_KEY => '12345678',
+ self::CONFIRM_PASS_KEY => '12345678',
+ ];
+ $correctData2 = [
+ self::PASS_KEY => 'valid password',
+ self::CONFIRM_PASS_KEY => 'valid password'
+ ];
+ $correctData3 = [
+ self::PASS_KEY => '(*%^%$#@#$%^',
+ self::CONFIRM_PASS_KEY => '(*%^%$#@#$%^',
+ ];
+
+ return [
+ [$emptyData, 3, false],
+ [$emptyPasswordData, 3, false],
+ [$shortPasswordData, 1, false],
+ [$emptyConfirmPasswordData, 2, false],
+ [$missMatchConfigPasswordData, 1, false],
+ [$correctData1, 0, true],
+ [$correctData2, 0, true],
+ [$correctData3, 0, true],
+ ];
+ }
+
+ /**
+ * @dataProvider dataProvider
+ *
+ * @param array $data
+ * @param int $errorsCount
+ * @param bool $expected
+ */
+ public function testValidations(array $data, int $errorsCount, bool $expected): void
+ {
+ $form = new ChangePasswordForm();
+ $isValid = $form->isValid($data);
+ $messages = $form->getMessages();
+
+ $this->assertEquals($expected, $isValid);
+ $this->assertEquals($errorsCount, count($messages));
+ }
+}
diff --git a/tests/functional/forms/ForgotPasswordFormTest.php b/tests/functional/forms/ForgotPasswordFormTest.php
new file mode 100644
index 00000000..9533f2f7
--- /dev/null
+++ b/tests/functional/forms/ForgotPasswordFormTest.php
@@ -0,0 +1,42 @@
+ 'invalid email'], 1, false],
+ [[self::EMAIL_KEY => 'valid@email.com'], 0, true],
+ [[self::EMAIL_KEY => 'bob@phalcon.io'], 0, true],
+ ];
+ }
+
+ /**
+ * @dataProvider dataProvider
+ *
+ * @param array $data
+ * @param int $errorsCount
+ * @param bool $expected
+ */
+ public function testValidations(array $data, int $errorsCount, bool $expected): void
+ {
+ $form = new ForgotPasswordForm();
+ $isValid = $form->isValid($data);
+ $messages = $form->getMessages();
+
+ $this->assertEquals($expected, $isValid);
+ $this->assertEquals($errorsCount, count($messages));
+ }
+}
diff --git a/tests/functional/forms/LoginFormTest.php b/tests/functional/forms/LoginFormTest.php
new file mode 100644
index 00000000..dc88c37c
--- /dev/null
+++ b/tests/functional/forms/LoginFormTest.php
@@ -0,0 +1,57 @@
+register($di);
+
+ $emptyData = [];
+ $incorrectCsrfData = [
+ self::EMAIL_KEY => 'bob@phalcon.io',
+ self::PASS_KEY => 'password1',
+ self::CSRF_KEY => 'invalid',
+ ];
+
+ return [
+ [$emptyData, 4, false],
+ [$incorrectCsrfData, 1, false],
+ ];
+ }
+
+ /**
+ * @dataProvider dataProvider
+ *
+ * @param array $data
+ * @param int $errorsCount
+ * @param bool $expected
+ */
+ public function testValidations(array $data, int $errorsCount, bool $expected): void
+ {
+ $form = new LoginForm();
+ $isValid = $form->isValid($data);
+ $messages = $form->getMessages();
+
+ $this->assertEquals($expected, $isValid);
+ $this->assertEquals($errorsCount, count($messages));
+ }
+}
diff --git a/tests/functional/forms/ProfilesFormTest.php b/tests/functional/forms/ProfilesFormTest.php
new file mode 100644
index 00000000..2df5ad8a
--- /dev/null
+++ b/tests/functional/forms/ProfilesFormTest.php
@@ -0,0 +1,41 @@
+ ''], 1, false],
+ [[self::NAME_KEY => 'valid name'], 0, true],
+ ];
+ }
+
+ /**
+ * @dataProvider dataProvider
+ *
+ * @param array $data
+ * @param int $errorsCount
+ * @param bool $expected
+ */
+ public function testValidations(array $data, int $errorsCount, bool $expected): void
+ {
+ $form = new ProfilesForm();
+ $isValid = $form->isValid($data);
+ $messages = $form->getMessages();
+
+ $this->assertEquals($expected, $isValid);
+ $this->assertEquals($errorsCount, count($messages));
+ }
+}
diff --git a/tests/unit/ApplicationTest.php b/tests/unit/ApplicationTest.php
new file mode 100644
index 00000000..924d20c2
--- /dev/null
+++ b/tests/unit/ApplicationTest.php
@@ -0,0 +1,18 @@
+constructEmptyExcept(Application::class, 'getRootPath', ['rootPath' => $rootPath]);
+
+ $this->assertEquals($rootPath, $class->getRootPath());
+ }
+}
diff --git a/tests/unit/controllers/AboutControllerTest.php b/tests/unit/controllers/AboutControllerTest.php
new file mode 100644
index 00000000..69adbc7b
--- /dev/null
+++ b/tests/unit/controllers/AboutControllerTest.php
@@ -0,0 +1,18 @@
+make(AboutController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/ControllerBaseTest.php b/tests/unit/controllers/ControllerBaseTest.php
new file mode 100644
index 00000000..ab9d7e48
--- /dev/null
+++ b/tests/unit/controllers/ControllerBaseTest.php
@@ -0,0 +1,18 @@
+make(ControllerBase::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/IndexControllerTest.php b/tests/unit/controllers/IndexControllerTest.php
new file mode 100644
index 00000000..eaf67aff
--- /dev/null
+++ b/tests/unit/controllers/IndexControllerTest.php
@@ -0,0 +1,18 @@
+make(IndexController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/PermissionsControllerTest.php b/tests/unit/controllers/PermissionsControllerTest.php
new file mode 100644
index 00000000..f2496cab
--- /dev/null
+++ b/tests/unit/controllers/PermissionsControllerTest.php
@@ -0,0 +1,18 @@
+make(PermissionsController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/PrivacyControllerTest.php b/tests/unit/controllers/PrivacyControllerTest.php
new file mode 100644
index 00000000..e98c6297
--- /dev/null
+++ b/tests/unit/controllers/PrivacyControllerTest.php
@@ -0,0 +1,18 @@
+make(PrivacyController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/ProfilesControllerTest.php b/tests/unit/controllers/ProfilesControllerTest.php
new file mode 100644
index 00000000..5eadb078
--- /dev/null
+++ b/tests/unit/controllers/ProfilesControllerTest.php
@@ -0,0 +1,18 @@
+make(ProfilesController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/SessionControllerTest.php b/tests/unit/controllers/SessionControllerTest.php
new file mode 100644
index 00000000..2cb77791
--- /dev/null
+++ b/tests/unit/controllers/SessionControllerTest.php
@@ -0,0 +1,18 @@
+make(SessionController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/TermsControllerTest.php b/tests/unit/controllers/TermsControllerTest.php
new file mode 100644
index 00000000..31fd9152
--- /dev/null
+++ b/tests/unit/controllers/TermsControllerTest.php
@@ -0,0 +1,18 @@
+make(TermsController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/UserControlControllerTest.php b/tests/unit/controllers/UserControlControllerTest.php
new file mode 100644
index 00000000..698a62a4
--- /dev/null
+++ b/tests/unit/controllers/UserControlControllerTest.php
@@ -0,0 +1,18 @@
+make(UserControlController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/controllers/UsersControllerTest.php b/tests/unit/controllers/UsersControllerTest.php
new file mode 100644
index 00000000..ed4a8392
--- /dev/null
+++ b/tests/unit/controllers/UsersControllerTest.php
@@ -0,0 +1,18 @@
+make(UsersController::class);
+
+ $this->assertInstanceOf(Controller::class, $class);
+ }
+}
diff --git a/tests/unit/forms/ChangePasswordFormTest.php b/tests/unit/forms/ChangePasswordFormTest.php
new file mode 100644
index 00000000..0f545e63
--- /dev/null
+++ b/tests/unit/forms/ChangePasswordFormTest.php
@@ -0,0 +1,18 @@
+make(ChangePasswordForm::class);
+
+ $this->assertInstanceOf(Form::class, $class);
+ }
+}
diff --git a/tests/unit/forms/ForgotPasswordFormTest.php b/tests/unit/forms/ForgotPasswordFormTest.php
new file mode 100644
index 00000000..dbf67536
--- /dev/null
+++ b/tests/unit/forms/ForgotPasswordFormTest.php
@@ -0,0 +1,18 @@
+make(ForgotPasswordForm::class);
+
+ $this->assertInstanceOf(Form::class, $class);
+ }
+}
diff --git a/tests/unit/forms/LoginFormTest.php b/tests/unit/forms/LoginFormTest.php
new file mode 100644
index 00000000..ce881f42
--- /dev/null
+++ b/tests/unit/forms/LoginFormTest.php
@@ -0,0 +1,18 @@
+make(LoginForm::class);
+
+ $this->assertInstanceOf(Form::class, $class);
+ }
+}
diff --git a/tests/unit/forms/ProfilesFormTest.php b/tests/unit/forms/ProfilesFormTest.php
new file mode 100644
index 00000000..6493746a
--- /dev/null
+++ b/tests/unit/forms/ProfilesFormTest.php
@@ -0,0 +1,18 @@
+make(ProfilesForm::class);
+
+ $this->assertInstanceOf(Form::class, $class);
+ }
+}
diff --git a/tests/unit/forms/SignUpFormTest.php b/tests/unit/forms/SignUpFormTest.php
new file mode 100644
index 00000000..6930d2af
--- /dev/null
+++ b/tests/unit/forms/SignUpFormTest.php
@@ -0,0 +1,18 @@
+make(SignUpForm::class);
+
+ $this->assertInstanceOf(Form::class, $class);
+ }
+}
diff --git a/tests/unit/forms/UsersFormTest.php b/tests/unit/forms/UsersFormTest.php
new file mode 100644
index 00000000..16cbd968
--- /dev/null
+++ b/tests/unit/forms/UsersFormTest.php
@@ -0,0 +1,18 @@
+make(UsersForm::class);
+
+ $this->assertInstanceOf(Form::class, $class);
+ }
+}
diff --git a/tests/unit/models/EmailConfirmationsTest.php b/tests/unit/models/EmailConfirmationsTest.php
index 84677878..c5cf4713 100644
--- a/tests/unit/models/EmailConfirmationsTest.php
+++ b/tests/unit/models/EmailConfirmationsTest.php
@@ -3,7 +3,6 @@
namespace Vokuro\Tests\Unit\Models;
-use Codeception\Stub;
use Codeception\Test\Unit;
use Phalcon\Mvc\Model;
use Vokuro\Models\EmailConfirmations;
@@ -12,8 +11,8 @@ final class EmailConfirmationsTest extends Unit
{
public function testModelInstanceOf(): void
{
- $emailConfirmations = Stub::make(EmailConfirmations::class);
+ $class = $this->make(EmailConfirmations::class);
- $this->assertInstanceOf(Model::class, $emailConfirmations);
+ $this->assertInstanceOf(Model::class, $class);
}
}
diff --git a/tests/unit/models/FailedLoginsTest.php b/tests/unit/models/FailedLoginsTest.php
new file mode 100644
index 00000000..abd26b2a
--- /dev/null
+++ b/tests/unit/models/FailedLoginsTest.php
@@ -0,0 +1,18 @@
+make(FailedLogins::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/models/PasswordChangesTest.php b/tests/unit/models/PasswordChangesTest.php
new file mode 100644
index 00000000..081c0edd
--- /dev/null
+++ b/tests/unit/models/PasswordChangesTest.php
@@ -0,0 +1,18 @@
+make(PasswordChanges::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/models/PermissionsTest.php b/tests/unit/models/PermissionsTest.php
new file mode 100644
index 00000000..33629936
--- /dev/null
+++ b/tests/unit/models/PermissionsTest.php
@@ -0,0 +1,18 @@
+make(Permissions::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/models/ProfilesTest.php b/tests/unit/models/ProfilesTest.php
new file mode 100644
index 00000000..5985924c
--- /dev/null
+++ b/tests/unit/models/ProfilesTest.php
@@ -0,0 +1,18 @@
+make(Profiles::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/models/RememberTokensTest.php b/tests/unit/models/RememberTokensTest.php
new file mode 100644
index 00000000..01bdb7dc
--- /dev/null
+++ b/tests/unit/models/RememberTokensTest.php
@@ -0,0 +1,18 @@
+make(RememberTokens::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/models/ResetPasswordsTest.php b/tests/unit/models/ResetPasswordsTest.php
new file mode 100644
index 00000000..a4bccef8
--- /dev/null
+++ b/tests/unit/models/ResetPasswordsTest.php
@@ -0,0 +1,18 @@
+make(ResetPasswords::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/models/SuccessLoginsTest.php b/tests/unit/models/SuccessLoginsTest.php
new file mode 100644
index 00000000..43db607f
--- /dev/null
+++ b/tests/unit/models/SuccessLoginsTest.php
@@ -0,0 +1,18 @@
+make(SuccessLogins::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/models/UsersTest.php b/tests/unit/models/UsersTest.php
new file mode 100644
index 00000000..7fa683d8
--- /dev/null
+++ b/tests/unit/models/UsersTest.php
@@ -0,0 +1,18 @@
+make(Users::class);
+
+ $this->assertInstanceOf(Model::class, $class);
+ }
+}
diff --git a/tests/unit/plugins/acl/AclTest.php b/tests/unit/plugins/acl/AclTest.php
new file mode 100644
index 00000000..9e415eab
--- /dev/null
+++ b/tests/unit/plugins/acl/AclTest.php
@@ -0,0 +1,18 @@
+make(Acl::class);
+
+ $this->assertInstanceOf(Injectable::class, $class);
+ }
+}
diff --git a/tests/unit/plugins/auth/AuthTest.php b/tests/unit/plugins/auth/AuthTest.php
new file mode 100644
index 00000000..98cea90f
--- /dev/null
+++ b/tests/unit/plugins/auth/AuthTest.php
@@ -0,0 +1,18 @@
+make(Auth::class);
+
+ $this->assertInstanceOf(Injectable::class, $class);
+ }
+}
diff --git a/tests/unit/plugins/mail/MailTest.php b/tests/unit/plugins/mail/MailTest.php
new file mode 100644
index 00000000..0c4cedb9
--- /dev/null
+++ b/tests/unit/plugins/mail/MailTest.php
@@ -0,0 +1,18 @@
+make(Mail::class);
+
+ $this->assertInstanceOf(Injectable::class, $class);
+ }
+}
diff --git a/tests/unit/providers/AclProviderTest.php b/tests/unit/providers/AclProviderTest.php
new file mode 100644
index 00000000..b519ada9
--- /dev/null
+++ b/tests/unit/providers/AclProviderTest.php
@@ -0,0 +1,18 @@
+make(AclProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/AuthProviderTest.php b/tests/unit/providers/AuthProviderTest.php
new file mode 100644
index 00000000..6fed62d5
--- /dev/null
+++ b/tests/unit/providers/AuthProviderTest.php
@@ -0,0 +1,18 @@
+make(AuthProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/ConfigProviderTest.php b/tests/unit/providers/ConfigProviderTest.php
new file mode 100644
index 00000000..198cf015
--- /dev/null
+++ b/tests/unit/providers/ConfigProviderTest.php
@@ -0,0 +1,18 @@
+make(ConfigProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/CryptProviderTest.php b/tests/unit/providers/CryptProviderTest.php
new file mode 100644
index 00000000..1a17ed4a
--- /dev/null
+++ b/tests/unit/providers/CryptProviderTest.php
@@ -0,0 +1,18 @@
+make(CryptProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/DbProviderTest.php b/tests/unit/providers/DbProviderTest.php
new file mode 100644
index 00000000..a95d1371
--- /dev/null
+++ b/tests/unit/providers/DbProviderTest.php
@@ -0,0 +1,18 @@
+make(DbProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/DispatcherProviderTest.php b/tests/unit/providers/DispatcherProviderTest.php
new file mode 100644
index 00000000..0fd5fb1b
--- /dev/null
+++ b/tests/unit/providers/DispatcherProviderTest.php
@@ -0,0 +1,18 @@
+make(DispatcherProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/FlashProviderTest.php b/tests/unit/providers/FlashProviderTest.php
new file mode 100644
index 00000000..d3abc730
--- /dev/null
+++ b/tests/unit/providers/FlashProviderTest.php
@@ -0,0 +1,18 @@
+make(FlashProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/LoggerProviderTest.php b/tests/unit/providers/LoggerProviderTest.php
new file mode 100644
index 00000000..74be3f67
--- /dev/null
+++ b/tests/unit/providers/LoggerProviderTest.php
@@ -0,0 +1,18 @@
+make(LoggerProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/MailProviderTest.php b/tests/unit/providers/MailProviderTest.php
new file mode 100644
index 00000000..4bf371ca
--- /dev/null
+++ b/tests/unit/providers/MailProviderTest.php
@@ -0,0 +1,18 @@
+make(MailProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/ModelsMetadataProviderTest.php b/tests/unit/providers/ModelsMetadataProviderTest.php
new file mode 100644
index 00000000..4aba2813
--- /dev/null
+++ b/tests/unit/providers/ModelsMetadataProviderTest.php
@@ -0,0 +1,18 @@
+make(ModelsMetadataProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/RouterProviderTest.php b/tests/unit/providers/RouterProviderTest.php
new file mode 100644
index 00000000..1f7cbe61
--- /dev/null
+++ b/tests/unit/providers/RouterProviderTest.php
@@ -0,0 +1,18 @@
+make(RouterProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/SecurityProviderTest.php b/tests/unit/providers/SecurityProviderTest.php
new file mode 100644
index 00000000..81fe73e3
--- /dev/null
+++ b/tests/unit/providers/SecurityProviderTest.php
@@ -0,0 +1,18 @@
+make(SecurityProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/SessionBagProviderTest.php b/tests/unit/providers/SessionBagProviderTest.php
new file mode 100644
index 00000000..f02c93cb
--- /dev/null
+++ b/tests/unit/providers/SessionBagProviderTest.php
@@ -0,0 +1,18 @@
+make(SessionBagProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/SessionProviderTest.php b/tests/unit/providers/SessionProviderTest.php
new file mode 100644
index 00000000..bf950475
--- /dev/null
+++ b/tests/unit/providers/SessionProviderTest.php
@@ -0,0 +1,18 @@
+make(SessionProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/UrlProviderTest.php b/tests/unit/providers/UrlProviderTest.php
new file mode 100644
index 00000000..0642c9a3
--- /dev/null
+++ b/tests/unit/providers/UrlProviderTest.php
@@ -0,0 +1,18 @@
+make(UrlProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/tests/unit/providers/ViewProviderTest.php b/tests/unit/providers/ViewProviderTest.php
new file mode 100644
index 00000000..5ecb90bf
--- /dev/null
+++ b/tests/unit/providers/ViewProviderTest.php
@@ -0,0 +1,18 @@
+make(ViewProvider::class);
+
+ $this->assertInstanceOf(ServiceProviderInterface::class, $class);
+ }
+}
diff --git a/themes/vokuro/about/index.volt b/themes/vokuro/about/index.volt
index 7254c65b..5b23ffee 100644
--- a/themes/vokuro/about/index.volt
+++ b/themes/vokuro/about/index.volt
@@ -4,5 +4,5 @@
This is a sample application for the Phalcon Framework. We expect to implement as many features
as possible to show how the framework works and its potential. Please write us if you have any
feedback or comments. Feel free to clone the code of this application here.
- The purpose of this application is merely academic. Thanks!.
+ The purpose of this application is merely academic. Thanks!
diff --git a/themes/vokuro/emailTemplates/confirmation.volt b/themes/vokuro/emailTemplates/confirmation.volt
index fb0eb60b..a4b7d27b 100644
--- a/themes/vokuro/emailTemplates/confirmation.volt
+++ b/themes/vokuro/emailTemplates/confirmation.volt
@@ -17,7 +17,7 @@
- Vökuró!. Enjoy!
+ Vökuró. Enjoy!
diff --git a/themes/vokuro/emailTemplates/reset.volt b/themes/vokuro/emailTemplates/reset.volt
index 28c0071f..bd31a8f6 100644
--- a/themes/vokuro/emailTemplates/reset.volt
+++ b/themes/vokuro/emailTemplates/reset.volt
@@ -16,7 +16,7 @@
- Vökuró!. Enjoy!
+ Vökuró. Enjoy!
diff --git a/themes/vokuro/layouts/emailTemplates.volt b/themes/vokuro/layouts/emailTemplates.volt
index b7d7f489..46e6ed5a 100644
--- a/themes/vokuro/layouts/emailTemplates.volt
+++ b/themes/vokuro/layouts/emailTemplates.volt
@@ -1,4 +1,4 @@
-
+
diff --git a/themes/vokuro/users/edit.volt b/themes/vokuro/users/edit.volt
index 4979e059..44fda79b 100644
--- a/themes/vokuro/users/edit.volt
+++ b/themes/vokuro/users/edit.volt
@@ -83,7 +83,7 @@
{% else %}
- User does not have successfull logins |
+ User does not have successful logins |
{% endfor %}