
CRUD –
- Create
- Read
- Update
- Delete
Is implemented separate namespaces concern base. Base controller uses both CMS model (API, REST) and template engine, which organized throttled phtml file into variables infused delegation.
To be continued – unit suites – view and controller – are committed, so nothing shortage of components based econometrics is to be committed later on, forming a base HTMLlayo…
What Is A Virtual #Moodle Development Environment? #MoodleNews

Imagine the most diverse team of Moodle designers, developers, and educators. They come from all walks of life. Now think about which kind of laptops they use. The chances they all have the same system settings are pretty slim. How can they properly collaborate from their own vantage points? Since the 1960s, the field of computer science has sworn by one solution: Virtualization. It defines the…
Generating Gherkin step definitions from Codeception modules 01

Introduction to the generation of Gherkin step definitions from Codeception modules using the Steppify command. Not just WordPress While in the example below I’m using WordPress specific modules from the wp-browser package the steppify command will work with any Codeception module. Setup Before any acceptance test runs here is the project setup: a web-server to serve a WordPress installation at…
A quick wp-cli command gotcha. Command flags wp-cli allows for very flexible and powerful commands to be put in place and its cookbook does a good job of going over the possibilities offered to package developers. But I’ll admit I’ve skimmed the cookbook to jump into the code to the point that I’ve missed the “–no-option cast” completely. An example In the code I’m working on the user can tell…
WPBrowser scaffold WP-CLI command 05
Mocking calls to shell commands in Behat tests. Context The context of the post is my ongoing effort to develop a wp-cli package to allow users to interactively scaffold tests for WordPress plugins and themes based on Codeception and wp-browser. The scaffolding consists in creating some files like a Composer configuration file and then launching commands like composer update or wpcept boostrap…
zacni behat s @befresh.sk a @dennik_aktivnej_matky 11.8 o 18:30 v sade janka krala #startrunning #zacnibehat #behat #beh #fitness #sportujeme #fitmama #bratislava #behappy #slovakia #bezime #sadjankakrala (na mieste Sad Janka Kráľa)
Takeaways To Advance You #Moodle Development Courtesy Of @dan_p And #MootUS16 #moodlenews

Moodle HQ’s senior developer and integrator Dan Poltawski gave this talk at MoodleMoot US, just weeks ago. It gives both novice and advanced “moodlevelopers” Tools and Tips to invigorate our daily practice. Debugging with config.php hidden settings There are advanced debugging settings in Moodle beyond the administrator settings. Look in the config.php file…
Every approaching Sunday, brings with it the need to search for ingredients for breakfast. A breakfast sandwiched between experiences, a night of anticipation, a morning of handshakes, chorus of thumps, eternal lust for roads, oil leaks and dirty boots.
And the search often becomes like being in a room littered with small porcelain jars we have been eating biscuits out of and wondering which one is still not empty.
For this Sunday, we chose to head out towards Ratangarh, a place known for a popular temple pecked on the crest of a hill. The road was to be narrow tarmac, which is a our usual taste and would pass through villages and a shallow jungle. The prospects looked promising and hence at dawn, we started for Ratangarh.
The start delayed as some including me were late to reach the meeting point. Once gathered we took the route from Gwalior to Behat to Ratangarh. Behat is the village where musician Tansen once lived. As we have covered this destination in a previous ride, so we skipped it. The roads till Behat were not impressive in terms of tarmac or even for the landscape.
Although the distance of 22 km from Behat to Ratangarh was more up to expectations. The typing winding roads leading through shallow forests majorly populated by thorny, bushy trees lead us all the way to the top of the hill where the Ratangarh temple is location.
When we head to this place via Behat, the road leads right to the temple, however another, more popular road which goes via Datia, leads to the bottom and thus one must climb hundreds of stairs to reach the top. That road connects to the temple via the infamous bridge over river Sindh.
After visiting Ratangarh, we head out to short excursion to a place called Aam Kho. Now, ‘Kho’ usually refers to a cavity between hills with thick vegetation, a water source and a temple. In this case, the cavity was approachable via a short trail, the vegetation was mostly mango trees, a stream and a pond were the water course and a Shiva temple formed the center.
The temple was told to be built upon a more ancient Shiva temple. Bits of construction are still ongoing with various smaller temples with effigies of saints being added. The pond had clean water populated by turtles and trees were aptly frequented by a bird which called Neelkanth which was interesting from a mythological point of view.
After our visit to the temple, we started our return journey, via the same route. Once back to Gwalior, all the riders were treated to breakfast at the residence of one of our riders Ashutosh Dvivedi.
Overall, the ride was good. Roads may not been as pleasing at the ones in the last few rides, but there were some beautiful stretches.
Ratangarh Every approaching Sunday, brings with it the need to search for ingredients for breakfast. A breakfast sandwiched between experiences, a night of anticipation, a morning of handshakes, chorus of thumps, eternal lust for roads, oil leaks and dirty boots.I would like to document the steps I took to set up the testing framework Behat in order to use it with the Laravel framework in a Homestead development environment.
Behat is a tool that will allow you to test your application by writing human-readable stories that describe the expected behaviour of your application.
Laravel Homestead is an official, pre-packaged Vagrant “box” that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine.
Making the two play together nice is not always easy, so I hope this post will help others facing similar problems.
I am using version 4.2 of the Laravel Framework and to add Behat to my application, I used the following instructions in my composer.yml file and ran the composer update command.
"behat/behat": "2.5.*@stable",
"behat/mink": "1.5.*@stable",
"behat/mink-extension": "*",
"behat/mink-goutte-driver": "*"
The next step is to add a behat.ymlfile to the root of the application with the following instructions.
default:
paths:
features: app/tests/acceptance
extensions:
Behat\MinkExtension\Extension:
goutte: ~
base_url: http://myapp.app
Now I can run the behat command without getting errors. This command is located at vendor/bin/behat, so I recommend adding vendor/bin to your PATH or setting up an alias.
Finally, I ran the behat --init command, this will create a features/ directory with some basic files to get started.
I configured Laravel Homestead for my local development environment so that my local server configuration is similar to the production environment on Laravel Forge.
My Homestead.yaml file contains the following information :
folders:
- map: /Users/gunther/Sites/myapp
to: /home/vagrant/Sites/myapp
sites:
- map: myapp.app
to: /home/vagrant/Sites/myapp/public
For more details on Homestead, you can read the documentation.
I want to test my login page with the following Behat feature
Feature: Authentification
In order to administer the website
As the site owner
I want to be able to login to the backend of the website
Scenario: User connects to the backend
Given I am on "/login"
And I login with my credentials
Then I should see "log out"
In order to test in a controlled environment, I wish to use a specific database for my Behat tests. To configure a different database for these tests, I will have to use a different environment in my laravel application.
However, if I want to test authentification I can not use the provided “testing” environment because the Laravel authentification filters are automatically disabled for the “testing environment”
So I had to set up a new environment in the Laravel application and I changed the server configuration so that the application uses this new environment when executing the Behat tests.
I had to set up an “acceptance” environment in the Laravel application and configure Behat to use this environment.
In order to use the testing database for our acceptance test, all I had to do, is add an acceptance directory to the app/config directory with a new database.php file.
If I want Behat to use this environment, my first step is to change the FeatureContext.php file that can be found in the test/acceptance/bootstrap directory.
I had to add the following code to this file :
/**
* @static
* @beforeSuite
*/
public static function bootstrapLaravel()
{
$unitTesting = true;
$testEnvironment = 'acceptance';
$app = require_once __DIR__ . '/../../../../bootstrap/start.php';
$app->boot();
Artisan::call('migrate:refresh');
Artisan::call('db:seed');
}
This code will run before the execution of a test suite and does the following things :
The problem is, that when Behat executes my tests using the Homestead server (using http://myapp.app as a base URL), the application on Homestead does not know that it should use the acceptance environment.
The only way I found to resolve this problem is to set up a different URL for acceptance testing.
The first step is to change the nginx configuration on your homestead server. One can manually change the /etc/nginx/sites-available/myapp.app file and change the third line to :
server_name myapp.app myapp.test;
Or one can change the scripts/serve.sh script in the Homestead repository so that this happens automatically whenever one launches vagrant.
server_name $1 ${1/.app/.test};
If you are playing along, do not forget to add the myapp.test URL to your etc/hosts file.
The next step is to change the behat.yml file to indicate to Behat to use the new URL.
base_url: http://myapp.test
Finally, I had to change the environment detection code in the bootstrap/start.php file.
$current_url = parse_url($app['request']->url());
if ($current_url['host'] == 'myapp.test')
{
$env = $app->detectEnvironment(function(){
return "acceptance";
});
} else {
$env = $app->detectEnvironment(array(
'local' => array('homestead'),
));
}
I used this code, but I would love to find a more elegant solution. If someone has a better idea, please contact me.
Now Behat uses the acceptance environment when running the tests against my application, hosted on Homestead.
This talk explores how Behat can help testers in API testing and browser automation with Selenium+Behat. Behat is an open source Behavior Driven Development (BDD) framework for PHP inspired by the Ruby Cucumber BDD framework.
Dve super aplikácie, ktoré ti pri behaní určite prinesú samé pozitíva. RunKeeper a Endomondo sú dve najlepšie aplikácie, ktoré by mali trackovať každého bežca :)
RunKeeper

Zadarmo aplikácia, ktorá nám zmeria ako dlho a kam sme bežali. Po behu si môžeš výsledok postnúť na facebook alebo vyhodnocovať svoje výsledky na webe.

Endomondo

Endomondo je oveľa viac sociálna aplikácia, kde môžeš okrem merania výkonnosti aj vytvárať trate, závodiť so susedmi alebo kamošmi, ktorí behajú tiež. Sám vyskúšaj viac, bude sa ti páčiť.

Prihlásenie do oboch appiek je jednoduché, zadarmo pomocou facebooku, takže teraz #zabehni aspoň niečo, keď už máš tú super aplikáciu a nezabudni na sociálnych médiách postnúť náš hashtag #zabehni (neskôr sa dozvieš viac prečo).
Preface
This is part one of a multi-part series on doing functional testing the right way. Good functional testing is not as easy as it sounds. It’s taken me years to to get to the point where I can get the business, operations, QA, and development teams to agree that the tests we make are valuable, useful, and easy to implement. I hope that sharing what I have learned can reduce the learning curve for others that have the desire to implement functional testing.
Part 1 - The Right Tools
There are a multitude of tools available for functional testing. I have used a number of them and most fall short of what should be the overall goal of functional testing, to provide useful insight into functional flaws of an application with minimal upkeep. Many tools can provide the ability to know when functionality is broken. The hard part is providing useful insight. Even harder is providing this insight with minimal upkeep.
In the beginning of my foray into functional testing, we used Selenium testing. Not directly integrating with the API but performing browser tests and converting them in to unit tests. It was easy to create tests but they provided little insight. This was especially true in a continuous integration (CI) environment. The results, a failure message of “Failed to assert false was true” and a picture of a web page, still haunt my memories. Obviously, there were some very important pieces missing from this process. Why did the test fail and how do I recreate the specific error reliably to fix the issue? We had hundreds of these tests and a team of dedicated test writers to write tests. We had invested in infrastructure to display broken builds on overhead monitors and send email and text alerts. All of these things ended up just being noise and were summarily ignored as the development team couldn’t diagnose the bugs and the operations team didn’t see an increase in system quality. In a word, useless.
Our next attempt at functional testing was HTML Unit. This was an improvement over our Selenium implementations as we had more control over tests and could give better failure messages. We had gained some insight but at what cost? Writing HTML Unit tests is a grind at best. It would take at least as much time to write tests as it would to write the code. This required a specific skill set with dedicated resources. Not having as many test writers meant that testing was always behind coding and quality in delivery only improved slightly. It was better but not what we were really trying to accomplish.
In our third attempt, we were forced to find a real solution. I was part of new team that was taking over some extremely important and highly visible legacy software. This was the worst possible software for a test minded developer. It was written in such a fashion that the code itself was not unit testable. This led to consistently releasing bugs in core components. It was a real quality issue that had the operations group, specifically the finance team, unwilling to trust any of the data produced by the system. Making the situation more painful was that nearly every penny of revenue for the company was reliant on this application to work reliably and accurately. It’s hard to imagine a worse scenario for a software developer who takes pride in their work. Our standard procedure of using unit testing to cover for the lack of functional testing was not possible. This all led to one of the team members performing a comparative analysis on four testing candidates: Selenium, HTML Unit, RSpec, and Cucumber. Each product respectively had a significant reduction in the amount of work required to write useable tests. In the end we chose Cucumber for these major factors:
We have since migrated from Cucumber to Behat as we are primarily a PHP shop and writing steps in your primary language is certainly preferable.
It’s been over three since we decided to use BDD tools for providing functional testing and I have never regretted the decision. I have also leaned that there is a right way and a wrong way to use BDD tools. Most of those lessons learned from doing it the wrong way. That will be left for the next installment of the series.
The long anticipated release of PHP Machinist 2.0 is finally here. For 2.0, Behat support was split out into it’s own package and is now a Behat Extension. Here are the significant changes:
PHP Machinist
PHP Machinist Behat Extension
Check both of them out on Github:
January 01, 2014 at 10:32PM
The BDD PHP framework Behat, allows you to test your PHP applications using human-readable sentences to write features and scenarios about how your applications
October 24, 2013 at 09:51PM