Skip to content

Conversation

@elchroy
Copy link
Owner

@elchroy elchroy commented Mar 23, 2016

No description provided.

elchroy added 30 commits March 23, 2016 16:38
The BaseModel class is responsible to handling basic database CRUD operations.
Two methods are included - getAll() and connect().
A new test class is the BaseModelTest class to handle tests for the BaseModel class.
Also included some coverage, and testing configurations with composer and phunit.
The query to get all records from database was initially commented out and needed to be deleted.
A new random test is added to test and trigger coverage with coveralls.
An unneccessary string in the circle.yml file caused circleci test integration to fail.
This bug (string) is removed.
Some new features are added including
- getAll() to get all records from a database table
- find() to get one record by ID from the table
- insert() to insert new records to the table
- update() to update existing recrds from the table
- save() to integrate with update() or insert()

Some other files were deletd or renamed.
A new test for the geOne() function to fetch one record from a database is added.
The PDO classes are global and should be used when there is a namespace
for the test class. Otherwise there is no need to include the use statement.
The new tests are added for the functions and methods of the Potato Query class
This is to improve test coverage and integration.
The static connection variable is being called in the static query class
It should not be called from an object since it is a static property of the class.
The Mockery type-hinting for integers is not compatible with PHP 7 which is the version on the local machine.
This is removed and be compatitble with PHP 5.5+ precisely PHP 5.6
The classes are modified to include dependencies.
The tests for classes are then carried out with mocked versions of classes.
The composer.json file is update with a virtual file mocking tool
use to mock the file system as it is a dependent of the PotatoConnector class.

Also some new tests are added using the vfsStream, vfsStreamWrapper and vfsStreamDirectory.
The PotatoConnector class is modified to enable tests with the PotatoConnectorTest class.
New exception classes are added which include
- FaultyOrNoTableException, when the database table does not exist.
- FaultyConnectionException, when the connection is not established correctly.
- FaultyExecutionException, when the execution of a query does not get succesddful perhaps due to wrong column mathces.
New tests are added to the model test class to improve test coverage and integration.
The tests that require a database to be setup on the server are disabled temporarily.
Remove all the tests thta depend on a server database.
This is only temporarily though.
The default dependencies are removed because of some compatibility
issues with Mockery and older versions of PHP (PHP 5.6)
The dependencies for the classes are modified to enable testing to be done.
An SQLite database file is created to enhance test coverage.
Other database operations are done on database file.
The sqlite database that is created is modified to enable tests of dependent class methods.
Some new tests are added for the exceptions classes including
- FaultyExecutionException
- FaultyOrNoTableException
- FaultyConnectionException
The test for the table name which refers to class is question is deactivated temporarily.
This is because of external database dependecies.
elchroy added 19 commits March 23, 2016 16:39
A new package that was initially installed had conflicts with coverage integration.
This new package is uninstalled.
Some new tests are added to improve test coverage and intergration
with coverage.
The method that retrieves the configuration file is tested.
A new exception class is added.
Tests for the class are also added.
The classes are well documented to ensure easy comprehension and understanding of
the functionalities of all classes of the project.
An SQLite database in created to enable tests that depend on a database.
This is not permanent though.
A new package is installed to enable tests that needed to be performed online.
The class functions and methods that deal with database connections are edited and refactored
to enable both mysql and sqlite to be used properly.
The package supports two database engines and have different connections for both.
The instructions for both are added to the README.md. This ensures easy usage of the package.
The README.md is modified to explain the connection with MySQL.
The description of username and root are better defined to illustrate that the user
should input his correct database configuration details.
Some lines of code create database files that are not relevant to the package.
Those lines of code are removed and the database files that were created are deleted.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 72851dd on develop into * on master*.

The README.md is modified to enable better understanding and comprehension of the usage of the package.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0cc7801 on develop into * on master*.

The README.md is modified with details of the how to delete a record from the database with the package.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling ec14f5f on develop into * on master*.

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/andela-celisha-wigwe/PotatoORM/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/andela-celisha-wigwe/PotatoORM/?branch=develop)

# PotatoORM
A simple php database object relational mapping package.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: "PHP"

@andela-anandaa
Copy link

Git / Commit Messages

  • The Git commit messages are consistent and adhere to the agreed standards.

README

  • Fix the minor inline nitpicks raised.

Comments

  • Well commented code.

Directory Structure

  • The directory structure is okay.

Code Quality

Functionality

  • Code works fine, except you need to fix the object type being returned by fetchAll(), etc.

Testing

  • Excellent: 100% code coverage

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1ec43df on develop into * on master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants