Skip to content

Commit

Permalink
Merge pull request #37 from mirko-pagliai/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mirko-pagliai authored Apr 19, 2018
2 parents 125ced7 + 1c8abcb commit 4a8f370
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 74 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# 1.x branch
## 1.4 branch
# 1.4.1
* removed `Thumber\TestSuite\TestCase::assertFileExtension()` method;
* removed `Thumber\TestSuite\TestCase::assertImageSize()` method;
* `Thumber\TestSuite\TestCase::assertMime()` method renamed as `assertFileMime()`.
* `ThumbNotFoundException` extends the `RuntimeException` and now is located
below the `Thumber\Http\Exception` namespace. This ensures compability with
CakePHP 3.6.
* removed `assertFileExtension()`, `assertImageSize()` and `assertMime()`
methods provided by `Thumber\TestSuite\TestCase` class.

# 1.4.0
* removed all methods provided previously by the `ThumbHelper`. These methods
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.txt)
[![Build Status](https://travis-ci.org/mirko-pagliai/cakephp-thumber.svg?branch=master)](https://travis-ci.org/mirko-pagliai/cakephp-thumber)
[![Build status](https://ci.appveyor.com/api/projects/status/kmo1kmgqg34y4g87?svg=true)](https://ci.appveyor.com/project/mirko-pagliai/cakephp-thumber)
[![Coverage Status](https://img.shields.io/codecov/c/github/mirko-pagliai/cakephp-thumber.svg?style=flat-square)](https://codecov.io/github/mirko-pagliai/cakephp-thumber)
[![codecov](https://codecov.io/gh/mirko-pagliai/cakephp-thumber/branch/master/graph/badge.svg)](https://codecov.io/gh/mirko-pagliai/cakephp-thumber)

*cakephp-thumber* is a CakePHP plugin to create thumbnails.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}],
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": ">=3.4 <4.0",
"cakephp/cakephp": ">=3.4 <3.6",
"intervention/image": "^2.4",
"mirko-pagliai/php-tools": "^1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ThumbsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Thumber\Controller;

use Cake\Controller\Controller;
use Thumber\Network\Exception\ThumbNotFoundException;
use Thumber\Http\Exception\ThumbNotFoundException;
use Thumber\ThumbTrait;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
* @copyright Copyright (c) Mirko Pagliai
* @link https://github.com/mirko-pagliai/cakephp-thumber
* @license https://opensource.org/licenses/mit-license.php MIT License
* @since 1.0.4
*/
namespace Thumber\Network\Exception;
namespace Thumber\Http\Exception;

use Cake\Network\Exception\NotFoundException;
use RuntimeException;

/**
* ThumbNotFoundException
*/
class ThumbNotFoundException extends NotFoundException
class ThumbNotFoundException extends RuntimeException
{
}
16 changes: 0 additions & 16 deletions src/TestSuite/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,6 @@ public static function assertImageFileEquals($expected, $actual, $message = '')
//@codingStandardsIgnoreEnd
}

/**
* Asserts that a file has a MIME content type
* @param string $filename Path to the tested file
* @param string $expectedMime MIME content type, like `text/plain` or `application/octet-stream`
* @param string $message The failure message that will be appended to the
* generated message
* @return void
*/
public function assertFileMime($filename, $expectedMime, $message = '')
{
parent::skipIf(!version_compare(PHP_VERSION, '7.0', '>') &&
in_array($expectedMime, ['image/x-ms-bmp', 'image/vnd.adobe.photoshop']));

self::baseAssertFileMime($filename, $expectedMime, $message);
}

/**
* Asserts for a valid thumbnail path
* @param string $path Thumbnail path
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Controller/ThumbsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testThumb()

/**
* Test for `asset()` method, with a a no existing file
* @expectedException Thumber\Network\Exception\ThumbNotFoundException
* @expectedException Thumber\Http\Exception\ThumbNotFoundException
* @expectedExceptionMessageRegExp /^File `[\w\/:\\]+` doesn't exist$/
* @test
*/
Expand Down
47 changes: 0 additions & 47 deletions tests/TestCase/Network/Exception/ThumbNotFoundExceptionTest.php

This file was deleted.

0 comments on commit 4a8f370

Please sign in to comment.