diff --git a/tests/Feature/ImagePlaceholderTest.php b/tests/Feature/ImagePlaceholderTest.php index 394900d..2a48ec0 100644 --- a/tests/Feature/ImagePlaceholderTest.php +++ b/tests/Feature/ImagePlaceholderTest.php @@ -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"); }); \ No newline at end of file diff --git a/tests/Feature/TemplateTest.php b/tests/Feature/TemplateTest.php index b42b268..90ac14a 100644 --- a/tests/Feature/TemplateTest.php +++ b/tests/Feature/TemplateTest.php @@ -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, diff --git a/tests/Feature/TextPlaceholderTest.php b/tests/Feature/TextPlaceholderTest.php new file mode 100644 index 0000000..32efaf3 --- /dev/null +++ b/tests/Feature/TextPlaceholderTest.php @@ -0,0 +1,34 @@ + 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'); +}); \ No newline at end of file