/**
  * @dataProvider provideOpenShouldCallOnceFopenWithExpectedArguments
  */
 public function testOpenShouldCallOnceFopenWithExpectedArguments($streamBackEnd, $expected)
 {
     GlobalNamespace::reset(array('fopen' => function ($expectation) use($expected) {
         $expectation->once()->withArgs($expected);
     }));
     $opener = new StreamOpener();
     $opener->open($streamBackEnd);
 }
Example #2
0
 public function testFetchSharedShouldCallOnceCurlSetoptWithExpectedUrl()
 {
     GlobalNamespace::reset(array('curl_setopt' => function ($expectation) {
         $expectation->once()->withArgs(function ($ch, $opt, $value) {
             return CURLOPT_URL == $opt && 'https://apis.live.net/v5.0/me/skydrive/shared?access_token=OlD%2FAcCeSs%2BToKeN' == $value;
         });
     }, 'curl_exec' => function ($expectation) {
         $expectation->andReturn(json_encode((object) array('id' => 'folder.ffffffffffffffff.FFFFFFFFFFFFFFFF!123', 'type' => 'folder')));
     }));
     $this->client->fetchShared();
 }