We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Codeception Phalcon1 module (implemented)

I've implemented Codeception (https://codeception.com) Phalcon1 module to handle functional and unit tests with DB cleanup ability including MySQL. It still in alpha stage though, but should satisfy most common needs.

The only requirement is to create application bootstrap file returning configured DI\Injectable object (MVC\Application for ex). It must not call handle() method, just configure. This file then can be used both in tests and application itself (just include it in index.php to get Application object and call handle()). Hope it will be helpful for some one, Codeception is awesome tool (so as Phalcon ;-)).

https://github.com/cujo/Codeception/commit/6f95be50ff7f8a546e396eb1224fdd6de79adeb4

This is really interesting. I discovered the project some time ago but never got to use it or play with it.

I will check it out for sure.

Hi, this is usage example: https://github.com/cujo/Codeception-Phalcon1-Example

Update: I'm pleased to report that this module is merged into https://github.com/Codeception/Codeception/tree/master and hopefully will be available in next version (1.8).

Hey, thanks again Alexandr. Good job. I just run a basic test and it worked well https://minus.com/lHajbVhdz3qZC

Nikolaos yep, looks like Codeception and Phalcon become real friends )

I'd like to get this tests running on something more complex, to involve some form interactions. I tried this forum source code, but this auth via github stops me :( Can I bypass auth somehow? Or log in as admin?

P.S. I will try to implement auto-login via session service.

Success!

Functional Tests (1) --------------------------------------------------------- Modules: Filesystem, Phalcon1, TestHelper

Trying to perform shadow login as first user (ShadowLoginCept.php)
Scenario:

  • I have in session "identity",1
  • I have in session "identity-name","Phalcon"
  • I am on page "/"
  • I see "Logout" [Response] 200 [Page] https://localhost/ PASSED

That's great! The project I mainly use this module for is RESTful webservice, so it works for them too. But it closed source, sorry...

Alexandr, can we get in touch in Skype? Looks like I need some support. My is davert.ua There is some issue dealing with sessions.

Well, that was a long long evening but I got this working with some extra cool things added.

https://github.com/phalcon/forum/pull/14

Not sure if you get this merged, but at least you may look into how the test look and you may try to execute them. I really like that Phalcon have nested transaction from the box and functional test runs super fast (yeah, that's the motto of Phalcon).