embedpress
/
vendor
/
wpdevelopers
/
embera
/
tests
/
Embera
/
ProviderCollection
/
SlimProviderCollectionTest.php
CustomProviderCollectionTest.php
5 years ago
DefaultProviderCollectionTest.php
5 years ago
SlimProviderCollectionTest.php
5 years ago
SlimProviderCollectionTest.php
44 lines
| 1 | <?php |
| 2 | /** |
| 3 | * SlimProviderCollectionTest.php |
| 4 | * |
| 5 | * @package Embera |
| 6 | * @author Michael Pratt <yo@michael-pratt.com> |
| 7 | * @link http://www.michael-pratt.com/ |
| 8 | * |
| 9 | * For the full copyright and license information, please view the LICENSE |
| 10 | * file that was distributed with this source code. |
| 11 | */ |
| 12 | |
| 13 | namespace Embera\ProviderCollection; |
| 14 | |
| 15 | use PHPUnit\Framework\TestCase; |
| 16 | use Embera\Embera; |
| 17 | |
| 18 | final class SlimProviderCollectionTest extends TestCase |
| 19 | { |
| 20 | protected $urls = [ |
| 21 | 'https://www.kickstarter.com/projects/wilderwoventarot/the-wilderwoven-tarot', |
| 22 | 'http://www.youtube.com/watch?v=WtPiGYsllos&index=1', |
| 23 | 'https://repl.it/repls/GloriousMotherlyButton', |
| 24 | ]; |
| 25 | |
| 26 | protected $config = [ |
| 27 | 'https_only' => false, |
| 28 | 'fake_responses' => Embera::ALLOW_FAKE_RESPONSES, |
| 29 | 'maxwidth' => 430, |
| 30 | 'maxheight' => 270, |
| 31 | ]; |
| 32 | |
| 33 | public function testCanFindProviders() |
| 34 | { |
| 35 | $collection = new SlimProviderCollection($this->config); |
| 36 | $providers = $collection->findProviders($this->urls); |
| 37 | |
| 38 | foreach ($providers as $p) { |
| 39 | $this->assertContains($p->getProviderName(), [ 'Youtube', 'Kickstarter' ]); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | } |
| 44 |