Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Testing With PhpSpec
Sep 18, 2017 @ 10:22:26

On the Laravel News site there's a new tutorial posted introducing you to testing with PhpSpec, a specification-driven testing tool that helps you model the specification your application needs to match.

PhpSpec is a testing tool based on the concept of emergent design using specification. You may have heard of Behavior Driven Development (BDD), and PhpSpec is a tool to use at the spec level or SpecBDD. We also mentioned PhpSpec in our recent roundup of Laravel Testing Resources, which includes ways you can incorporate PhpSpec into your Laravel workflow if you are interested in trying out SpecBDD.

If you’ve never tried PhpSpec, one of the things that I love about PhpSpec is that the process generates code for you and guides you through the SpecBDD process through the command line. Let me show you what I mean with a quick tutorial.

The tutorial then walks you through the installation of PhpSpec and how to run it from the command line before making any tests. They then walk through the configuration of the tool and share a sample workflow with seven steps including describing a specification, writing out expected behavior and verifying the behavior. Code examples (and command line calls) are included in each step of the way, defining an example "calendar" specification with the common functionality (add, subtract, divide, etc). The post finishes with some links to where you can find more information about PhpSpec and spec driven development.

tagged: phpspec specification testing calculator tutorial development

Link: https://laravel-news.com/testing-with-phpspec

Marc Gear's Blog:
How to learn a new PHP framework
Dec 11, 2008 @ 10:20:28

In this new blog entry Marc Gear suggests a few things that you can do to help learn a new framework quickly and easily:

There are dozens of PHP frameworks around now, some attracting more attention than others. I am no expert on these frameworks and have not used a single one extensively so I wouldn't dream of recommending one over the other, nor do I want to enter the debate about what is or is not a framework (I'll work on the assumption that anything calling itself a framework is a framework). Instead I'm going to concentrate on how you can get started with a new framework as quickly as possible.

He suggests four examples that can help you get more familiar with each framework and how they're structured - a "hello world" as a first step, creating a simple calculator, making a guestbook and making a simple script to parse and paginate a remote RSS feed.

tagged: learn framework helloworld calculator guestbook rss parse page

Link:

Adam Trachtenberg's Blog:
Stupid PHP one liners: Google calc
Aug 24, 2006 @ 07:22:10

One-liners can sometimes be quite helpful in your programming, and in hopes it will help someone out there out, Adam Trachtenberg shares one of his own in his latest blog entry today.

A long time ago, I wrote a two line hack that let you use Google as a command line calculator. It eventually ended up in the 2nd and 3rd editions of Google Hacks.

The code calls the Google Calculator page and pulls back in the contents, allowing you to pass in any sort of calulation you might want and pass back out the result all cleaned up and parsed out.

tagged: oneline google calculator commandline file_get_contents regular expression oneline google calculator commandline file_get_contents regular expression

Link:

Adam Trachtenberg's Blog:
Stupid PHP one liners: Google calc
Aug 24, 2006 @ 07:22:10

One-liners can sometimes be quite helpful in your programming, and in hopes it will help someone out there out, Adam Trachtenberg shares one of his own in his latest blog entry today.

A long time ago, I wrote a two line hack that let you use Google as a command line calculator. It eventually ended up in the 2nd and 3rd editions of Google Hacks.

The code calls the Google Calculator page and pulls back in the contents, allowing you to pass in any sort of calulation you might want and pass back out the result all cleaned up and parsed out.

tagged: oneline google calculator commandline file_get_contents regular expression oneline google calculator commandline file_get_contents regular expression

Link: