This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Not sure about phpunit's mock building, but with mockery you could possibly mock | |
| the Article class - not the entire class, but just the createQueryBuilder method, | |
| which you set that to return a mock of the query builder, on which you further | |
| set the expectations. Something like: | |
| <?php | |
| use \Mockery as m; | |
| function testQueryBuilder() | |
| { | |
| $qbMock = m::mock(...QueryBuilderClassGoesHere...); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Foo | |
| { | |
| public static function dataProvider() | |
| { | |
| return array(array('foo')); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function testFetchAllReturnsAllAlbums() | |
| { | |
| $resultSet = new ResultSet(); | |
| $mockSelect = $this->getMock('Zend\Db\Sql\Select', array('columns'), array(), '', false); | |
| $mockSelect->expects($this->once()) | |
| ->method('columns') | |
| ->with(array('artist', 'title', 'id')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Found a nice list on Facebook, via [LongboardEurope](https://www.facebook.com/LongboardEurope/posts/463935783669834) | |
| This Midnight Sun longboard festival sounds nice https://www.facebook.com/groups/372945166119178/?fref=ts | |
| Freerides for 2013 | |
| Events marked * are unconfirmed. | |
| **April** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class MyClass | |
| { | |
| public function foo($paramA, $paramB) | |
| { | |
| return $paramA . $paramB; | |
| } | |
| public function bar($paramA, $paramB) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace HexCommon\View\Helper; | |
| use Zend\View\Helper\AbstractHelper; | |
| use Zend\ServiceManager\ServiceLocatorAwareInterface; | |
| use Zend\ServiceManager\ServiceLocatorInterface; | |
| /** | |
| * An abstract view helper, to be implemented by view helpers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| robert@odin ~/www/robertbasic.com[zf2*]$ ab -n10 -c10 http://robertbasic.local/ | |
| This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
| Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
| Licensed to The Apache Software Foundation, http://www.apache.org/ | |
| Benchmarking robertbasic.local (be patient).....done | |
| Server Software: Apache/2.2.22 | |
| Server Hostname: robertbasic.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) | |
| { | |
| $namespace = substr($requestedName, 0, strpos($requestedName, 'ModelTable')); | |
| $classname = substr($requestedName, strlen($namespace . 'ModelTable')); | |
| $class = ucfirst($namespace) . "\\Model\\Table\\" . ucfirst($classname); | |
| $dbAdapter = $serviceLocator->get('dbAdapter'); | |
| $table = new $class($dbAdapter); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //module.config.php | |
| return array( | |
| 'factories' => array( | |
| 'model.Foo' => 'Foo\Factory\ModelFactory' | |
| ) | |
| ); | |
| // Foo/Factory/ModelFactory.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $slugConstraints = '[\w_-]+'; | |
| $pagenumberChild = array( | |
| 'type' => 'segment', | |
| 'options' => array( | |
| 'route' => '/page/:page', | |
| 'constraints' => array( | |
| 'page' => '\d+' |