PATH:
home
/
lab2454c
/
healthvalidate.com
/
vendor
/
cloudinary
/
cloudinary_php
/
tests
/
Unit
/
Tag
<?php /** * This file is part of the Cloudinary PHP package. * * (c) Cloudinary * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Cloudinary\Test\Unit\Tag; use Cloudinary\Configuration\Configuration; use Cloudinary\Tag\UploadTag; /** * Class UploadTagTest */ final class UploadTagTest extends TagTestCase { /** * @var Configuration */ private $configuration; public function setUp() { parent::setUp(); $this->configuration = new Configuration(); } public function testUploadTagImage() { $tag = new UploadTag('image', $this->configuration); $pattern = '/<input class="cloudinary-fileupload" ' . 'name="file" type="file" ' . 'data-cloudinary-field="image" ' . 'data-max-chunk-size="20000000" ' . 'data-form-data="{\"timestamp\":\d+,\"signature\":\"\w+\",' . '\"api_key\":\"\w+\"}" ' . 'data-url="http[^\']+\/v1_1\/test123\/auto\/upload"' . '>/'; self::assertRegExp($pattern, (string)$tag); } public function testUploadTagChunkSize() { $this->configuration->api->chunkSize = 5000000; $tag = new UploadTag('image', $this->configuration); $pattern = '/<input class="cloudinary-fileupload" ' . 'name="file" type="file" ' . 'data-cloudinary-field="image" ' . 'data-max-chunk-size="5000000" ' . 'data-form-data="{\"timestamp\":\d+,\"signature\":\"\w+\",' . '\"api_key\":\"\w+\"}" ' . 'data-url="http[^\']+\/v1_1\/test123\/auto\/upload"' . '>/'; self::assertRegExp( $pattern, (string)$tag ); } public function testUploadTagClass() { $tag = new UploadTag('image', $this->configuration); $tag->addClass('classy'); $pattern = '/<input class="cloudinary-fileupload classy" ' . 'name="file" type="file" ' . 'data-cloudinary-field="image" ' . 'data-max-chunk-size="20000000" ' . 'data-form-data="{\"timestamp\":\d+,\"signature\":\"\w+\",' . '\"api_key\":\"\w+\"}" ' . 'data-url="http[^\']+\/v1_1\/test123\/auto\/upload"' . '>/'; self::assertRegExp( $pattern, (string)$tag ); } public function testUnsignedUploadTag() { $tag = UploadTag::unsigned('image', 'testUploadPreset', $this->configuration); $pattern = '/<input class="cloudinary-fileupload" ' . 'name="file" type="file" ' . 'data-cloudinary-field="image" ' . 'data-max-chunk-size="20000000" ' . 'data-form-data="{\"upload_preset\":\"\w+\",' . '\"timestamp\":\d+}" ' . 'data-url="http[^\']+\/v1_1\/test123\/auto\/upload"' . '>/'; self::assertRegExp( $pattern, (string)$tag ); } }
[-] TestTag.php
[edit]
[+]
..
[-] ImageTagTestCase.php
[edit]
[-] FormInputTagTest.php
[edit]
[-] SpriteTagTest.php
[edit]
[+]
Patterns
[-] ImageTagTest.php
[edit]
[-] PictureTagTest.php
[edit]
[-] FormTagTest.php
[edit]
[-] UploadTagTest.php
[edit]
[-] TagTest.php
[edit]
[-] TagFromParamsTest.php
[edit]
[-] VideoTagTest.php
[edit]
[-] VideoThumbnailTagTest.php
[edit]
[-] JsConfigTagTest.php
[edit]
[-] PictureSourceTagTest.php
[edit]
[-] ClientHintsMetaTagTest.php
[edit]
[-] TagTestCase.php
[edit]