A very small HTTP client with Rack/WSGI style interfaces.
$sid = 'ACxxxxxxxxxxxx';
$token = '12345678';
$http = new TinyHttp("https://$sid:[email protected]");
| // | |
| // This server will start a bash shell and expose it | |
| // over socket.io to a browser. See ./term.html for the | |
| // client side. | |
| // | |
| // You should probably: | |
| // | |
| // npm install socket.io | |
| // curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js | |
| // |
| Day job: | |
| Favorite Python project: | |
| Favorite Conference: | |
| Python Experience Level: |
| # :title:A Shell Script | |
| # = Name | |
| # | |
| # = Synopsis | |
| # | |
| # = Description | |
| # | |
| # = Todo | |
| # == Upcoming Features | |
| # 0. Nothing yet. |
A very small HTTP client with Rack/WSGI style interfaces.
$sid = 'ACxxxxxxxxxxxx';
$token = '12345678';
$http = new TinyHttp("https://$sid:[email protected]");
| # not di | |
| class UserController | |
| def create(data) | |
| User.new(data).save! | |
| end | |
| end | |
| # usage | |
| controller = UserController.new | |
| controller.create :name => 'Bulat', :username => 'avalanche123' |
| :+1: | |
| :-1: | |
| :airplane: | |
| :art: | |
| :bear: | |
| :beer: | |
| :bike: | |
| :bomb: | |
| :book: | |
| :bulb: |
| <?php | |
| $this->user2->expects($this->once()) | |
| ->method('getSalt') | |
| ->will($this->returnValue(true)) | |
| ; | |
| $this->assertTrue($this->user2->getSalt()); |
| <?php | |
| class TestTest extends PHPUnit_Framework_TestCase | |
| { | |
| public function testMock() | |
| { | |
| $user2 = $this->getMock('UserInterface'); | |
| $user2->expects($this->any()) | |
| ->method('getSalt') |
| <?php | |
| $user2->expects($this->once()) | |
| ->method('getSalt') | |
| ->will( | |
| $this->returnCallback(function() use (&$user2) { | |
| return $user2->getSalt(); | |
| }) | |
| ); |
| <?php | |
| class UserController | |
| { | |
| public function createUser(\Model\UserTable $users) | |
| { | |
| $user = $users->create(); | |
| // continue with auto-completion... | |
| } | |
| } |