-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Action class to find Image content lengths
- Loading branch information
1 parent
3b8cf08
commit 911a0da
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Hyde\Framework\Actions; | ||
|
||
use Hyde\Framework\Contracts\ActionContract; | ||
use Hyde\Framework\Models\Image; | ||
|
||
/** | ||
* @see \Tests\Feature\FindsContentLengthForImageObjectTest | ||
*/ | ||
class FindsContentLengthForImageObject implements ActionContract | ||
{ | ||
protected Image $image; | ||
|
||
public function __construct(Image $image) | ||
{ | ||
$this->image = $image; | ||
} | ||
|
||
public function execute(): int | ||
{ | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Hyde\Framework\Actions\FindsContentLengthForImageObject; | ||
use Hyde\Framework\Models\Image; | ||
use Tests\TestCase; | ||
|
||
/** | ||
* @covers \Hyde\Framework\Actions\FindsContentLengthForImageObject | ||
*/ | ||
class FindsContentLengthForImageObjectTest extends TestCase | ||
{ | ||
// Test Image helper shorthand returns content length | ||
/** | ||
* Unit test for the shorthand. Logic is tested in the rest of the case. | ||
* @covers \Hyde\Framework\Models\Image::getContentLength | ||
*/ | ||
public function test_image_helper_shorthand_returns_content_length() | ||
{ | ||
$this->assertIsInt( | ||
(new Image())->getContentLength() | ||
); | ||
} | ||
} |