Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Automated Test Suite #151

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Automated Test Suite #151

wants to merge 5 commits into from

Conversation

clarkf
Copy link

@clarkf clarkf commented Jan 11, 2014

I've started working on an automated test suite for Ardent using PHPUnit and Mockery (same as used in Laravel).

Since LaravelBook\Ardent\Ardent is a large class, I've decided to split the tests out into separate 'feature oriented' test classes. Currently, I've written most of the 'Validation' feature's tests, and have staged test classes for auto-hydration and model hooks.

I wanted to present this before I got much further in writing the tests to ensure that it's in line with the project's style and architecture (there don't seem to be any contribution guidelines). Please do not merge this yet, but please do comment on the changes, and try running the tests yourselves.

See: #55

PHPUnit is added as a development dependency, and is configured to track
test coverage for all files within src/LaravelBook/Ardent. The test
coverage is generated in `build/coverage/`, which was added to
gitignore.
Added a 'bootstrap' file, which loads the autoloader, and adds the
`LaravelBook\Ardent\Test` namespace to the environment.  Added a base
`TestCase` class to be extended project-wide.
We don't want to/shouldn't be testing against development branches or
broken commits.
@igorsantos07
Copy link
Member

Short reply: awesome!
Long reply: Man, thanks for that. Sorry for taking forever to reply. My personal life have became a madness in the last few months.

Here's what I have to add about your changes:

  • Stability went from dev to stable? I guess that makes sense in the end when we get tests, right? (:
  • Am I able to put that on Travis? I've never used it. Maybe you could help me on that later?
  • Actually, I think there's something on code style on the repository. If there's not, I do remember discussing this with @laravelbook when I first started contributing. The rule of thumb is: PSR-1 minus braces-in-the-next-line. It would be clearer to use the { in the same line of the if/for/while/do/function/class. You can take a look at the current Ardent class to see how it's written, I think in one of my biggest commits I've organized the entire code given the decided rules, so I'm pretty sure it's following whatever guidelines we've decided on.
  • That said, tests are almost a "project inside the project". If you really feel you should follow other guidelines because of, say, PHPUnit examples or whatnot, feel free. I'm not sure if that would turn the project into a mess, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants