3.
So: D7, CI and TestingYeah! Nowadays it’spossible to leverage thepower of a tool or two toget a seamless continuousintegration process notmuch different to the onewe’re used to whendeveloping with lower-levelframeworks.

4.
Continuous IntegrationContinuous integration (CI) is the practice, insoftware engineering, of merging all developerworkspaces with a shared mainline several times aday.- Wikipedia

7.
What is that about?Basically, a collection of softwares sporting the ugliestset of icons in the known universe!

8.
JenkinsJenkins is a Java application that monitors executions ofrepeated jobs, such as building a software project or jobsrun by cron.

9.
JenkinsIn a nutshell, Jenkins provides an easy-to-use so-calledcontinuous integration system, making it easier fordevelopers to integrate changes to the project, andmaking it easier for users to obtain a fresh build. Theautomated, continuous build increases the productivity.

10.
PhingA cross-platform build tool for PHP based on Apache AntIt offers a standard, declarative way(XML) of writingscripts to handle operations such as packaging,deploying and testing web application.It features a rich set of tasks for dealing with ﬁle systemoperations, SQL executions, code analysis and linting,documentation generation and much, much more.

12.
DrushDrush is a command line shell and scripting interface forDrupal, a veritable Swiss Army knife designed to make lifeeasier for those of us who spend some of our workinghours hacking away at the command prompt.

13.
PHPUnitIt’s the de-facto standard unit testing framework for PHP andpart of the larger xUnit family.Its primary goal is to take the smallest piece of testablesoftware in the application, isolate it from the rest of the code,and determine whether it behaves exactly as you expect.

15.
BehatBehat is a tool for writing human-readable tests in theform of a story, using a language called Gherkin, thatdescribe the behavior of your application.By writing stories, it is possible to deﬁne acceptancecriteria that can be actually executed for testing thebehavior of a web application.

16.
Ambiguity and miscommunication between developers,business owners and testers can be greatly reduced.BehatOne vocabulary to rule them all

17.
BehatFeature: front pageIn order to access the websiteAs an anonymous userI need to be able to see the login formEvery feature comes with a name, followed by three linesdescribing the beneﬁt, the role and the feature itself.This section is required but not important to Behat interms of execution, it’s just there for reading purposes.

18.
BehatScenario: Login page shows the correct buttonsGiven I am on “/”Then I should not see the link “register”And I should see the link “login”And I should see the link “forgot password”Every scenario describes how a feature acts underdifferent conditions and it’s composed by three parts: thecontext, the event and the outcomeThis is the part that will be transformed into a test.

19.
Behat/*** @Then /^I should not see the link "(?P<link>[^"]*)"$/*/public function iShouldNotSeeTheLink($link) {$element = $this->getSession()->getPage();$result = $element->findLink($link);if ($result) {throw new Exception(sprintf("The link %s was present on the page %s and was notsupposed to be",$link,$this->getSession()->getCurrentUrl()));}}

21.
...and ﬁles!• .gitignore, for not tracking a good bunch of ﬁles wedon’t need• drush make, for keeping track of the modules, themesand libraries to ues• build.xml, for describing all the actions Phing will haveto take to build the website• build.ENV.properties, for storing environments variablesused during the build process• behat.yml.dist, for storing Behat’s conﬁgurations

22.
Save the environment(s)!• local, the developer’s machine, where everyday work isdone.• dev, a server where the CI actually happens. It getsrebuilt from scratch and throughly tested everytime(ideally after every push on the repository)• stage, a server used to deploy “stable” dev snapshotsat a given point in time, usually for letting the clienttests on a more stable environment

23.
Save the environment(s)!• debug, a copy of the production environment (asfaithful as possible), used for easily reproducing bugshappening on production and also to test deploys.• prod, the environment that hosts the ﬁnal product,tuned and optimized for best performances.

24.
Let’s sum up a secondJenkins takes those logs and publishes the resultsJenkins clones the repository and invokes PhingPhing performs the build of the website, upload the ﬁlesand the database and ﬁnally launches the testsPHPUnit and Behat run the testsand log the results in JUnit format

25.
Time for some action!Go grab the code athttp://github.com/agavee/drupal7-base