mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 08:58:49 +00:00
Add explicit dependencies to twitter addon
This commit is contained in:
parent
01738518a2
commit
d18bb44f8a
45 changed files with 6653 additions and 14 deletions
50
twitter/vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php
vendored
Normal file
50
twitter/vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use Abraham\TwitterOAuth\Util\JsonDecoder;
|
||||
|
||||
class JsonDecoderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider jsonProvider
|
||||
*/
|
||||
public function testDecode($input, $asArray, $expected)
|
||||
{
|
||||
$this->assertEquals($expected, JsonDecoder::decode($input, $asArray));
|
||||
}
|
||||
|
||||
public function jsonProvider()
|
||||
{
|
||||
return [
|
||||
['[]', true, []],
|
||||
['[1,2,3]', true, [1, 2, 3]],
|
||||
['[{"id": 556179961825226750}]', true, [['id' => 556179961825226750]]],
|
||||
['[]', false, []],
|
||||
['[1,2,3]', false, [1, 2, 3]],
|
||||
[
|
||||
'[{"id": 556179961825226750}]',
|
||||
false,
|
||||
[
|
||||
$this->getClass(function ($object) {
|
||||
$object->id = 556179961825226750;
|
||||
return $object;
|
||||
})
|
||||
]
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable $callable
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
private function getClass(\Closure $callable)
|
||||
{
|
||||
$object = new \stdClass();
|
||||
|
||||
return $callable($object);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue