Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikaheidi committed Jun 12, 2021
1 parent 785da86 commit 1c71c28
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/Feature/ImagePlaceholderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@
expect($placeholder->pos_x)->toEqual(0);
expect($placeholder->pos_y)->toEqual(0);
expect($placeholder->image)->toEqual("test.jpg");
});

it('sets default values when not provided', function () {

$params = [
'width' => 100,
'height' => 100,
'pos_x' => 0,
'pos_y' => 0,
];

$placeholder = new ImagePlaceholder($params);
expect($placeholder->crop)->toEqual("left");
});
2 changes: 1 addition & 1 deletion tests/Feature/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
expect($template->name)->toEqual("gdaisy");
});

it('creates placeholder and stores coordinates', function () {
it('adds placeholder and stores coordinates', function () {
$params = [
'width' => 100,
'height' => 100,
Expand Down
34 changes: 34 additions & 0 deletions tests/Feature/TextPlaceholderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use GDaisy\TextPlaceholder;

it('creates text placeholder and stores coordinates ', function () {

$params = [
'pos_x' => 0,
'pos_y' => 0,
'size' => 30,
'color' => '000000'
];

$placeholder = new TextPlaceholder($params);

expect($placeholder->pos_x)->toEqual(0);
expect($placeholder->pos_y)->toEqual(0);
expect($placeholder->size)->toEqual(30);
expect($placeholder->color)->toEqual('000000');
});

it('sets up default values when not provided', function () {

$params = [
'pos_x' => 0,
'pos_y' => 0,
'size' => 30,
'color' => '000000'
];

$placeholder = new TextPlaceholder($params);

expect($placeholder->align)->toEqual('left');
});

0 comments on commit 1c71c28

Please sign in to comment.