This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
isidromerayo@hurhinfext16:~$ curl -LsS http://symfony.com/installer > symfony.phar | |
isidromerayo@hurhinfext16:~$ mv symfony.phar bin/ | |
isidromerayo@hurhinfext16:~$ chmod a+x bin/symfony.phar | |
isidromerayo@hurhinfext16:~$ symfony.phar | |
isidromerayo@hurhinfext16:~$ cd projects/PHP/ | |
isidromerayo@hurhinfext16:~/projects/PHP$ symfony.phar new my_project | |
Downloading Symfony... | |
4,74 MB/4,74 MB ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100% |
~/projects/PHP$ php -m | |
[PHP Modules] | |
bcmath | |
bz2 | |
calendar | |
Core | |
ctype | |
curl | |
date | |
dba |
isidromerayo@nikki:~/projects/Symfony2$ symfony.phar new my_project_installer_2.5 2.5.6 | |
Downloading Symfony... | |
4.74 MB/4.74 MB ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%% | |
Preparing project... | |
Notice: Undefined index: refrom in /var/www/deploy/portal/releases/20141216145713/login/linkedin/connect.php on line 15 Notice: Undefined index: refrom in /var/www/deploy/portal/releases/20141216145713/login/linkedin/connect.php on line 17 Notice: Undefined index: refrom in /var/www/deploy/portal/releases/20141216145713/login/linkedin/connect.php on line 19 Notice: Undefined index: oauth in /var/www/deploy/portal/releases/20141216145713/login/linkedin/connect.php on line 59 Fatal error: Uncaught exception 'LinkedInException' with message 'LinkedIn->retrieveTokenAccess(): bad data passed, string type is required for $token, $secret and $verifier.' in /var/www/deploy/portal/releases/20141216145713/includes/linkedin.php:868 Stack trace: #0 /var/www/deploy/portal/releases/20141216145713/login/linkedin/connect.php(59): LinkedIn->retrieveTokenAccess('77--4b7816d6-c0...', NULL, '57379') #1 {main} thrown in /var/www/deploy/portal/releases/20141216145713/includes/linkedin.php on line 868 |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
@Test | |
public void onBarcode_search_catalog() throws Exception { | |
Catalog catalog = mock(Catalog.class); | |
Screen screen = mock(Screen.class); | |
PointOfSale pointOfSale = new PointOfSale(catalog, screen); | |
pointOfSale.onBarcode("123"); | |
verify(catalog).search("123"); | |
} |
@Test | |
public void onBarcode_search_catalog() throws Exception { | |
Catalog catalog = mock(Catalog.class); | |
PointOfSale pointOfSale = new PointOfSale(catalog); | |
pointOfSale.onBarcode("123"); | |
verify(catalog).search("123"); | |
} |
<?php | |
/** | |
* @expectedException RuntimeException | |
*/ | |
public function testThrowExceptionStub() | |
{ | |
$stub = $this->getMock('SomeClass'); | |
$stub->expects($this->any()) |
<?php | |
/** | |
* @test | |
*/ | |
public function getsAverageTemperatureFromThreeServiceReadings() { | |
$service = m::mock('Service'); | |
$service->shouldReceive('readTemp')->times(3)->andReturn(10, 12, 14); | |
$temperature = new Temperature($service); | |
$this->assertEquals(12, $temperature->average()); |
<?php | |
public function testProcessSomeDataLogsExceptions() { | |
$logger = Phake::mock('LOGGER'); | |
$data = Phake::mock('MyData'); | |
$processor = Phake::mock('MyDataProcessor'); | |
Phake::when($processor)->process($data) | |
->thenThrow(new Exception('My error message!')); |