File: UrlsTest.php

package info (click to toggle)
php-getid3 2.0.0~beta6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,108 kB
  • sloc: php: 34,627; makefile: 12
file content (61 lines) | stat: -rw-r--r-- 1,714 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php

namespace JamesHeinrich\GetID3\Tests;

use ExternalUrlTest;
use JamesHeinrich\GetID3\Exception;
use JamesHeinrich\GetID3\GetID3;
use PHPUnit\Framework\TestCase;

class UrlsTest extends TestCase
{

	public function testHttps()
	{
		try{
			$getID3 = new GetID3();
			$info = $getID3->analyze("https://example.com/test.mp3");
			$this->assertArrayHasKey('error', $info);
			$this->assertContains('Remote files are not supported - please copy the file locally first', $info['error']);
		}catch (Exception $e){
			$this->assertFalse(true, "Exception: ".$e->getMessage());
		}
	}

	public function testHttp()
	{
		try{
			$getID3 = new GetID3();
			$info = $getID3->analyze("http://example.com/test.mp3");
			$this->assertArrayHasKey('error', $info);
			$this->assertContains('Remote files are not supported - please copy the file locally first', $info['error']);
		}catch (Exception $e){
			$this->assertFalse(true, "Exception: ".$e->getMessage());
		}
	}

	public function testFtp()
	{
		try{
			$getID3 = new GetID3();
			$info = $getID3->analyze("ftp://example.com/test.mp3");
			$this->assertArrayHasKey('error', $info);
			$this->assertContains('Remote files are not supported - please copy the file locally first', $info['error']);
		}catch (Exception $e){
			$this->assertFalse(true, "Exception: ".$e->getMessage());
		}
	}

	public function testFtps()
	{
		try{
			$getID3 = new GetID3();
			$info = $getID3->analyze("ftps://example.com/test.mp3");
			$this->assertArrayHasKey('error', $info);
			$this->assertContains('Remote files are not supported - please copy the file locally first', $info['error']);
		}catch (Exception $e){
			$this->assertFalse(true, "Exception: ".$e->getMessage());
		}
	}

}