19 declare(strict_types=1);
21 require_once(__DIR__ .
'/ModalBase.php');
37 $this->assertEquals([$page], $lightbox->getPages());
44 $this->assertEquals($pages, $lightbox->getPages());
54 $actual = $this->
normalizeHTML($this->getDefaultRenderer()->render($lightbox));
55 $this->assertEquals($expected, $actual);
60 $image =
new I\Component\Image\Image(
"responsive",
'src/fake/image.jpg',
'description');
61 $card =
new I\Component\Card\Card(
'foo');
64 'Render image page' => [
'lightboxImagePage', [$image,
'title'], self::getExpectedImagePageHTML()],
65 'Render text page' => [
'lightboxTextPage', [
'HelloWorld',
'title'], self::getExpectedTextPageHTML()],
66 'Render card page' => [
'lightboxCardPage', [$card], self::getExpectedCardPageHTML()],
72 $image1 =
new I\Component\Image\Image(
"responsive",
'src/fake/image.jpg',
'description');
81 $actual = $this->
normalizeHTML($this->getDefaultRenderer()->render($lightbox));
82 $this->assertEquals($expected, $actual);
93 <dialog
class=
"c-modal c-modal--lightbox il-modal-lightbox il-modal-lightbox-bright" tabindex=
"-1" id=
"id_1">
94 <div
class=
"modal-dialog modal-lg" role=
"document">
95 <div
class=
"modal-content il-modal-lightbox-page">
96 <div
class=
"modal-header">
97 <
form><
button formmethod=
"dialog" class=
"close" aria-label=
"close"><span aria-hidden=
"true"></span></
button></
form>
98 <h1
class=
"modal-title">title</h1>
100 <div
class=
"modal-body">
101 <div
id=
"id_1_carousel" class=
"carousel slide" data-ride=
"carousel" data-interval=
"false">
103 <div
class=
"carousel-inner" role=
"listbox">
104 <div
class=
"item active text-only" data-title=
"title">
105 <div
class=
"item-content ">
122 <dialog
class=
"c-modal c-modal--lightbox il-modal-lightbox il-modal-lightbox-dark" tabindex=
"-1" id=
"id_1">
123 <div
class=
"modal-dialog modal-lg" role=
"document">
124 <div
class=
"modal-content il-modal-lightbox-page">
125 <div
class=
"modal-header">
126 <
form><
button formmethod=
"dialog" class=
"close" aria-label=
"close"><span aria-hidden=
"true"></span></
button></
form>
127 <h1
class=
"modal-title">title</h1>
129 <div
class=
"modal-body">
130 <div
id=
"id_1_carousel" class=
"carousel slide" data-ride=
"carousel" data-interval=
"false">
132 <div
class=
"carousel-inner" role=
"listbox">
134 <div
class=
"item active" data-title=
"title">
135 <div
class=
"item-content ">
136 <img src=
"src/fake/image.jpg" class=
"img-responsive" alt=
"description" />
138 <div
class=
"carousel-caption">
156 <dialog
class=
"c-modal c-modal--lightbox il-modal-lightbox il-modal-lightbox-dark" tabindex=
"-1" id=
"id_1">
157 <div
class=
"modal-dialog modal-lg" role=
"document">
158 <div
class=
"modal-content il-modal-lightbox-page">
159 <div
class=
"modal-header">
160 <
form><
button formmethod=
"dialog" class=
"close" aria-label=
"close"><span aria-hidden=
"true"></span></
button></
form>
161 <h1
class=
"modal-title">title</h1>
163 <div
class=
"modal-body">
164 <div
id=
"id_1_carousel" class=
"carousel slide" data-ride=
"carousel" data-interval=
"false">
166 <ol
class=
"carousel-indicators">
167 <li data-target=
"#id_1_carousel" data-slide-
to=
"0" class=
"active"></li>
168 <li data-target=
"#id_1_carousel" data-slide-to=
"1" class=
""></li>
171 <div
class=
"carousel-inner" role=
"listbox">
172 <div
class=
"item active text-only" data-title=
"title">
173 <div
class=
"item-content ">
178 <div
class=
"item " data-title=
"title">
179 <div
class=
"item-content ">
180 <img src=
"src/fake/image.jpg" class=
"img-responsive" alt=
"description" />
182 <div
class=
"carousel-caption">
188 <
button class=
"left carousel-control btn-link" href=
"#id_1_carousel" role=
"button" data-slide=
"prev">
189 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
190 <span
class=
"sr-only">Previous</span>
192 <button
class=
"right carousel-control btn-link" href=
"#id_1_carousel" role=
"button" data-slide=
"next">
193 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
194 <span
class=
"sr-only">Next</span>
208 <dialog
class=
"c-modal c-modal--lightbox il-modal-lightbox il-modal-lightbox-bright" tabindex=
"-1" id=
"id_1">
209 <div
class=
"modal-dialog modal-lg" role=
"document">
210 <div
class=
"modal-content il-modal-lightbox-page">
211 <div
class=
"modal-header">
212 <
form><
button formmethod=
"dialog" class=
"close" aria-label=
"close"><span aria-hidden=
"true"></span></
button></
form>
213 <h1
class=
"modal-title">
foo</h1>
215 <div
class=
"modal-body">
216 <div
id=
"id_1_carousel" class=
"carousel slide" data-ride=
"carousel" data-interval=
"false">
217 <div
class=
"carousel-inner" role=
"listbox">
218 <div
class=
"item active" data-title=
"foo">
219 <div
class=
"item-content item-vertical"></div>
238 public function getComponent(): C\Component
button(string $caption, string $cmd)
static getExpectedImagePageHTML()
testSimplePageRendering(string $method, array $args, string $expected_html)
getPageProvider
static getExpectedMixedPagesHTML()
static getExpectedTextPageHTML()
static getExpectedCardPageHTML()
Base class for modal tests.
normalizeHTML(string $html)
Tests on implementation for the lightbox modal.
testDifferentPageTypeRendering()
form( $class_path, string $cmd, string $submit_caption="")
Some very basic component implementation.
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.