ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DropzoneRendererTest Class Reference

Class FileDropzoneRendererTest. More...

+ Inheritance diagram for DropzoneRendererTest:
+ Collaboration diagram for DropzoneRendererTest:

Public Member Functions

 test_implements_factory_interface ()
 
 testRenderStandardDropzone ()
 should be rendered with the css class .standard and no content inside the dropzone div. More...
 
 testRenderStandardDropzoneWithMessage ()
 should be rendered with the css class .standard and a span-tag with the passed in message inside the dropzone div. More...
 
 testRenderWrapperDropzone ()
 A wrapper dropzone -----------------------------------------------------------——. More...
 
 testRenderMetadata ()
 
 testWithButton ()
 
 testModifiers ()
 
 getUIFactory ()
 
 normalizeHTML ($html)
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Data Fields

const STANDARD = "ILIAS\\UI\\Component\\Dropzone\\File\\Standard"
 
const WRAPPER = "ILIAS\\UI\\Component\\Dropzone\\File\\Wrapper"
 

Protected Member Functions

 dropzone ()
 

Detailed Description

Class FileDropzoneRendererTest.

Author
nmaerchy nm@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 13 of file DropzoneRendererTest.php.

Member Function Documentation

◆ dropzone()

DropzoneRendererTest::dropzone ( )
protected

Definition at line 173 of file DropzoneRendererTest.php.

References getUIFactory().

Referenced by test_implements_factory_interface(), testModifiers(), testRenderMetadata(), testRenderStandardDropzone(), testRenderStandardDropzoneWithMessage(), testRenderWrapperDropzone(), and testWithButton().

174  {
175  return $this->getUIFactory()->dropzone()->file();
176  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUIFactory()

DropzoneRendererTest::getUIFactory ( )

Definition at line 159 of file DropzoneRendererTest.php.

Referenced by dropzone(), and testWithButton().

160  {
161  return new \ILIAS\UI\Implementation\Factory();
162  }
+ Here is the caller graph for this function:

◆ normalizeHTML()

DropzoneRendererTest::normalizeHTML (   $html)

Definition at line 165 of file DropzoneRendererTest.php.

References $html.

Referenced by testRenderMetadata(), testRenderStandardDropzone(), testRenderStandardDropzoneWithMessage(), testRenderWrapperDropzone(), and testWithButton().

166  {
167  $html = trim(str_replace("\t", "", $html));
168 
169  return parent::normalizeHTML($html);
170  }
$html
Definition: example_001.php:87
+ Here is the caller graph for this function:

◆ test_implements_factory_interface()

DropzoneRendererTest::test_implements_factory_interface ( )

Definition at line 19 of file DropzoneRendererTest.php.

References dropzone().

20  {
21  $f = $this->dropzone();
22 
23  $this->assertInstanceOf(self::STANDARD, $f->standard(''));
24  $this->assertInstanceOf(self::WRAPPER, $f->wrapper('', $this->getUIFactory()->legacy('')));
25  }
+ Here is the call graph for this function:

◆ testModifiers()

DropzoneRendererTest::testModifiers ( )

Definition at line 132 of file DropzoneRendererTest.php.

References $message, $url, array, and dropzone().

133  {
134  $url = 'https://ilias.de/123?test=8&lorem=ipsum';
135  $message = 'Everything\'s fine here, just drop some files...';
136  $filesize = new DataSize(1024, DataSize::KB);
137  $file_types = array( 'pdf', 'docx' );
138  $allowed_files = 5;
139  $dropzone = $this->dropzone()
140  ->standard($url)
141  ->withMessage($message)
142  ->withUserDefinedFileNamesEnabled(true)
143  ->withUserDefinedDescriptionEnabled(true)
144  ->withAllowedFileTypes($file_types)
145  ->withFileSizeLimit($filesize)
146  ->withMaxFiles($allowed_files);
147 
148  $this->assertEquals($url, $dropzone->getUploadUrl());
149  $this->assertEquals($message, $dropzone->getMessage());
150  $this->assertTrue($dropzone->allowsUserDefinedFileNames());
151  $this->assertTrue($dropzone->allowsUserDefinedFileDescriptions());
152  $this->assertEquals($file_types, $dropzone->getAllowedFileTypes());
153  $this->assertEquals($filesize, $dropzone->getFileSizeLimit());
154  $this->assertEquals("1.024 KB", $dropzone->getFileSizeLimit()->__toString());
155  $this->assertEquals($allowed_files, $dropzone->getMaxFiles());
156  }
Class DataSize.
Definition: DataSize.php:15
catch(Exception $e) $message
Create styles array
The data for the language used.
$url
+ Here is the call graph for this function:

◆ testRenderMetadata()

DropzoneRendererTest::testRenderMetadata ( )

Definition at line 93 of file DropzoneRendererTest.php.

References $html, dropzone(), ILIAS_UI_TestBase\getDefaultRenderer(), and normalizeHTML().

94  {
95  $with_user_defined_names_html = '<div id="id_1" class="il-dropzone-base"><div class="clearfix hidden-sm-up"></div><div class="il-upload-file-list" ><div class="container-fluid il-upload-file-items"><div class="error-messages" style="display: none;"><div class="alert alert-danger" role="alert"><!-- General error messages are inserted here with javascript --></div></div><!-- rows from templates are cloned here with javascript --></div><!-- Templates --><div class="container-fluid" ><!-- hidden Template --><div class="il-upload-file-item il-upload-file-item-template clearfix row standard hidden"><div class="col-xs-12 col-no-padding"><span class="file-info toggle"><a class="glyph" aria-label="collapse_content"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></a><a class="glyph" aria-label="expand_content"><span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span></a></span><!-- Display Filename--><span class="file-info filename">FILENAME<!-- File name is inserted with javascript here --></span><!-- Display Filesize--><span class="file-info filesize">100KB<!-- File size is inserted with javascript here --></span><!-- Dropdown with actions--><span class="pull-right remove"><!--<div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="btn btn-link" href="" data-action="" aria-label="delete_file" >remove</a></li><li><a class="btn btn-link" href="" data-action="" aria-label="edit_metadata" >edit_metadata</a></li></ul></div>--><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button></span><!-- Progress Bar--><div class="progress" style="margin: 10px 0; display: none;"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0"aria-valuemin="0"aria-valuemax="100"></div></div><!-- Error Messages --><div class="file-error-message alert alert-danger" role="alert" style="display: none;"><!-- Error message for file is inserted with javascript here --></div><div class="file-success-message alert alert-success" role="alert" style="display: none;"><!-- Success message for file is inserted with javascript here --></div><br><div class="form-horizontal metadata" style="display: none;"><div class="form-group"><label class="col-sm-3 control-label">filename</label><div class="col-sm-9"><input type="text" class="form-control filename-input"></div></div></div></div></div><!-- li from templates are cloned here with javascript --></div></div><div class="container-fluid"><div class="il-dropzone standard clearfix row" data-upload-id="id_1"><div class="col-xs-12 col-md-3 col-sm-12 col-lg-3 il-dropzone-standard-select-files-wrapper "> <!--col-no-padding--><a class="btn btn-link" href="#" data-action="#" >select_files_from_computer</a></div><div class="col-xs-12 col-md-9 col-sm-12 col-lg-9 col-no-padding"><span class="pull-right dz-default dz-message">drag_files_here</span></div></div><div class="clearfix hidden-sm-up"></div></div></div>';
96  $with_user_defined_names = $this->dropzone()
97  ->standard('https://ilias.de/ilias.php')
98  ->withUserDefinedFileNamesEnabled(true);
99  $html = $this->normalizeHTML($this->getDefaultRenderer()->render($with_user_defined_names));
100  $this->assertEquals($with_user_defined_names_html, $html);
101 
102  $with_user_defined_descriptions_html = '<div id="id_1" class="il-dropzone-base"><div class="clearfix hidden-sm-up"></div><div class="il-upload-file-list" ><div class="container-fluid il-upload-file-items"><div class="error-messages" style="display: none;"><div class="alert alert-danger" role="alert"><!-- General error messages are inserted here with javascript --></div></div><!-- rows from templates are cloned here with javascript --></div><!-- Templates --><div class="container-fluid" ><!-- hidden Template --><div class="il-upload-file-item il-upload-file-item-template clearfix row standard hidden"><div class="col-xs-12 col-no-padding"><span class="file-info toggle"><a class="glyph" aria-label="collapse_content"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></a><a class="glyph" aria-label="expand_content"><span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span></a></span><!-- Display Filename--><span class="file-info filename">FILENAME<!-- File name is inserted with javascript here --></span><!-- Display Filesize--><span class="file-info filesize">100KB<!-- File size is inserted with javascript here --></span><!-- Dropdown with actions--><span class="pull-right remove"><!--<div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="btn btn-link" href="" data-action="" aria-label="delete_file" >remove</a></li><li><a class="btn btn-link" href="" data-action="" aria-label="edit_metadata" >edit_metadata</a></li></ul></div>--><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button></span><!-- Progress Bar--><div class="progress" style="margin: 10px 0; display: none;"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0"aria-valuemin="0"aria-valuemax="100"></div></div><!-- Error Messages --><div class="file-error-message alert alert-danger" role="alert" style="display: none;"><!-- Error message for file is inserted with javascript here --></div><div class="file-success-message alert alert-success" role="alert" style="display: none;"><!-- Success message for file is inserted with javascript here --></div><br><div class="form-horizontal metadata" style="display: none;"><div class="form-group"><label class="col-sm-3 control-label" for="description-input">description</label><div class="col-sm-9"><textarea class="form-control description-input" id="description-input" rows="3"></textarea></div></div></div></div></div><!-- li from templates are cloned here with javascript --></div></div><div class="container-fluid"><div class="il-dropzone standard clearfix row" data-upload-id="id_1"><div class="col-xs-12 col-md-3 col-sm-12 col-lg-3 il-dropzone-standard-select-files-wrapper "> <!--col-no-padding--><a class="btn btn-link" href="#" data-action="#" >select_files_from_computer</a></div><div class="col-xs-12 col-md-9 col-sm-12 col-lg-9 col-no-padding"><span class="pull-right dz-default dz-message">drag_files_here</span></div></div><div class="clearfix hidden-sm-up"></div></div></div>';
103  $with_user_defined_descriptions = $this->dropzone()
104  ->standard('https://ilias.de/ilias.php')
105  ->withUserDefinedDescriptionEnabled(true);
106  $html = $this->normalizeHTML($this->getDefaultRenderer()
107  ->render($with_user_defined_descriptions));
108  $this->assertEquals($with_user_defined_descriptions_html, $html);
109 
110  $with_user_defined_names_and_descriptions_html = '<div id="id_1" class="il-dropzone-base"><div class="clearfix hidden-sm-up"></div><div class="il-upload-file-list" ><div class="container-fluid il-upload-file-items"><div class="error-messages" style="display: none;"><div class="alert alert-danger" role="alert"><!-- General error messages are inserted here with javascript --></div></div><!-- rows from templates are cloned here with javascript --></div><!-- Templates --><div class="container-fluid" ><!-- hidden Template --><div class="il-upload-file-item il-upload-file-item-template clearfix row standard hidden"><div class="col-xs-12 col-no-padding"><span class="file-info toggle"><a class="glyph" aria-label="collapse_content"><span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span></a><a class="glyph" aria-label="expand_content"><span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span></a></span><!-- Display Filename--><span class="file-info filename">FILENAME<!-- File name is inserted with javascript here --></span><!-- Display Filesize--><span class="file-info filesize">100KB<!-- File size is inserted with javascript here --></span><!-- Dropdown with actions--><span class="pull-right remove"><!--<div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="btn btn-link" href="" data-action="" aria-label="delete_file" >remove</a></li><li><a class="btn btn-link" href="" data-action="" aria-label="edit_metadata" >edit_metadata</a></li></ul></div>--><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button></span><!-- Progress Bar--><div class="progress" style="margin: 10px 0; display: none;"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0"aria-valuemin="0"aria-valuemax="100"></div></div><!-- Error Messages --><div class="file-error-message alert alert-danger" role="alert" style="display: none;"><!-- Error message for file is inserted with javascript here --></div><div class="file-success-message alert alert-success" role="alert" style="display: none;"><!-- Success message for file is inserted with javascript here --></div><br><div class="form-horizontal metadata" style="display: none;"><div class="form-group"><label class="col-sm-3 control-label">filename</label><div class="col-sm-9"><input type="text" class="form-control filename-input"></div></div><div class="form-group"><label class="col-sm-3 control-label" for="description-input">description</label><div class="col-sm-9"><textarea class="form-control description-input" id="description-input" rows="3"></textarea></div></div></div></div></div><!-- li from templates are cloned here with javascript --></div></div><div class="container-fluid"><div class="il-dropzone standard clearfix row" data-upload-id="id_1"><div class="col-xs-12 col-md-3 col-sm-12 col-lg-3 il-dropzone-standard-select-files-wrapper "> <!--col-no-padding--><a class="btn btn-link" href="#" data-action="#" >select_files_from_computer</a></div><div class="col-xs-12 col-md-9 col-sm-12 col-lg-9 col-no-padding"><span class="pull-right dz-default dz-message">drag_files_here</span></div></div><div class="clearfix hidden-sm-up"></div></div></div>';
111  $with_user_defined_names_and_descriptions = $this->dropzone()
112  ->standard('https://ilias.de/ilias.php')
113  ->withUserDefinedDescriptionEnabled(true)
114  ->withUserDefinedFileNamesEnabled(true);
115  $html = $this->normalizeHTML($this->getDefaultRenderer()
116  ->render($with_user_defined_names_and_descriptions));
117  $this->assertEquals($with_user_defined_names_and_descriptions_html, $html);
118  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:216
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ testRenderStandardDropzone()

DropzoneRendererTest::testRenderStandardDropzone ( )

should be rendered with the css class .standard and no content inside the dropzone div.

Definition at line 32 of file DropzoneRendererTest.php.

References $html, dropzone(), ILIAS_UI_TestBase\getDefaultRenderer(), and normalizeHTML().

33  {
34 
35  // setup expected objects
36  $expectedHtml = '<div id="id_1" class="il-dropzone-base"><div class="clearfix hidden-sm-up"></div><div class="il-upload-file-list" ><div class="container-fluid il-upload-file-items"><div class="error-messages" style="display: none;"><div class="alert alert-danger" role="alert"><!-- General error messages are inserted here with javascript --></div></div><!-- rows from templates are cloned here with javascript --></div><!-- Templates --><div class="container-fluid" ><!-- hidden Template --><div class="il-upload-file-item il-upload-file-item-template clearfix row standard hidden"><div class="col-xs-12 col-no-padding"><!-- Display Filename--><span class="file-info filename">FILENAME<!-- File name is inserted with javascript here --></span><!-- Display Filesize--><span class="file-info filesize">100KB<!-- File size is inserted with javascript here --></span><!-- Dropdown with actions--><span class="pull-right remove"><!--<div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="btn btn-link" href="" data-action="" aria-label="delete_file" >remove</a></li></ul></div>--><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button></span><!-- Progress Bar--><div class="progress" style="margin: 10px 0; display: none;"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0"aria-valuemin="0"aria-valuemax="100"></div></div><!-- Error Messages --><div class="file-error-message alert alert-danger" role="alert" style="display: none;"><!-- Error message for file is inserted with javascript here --></div><div class="file-success-message alert alert-success" role="alert" style="display: none;"><!-- Success message for file is inserted with javascript here --></div></div></div><!-- li from templates are cloned here with javascript --></div></div><div class="container-fluid"><div class="il-dropzone standard clearfix row" data-upload-id="id_1"><div class="col-xs-12 col-md-3 col-sm-12 col-lg-3 il-dropzone-standard-select-files-wrapper "> <!--col-no-padding--><a class="btn btn-link" href="#" data-action="#" >select_files_from_computer</a></div><div class="col-xs-12 col-md-9 col-sm-12 col-lg-9 col-no-padding"><span class="pull-right dz-default dz-message">drag_files_here</span></div></div><div class="clearfix hidden-sm-up"></div></div></div>';
37 
38  // start test
39  $standardDropzone = $this->dropzone()->standard('');
40 
41  $html = $this->normalizeHTML($this->getDefaultRenderer()->render($standardDropzone));
42 
43  $this->assertEquals($expectedHtml, $html);
44  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:216
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ testRenderStandardDropzoneWithMessage()

DropzoneRendererTest::testRenderStandardDropzoneWithMessage ( )

should be rendered with the css class .standard and a span-tag with the passed in message inside the dropzone div.

Definition at line 51 of file DropzoneRendererTest.php.

References $html, dropzone(), ILIAS_UI_TestBase\getDefaultRenderer(), and normalizeHTML().

52  {
53 
54  // setup expected objects
55  $expectedHtml = '<div id="id_1" class="il-dropzone-base"><div class="clearfix hidden-sm-up"></div><div class="il-upload-file-list" ><div class="container-fluid il-upload-file-items"><div class="error-messages" style="display: none;"><div class="alert alert-danger" role="alert"><!-- General error messages are inserted here with javascript --></div></div><!-- rows from templates are cloned here with javascript --></div><!-- Templates --><div class="container-fluid" ><!-- hidden Template --><div class="il-upload-file-item il-upload-file-item-template clearfix row standard hidden"><div class="col-xs-12 col-no-padding"><!-- Display Filename--><span class="file-info filename">FILENAME<!-- File name is inserted with javascript here --></span><!-- Display Filesize--><span class="file-info filesize">100KB<!-- File size is inserted with javascript here --></span><!-- Dropdown with actions--><span class="pull-right remove"><!--<div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="btn btn-link" href="" data-action="" aria-label="delete_file" >remove</a></li></ul></div>--><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button></span><!-- Progress Bar--><div class="progress" style="margin: 10px 0; display: none;"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0"aria-valuemin="0"aria-valuemax="100"></div></div><!-- Error Messages --><div class="file-error-message alert alert-danger" role="alert" style="display: none;"><!-- Error message for file is inserted with javascript here --></div><div class="file-success-message alert alert-success" role="alert" style="display: none;"><!-- Success message for file is inserted with javascript here --></div></div></div><!-- li from templates are cloned here with javascript --></div></div><div class="container-fluid"><div class="il-dropzone standard clearfix row" data-upload-id="id_1"><div class="col-xs-12 col-md-3 col-sm-12 col-lg-3 il-dropzone-standard-select-files-wrapper "> <!--col-no-padding--><a class="btn btn-link" href="#" data-action="#" >select_files_from_computer</a></div><div class="col-xs-12 col-md-9 col-sm-12 col-lg-9 col-no-padding"><span class="pull-right dz-default dz-message">message</span></div></div><div class="clearfix hidden-sm-up"></div></div></div>';
56 
57  // start test
58  $standardDropzone = $this->dropzone()->standard('')->withMessage('message');
59 
60  $html = $this->normalizeHTML($this->getDefaultRenderer()->render($standardDropzone));
61 
62  $this->assertEquals($expectedHtml, $html);
63  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:216
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ testRenderWrapperDropzone()

DropzoneRendererTest::testRenderWrapperDropzone ( )

A wrapper dropzone -----------------------------------------------------------——.

should be rendered with the css class .wrapper and all passed in ILIAS UI components inside the div.

Definition at line 74 of file DropzoneRendererTest.php.

References $html, dropzone(), ILIAS_UI_TestBase\getDefaultRenderer(), and normalizeHTML().

75  {
76  // setup expected objects
77  $expectedHtml = '<div id="id_1" class="il-dropzone-base"><div class="il-dropzone wrapper" data-upload-id="id_1"><p>Pretty smart, isn\'t it?</p><p>Yeah, this is really smart.</p></div><div class="modal fade il-modal-roundtrip" tabindex="-1" role="dialog" id="id_2"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">upload</h4></div><div class="modal-body"><div class="il-upload-file-list" ><div class="container-fluid il-upload-file-items"><div class="error-messages" style="display: none;"><div class="alert alert-danger" role="alert"><!-- General error messages are inserted here with javascript --></div></div><!-- rows from templates are cloned here with javascript --></div><!-- Templates --><div class="container-fluid" ><!-- hidden Template --><div class="il-upload-file-item il-upload-file-item-template clearfix row standard hidden"><div class="col-xs-12 col-no-padding"><!-- Display Filename--><span class="file-info filename">FILENAME<!-- File name is inserted with javascript here --></span><!-- Display Filesize--><span class="file-info filesize">100KB<!-- File size is inserted with javascript here --></span><!-- Dropdown with actions--><span class="pull-right remove"><!--<div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="btn btn-link" href="" data-action="" aria-label="delete_file" >remove</a></li></ul></div>--><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button></span><!-- Progress Bar--><div class="progress" style="margin: 10px 0; display: none;"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0"aria-valuemin="0"aria-valuemax="100"></div></div><!-- Error Messages --><div class="file-error-message alert alert-danger" role="alert" style="display: none;"><!-- Error message for file is inserted with javascript here --></div><div class="file-success-message alert alert-success" role="alert" style="display: none;"><!-- Success message for file is inserted with javascript here --></div></div></div><!-- li from templates are cloned here with javascript --></div></div></div><div class="modal-footer"><a class="btn btn-default btn-primary ilSubmitInactive disabled" data-action="">upload</a><a class="btn btn-default" data-dismiss="modal" aria-label="Close">cancel</a></div></div></div></div></div>';
78 
79  // start test
80  $exampleTextQuestion = new \ILIAS\UI\Implementation\Component\Legacy\Legacy("<p>Pretty smart, isn't it?</p>");
81  $exampleTextAnswer = new \ILIAS\UI\Implementation\Component\Legacy\Legacy("<p>Yeah, this is really smart.</p>");
82  $wrapperDropzone = $this->dropzone()->wrapper('', [
83  $exampleTextQuestion,
84  $exampleTextAnswer,
85  ]);
86 
87  $html = $this->normalizeHTML($this->getDefaultRenderer()->render($wrapperDropzone));
88 
89  $this->assertEquals($expectedHtml, $html);
90  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:216
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ testWithButton()

DropzoneRendererTest::testWithButton ( )

Definition at line 121 of file DropzoneRendererTest.php.

References $html, dropzone(), ILIAS_UI_TestBase\getDefaultRenderer(), getUIFactory(), and normalizeHTML().

122  {
123  $expected_html = '<div id="id_1" class="il-dropzone-base"><div class="clearfix hidden-sm-up"></div><div class="il-upload-file-list" ><div class="container-fluid il-upload-file-items"><div class="error-messages" style="display: none;"><div class="alert alert-danger" role="alert"><!-- General error messages are inserted here with javascript --></div></div><!-- rows from templates are cloned here with javascript --></div><!-- Templates --><div class="container-fluid" ><!-- hidden Template --><div class="il-upload-file-item il-upload-file-item-template clearfix row standard hidden"><div class="col-xs-12 col-no-padding"><!-- Display Filename--><span class="file-info filename">FILENAME<!-- File name is inserted with javascript here --></span><!-- Display Filesize--><span class="file-info filesize">100KB<!-- File size is inserted with javascript here --></span><!-- Dropdown with actions--><span class="pull-right remove"><!--<div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="caret"></span></button><ul class="dropdown-menu"><li><a class="btn btn-link" href="" data-action="" aria-label="delete_file" >remove</a></li></ul></div>--><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button></span><!-- Progress Bar--><div class="progress" style="margin: 10px 0; display: none;"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0"aria-valuemin="0"aria-valuemax="100"></div></div><!-- Error Messages --><div class="file-error-message alert alert-danger" role="alert" style="display: none;"><!-- Error message for file is inserted with javascript here --></div><div class="file-success-message alert alert-success" role="alert" style="display: none;"><!-- Success message for file is inserted with javascript here --></div></div></div><!-- li from templates are cloned here with javascript --></div></div><div class="container-fluid"><div class="il-dropzone standard clearfix row" data-upload-id="id_1"><div class="col-xs-12 col-md-3 col-sm-12 col-lg-3 il-dropzone-standard-select-files-wrapper "> <!--col-no-padding--><a class="btn btn-link" href="#" data-action="#" >select_files_from_computer</a></div><div class="col-xs-12 col-md-9 col-sm-12 col-lg-9 col-no-padding"><span class="pull-right dz-default dz-message">drag_files_here</span></div></div><div class="clearfix hidden-sm-up"></div></div><a class="btn btn-default ilSubmitInactive disabled" data-action="#" id="id_2">Label</a></div>';
124  $button = $this->getUIFactory()->button()->standard('Label', '#');
125  $with_button = $this->dropzone()->standard('')->withUploadButton($button);
126  $html = $this->normalizeHTML($this->getDefaultRenderer()->render($with_button));
127  $this->assertEquals($expected_html, $html);
128  $this->assertEquals($button, $with_button->getUploadButton());
129  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:216
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

Field Documentation

◆ STANDARD

const DropzoneRendererTest::STANDARD = "ILIAS\\UI\\Component\\Dropzone\\File\\Standard"

Definition at line 15 of file DropzoneRendererTest.php.

◆ WRAPPER

const DropzoneRendererTest::WRAPPER = "ILIAS\\UI\\Component\\Dropzone\\File\\Wrapper"

Definition at line 16 of file DropzoneRendererTest.php.


The documentation for this class was generated from the following file: