Skip to content

Commit

Permalink
fix the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed Feb 8, 2018
1 parent 932123d commit d2a4e36
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
language: php

dist: 'precise'

php:
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'

matrix:
include:
- php: 5.3
dist: precise

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^4.8 || ^6.5",
"php-coveralls/php-coveralls": "^1.0"
},
"scripts": {
Expand Down
38 changes: 37 additions & 1 deletion tests/Vimeo/VimeoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function testUploadWithFakeMachineIdShouldReturnVimeoRequestException()
$vimeo = new Vimeo($this->clientId, $this->clientSecret);

// Act
$result = $vimeo->upload(__DIR__.'/../../composer.json');
$result = $vimeo->upload(__DIR__.'/../../composer.json', ['fake_machine_id']);
}

/**
Expand Down Expand Up @@ -214,4 +214,40 @@ public function testUploadTexttrackWithNonExistedFile()
// Act
$result = $vimeo->uploadTexttrack('https://vimeo.com/241711006', './the_file_is_invalid', 'fake_track_type', 'zh_TW');
}

/**
* @expectedException Vimeo\Exceptions\VimeoRequestException
*/
public function testReplaceWithVideoUriAndMachineIdShouldReturnVimeoRequestException()
{
// Arrange
$vimeo = new Vimeo($this->clientId, $this->clientSecret);

// Act
$result = $vimeo->replace('https://vimeo.com/241711006', __DIR__.'/../../composer.json', ['fake_machine_id']);
}

/**
* @expectedException Vimeo\Exceptions\VimeoRequestException
*/
public function testUploadImageWithPictureUriAndMachineIdShouldReturnVimeoRequestException()
{
// Arrange
$vimeo = new Vimeo($this->clientId, $this->clientSecret);

// Act
$result = $vimeo->uploadImage('https://vimeo.com/user59081751', __DIR__.'/../../composer.json', ['fake_machine_id']);
}

/**
* @expectedException Vimeo\Exceptions\VimeoRequestException
*/
public function testUploadTexttrackWithPictureUriAndMachineIdShouldReturnVimeoRequestException()
{
// Arrange
$vimeo = new Vimeo($this->clientId, $this->clientSecret);

// Act
$result = $vimeo->uploadTexttrack('https://vimeo.com/user59081751', __DIR__.'/../../composer.json', 'fake_track_type', 'zh_TW');
}
}

0 comments on commit d2a4e36

Please sign in to comment.