PHPUnit – Integration Tests Console Output

When writing integration tests we have special group of slow tests that do a lot of stuff like performing hundreds of downloads or editing thousands of entries. In some cases one of the actions can trigger fatal error and the message would not be specific enough to determine which of those actions broke everything.

Here is a neat trick to enable any test to show console output, it uses fwrite to write to standard I/O stream: Continue reading

Laravel Goodies

Here’s the list of packages that make Laravel development even easier.

Development

PHPUnit – require-dev or require in composer.json

"phpunit/phpunit": "~4.0" 

and then run tests in cli directly from installed binary:

vendor/bin/phpunit

PHPSpec – require-dev or require in composer.json

"phpspec/phpspec": "~2.1" 

and then similar to PHPUnit, run the tests using binary in vendor/bin

vendor/bin/phpspec desc App/Test

Profiling / debugginglaravel-debugbar

IDE auto-completion / PHPDoclaravel-ide-helper

Faker – use to seed Database with realistic Data.
require-dev or require in composer.json

"fzaninotto/faker": "1.4.*@dev"

and then just get an instance

$faker = Faker\Factory::create(); 

and use it to fake just about anything.
Continue reading

How To Fix Laravel 4.0 – 4.1 Upgrade

Recently I’ve upgraded a Laravel 4 application from version 4.0.10 to 4.1.18. Despite Laravel’s website having a nice upgrade guide I did encounter few quirks that needed a little attention and some extra work.

So the very first thing to do, would be to follow the mentioned guide, hopefully you’ll end up with working new version of your application and wouldn’t need anything else (use “php artisan” command in your application folder to check out the current Laravel version).

Though I ended up with the following error each time I tried to run an artisan command (including simple “php artisan”):

PHP Fatal error: Class 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider' not found ...

And there were indeed no ConsoleSupportServiceProvider in my installation. Surely “composer.phar update” did not work as well as it tries to execute “php artisan …” commands and suggested “composer.phar update –no-scripts” worked, but didn’t fix anything.

After a bit of research I ended up with a kind of “clean install” solution, so if you have the same or similar issue you may try following: Continue reading

Tumblr Fcheckr – Follower / Unfollower Checker App For Tumblr


Merry Xmas and happy New Year everybody!

Wouldn’t it be a geeky celebration without playing with some kind of tricky API and finding out how stuff works? Totally not, so today we looked under Tumblr’s hood cause they wouldn’t show you who doesn’t follow you back, which would be a really welcome feature.

Additionally there seem to be no working app out there, that can do the trick, so here is one we made: Tumblr Fcheckr. Just give it the access (needed for the follower/following lists) and it’ll show you the all your followers dirty secrets.

UPD 12.2013: At the moment after another Tumblr API change it is not possible to authenticate into the application. We’ll look into it as soon as we get a minute or an hour 🙂

UPD 07.2013: Since it came up more then once – there is an issue with the “Don’t follow back” list for users who have a lot of followers.
Initially everything worked just fine, but after few updates the system started to close connection before giving up all the followers, so only the first thousand or so would be shown. Since these followers are then used to generate the Don’t Follow Back list, it gets some honest followers too. So if you have a lot of followers – double check “Don’t follow back” list, sorry for that.