Results
27.05.2020
migrate_media_handler 8.x-1.0-rc4 ::
tests/src/Kernel/MakeImageEntityTest.php
14 15 16 17 18 19 20 21 22 | public function testMakeImageEntity() { // Instantiate file for media entity. $file = $this ->generateFile(); $this ->assertInstanceOf(File:: class , $file , 'File not properly instantiated.' ); // Make and test Image entity. $config = [ 'target_bundle' => $this ->testMediaType->id(), 'source_field' => 'old_image_field' , |
27.05.2020
migrate_media_handler 8.x-1.0-rc4 ::
tests/src/Kernel/MakeDocumentEntityTest.php
24 25 26 27 28 29 30 31 32 | // Instantiate file for media entity. $this ->testMediaFilename = 'test.txt' ; $file = $this ->generateFile(); $this ->assertInstanceOf(File:: class , $file , 'File not properly instantiated.' ); // Make and test Document entity. $config = [ 'target_bundle' => $this ->testMediaType->id(), 'source_field' => 'old_document_field' , |
19.05.2022
monster_menus 9.0.x-dev ::
modules/mm_media/tests/src/Kernel/DownloadTest.php
223 224 225 226 227 228 229 230 | $setupNodeBodyWithMedia = function ( $filename , $catlist = []) { $file = $this ->generateFile( $filename ); $body_value = '<img src="test.jpg" data-entity-type="file" data-entity-uuid="' . $file ->uuid() . '" />' ; $body = [[ 'value' => $body_value , 'format' => 'filtered_html' , ]]; $this ->createNode([ |
355 356 357 358 359 360 361 362 363 | ]]; $this ->generateFile( $filename [ 'no usage' ] = 'no_usage.txt' ); $this ->generateMedia( $filename [ 'no longer used' ] = 'no_longer_used.txt' , $mediaType )-> delete (); // Mark unused managed files as temporary. $this ->config( 'file.settings' ) ->set( 'make_unused_managed_files_temporary' , TRUE) |
461 462 463 464 465 466 467 468 469 | * A file entity. */ protected function generateFile( $filename ) { if ( $fp = fopen ( $uri , 'c+' )) { $this ->cleanupFilenames[] = $filename ; fwrite( $fp , str_repeat ( 'a' , 3000)); fclose( $fp ); } |
494 495 496 497 498 499 500 501 502 | */ protected function generateMedia( $filename , MediaTypeInterface $media_type ) { $file = $this ->generateFile( $filename ); $media = Media::create([ 'bundle' => $media_type ->id(), 'name' => 'Mr. Jones' , 'field_media_file' => [ 'target_id' => $file ->id(), ], |
29.01.2022
quickedit 1.0.x-dev ::
tests/src/FunctionalJavascript/QuickEditFileTest.php
69 70 71 72 73 74 75 76 | // Create test file. $this ->generateFile( 'test' , 64, 10, 'text' ); $file = File::create([ 'filename' => 'test.txt' , ]); $file ->setPermanent(); $file ->save(); |
05.01.2019
templating 8.x-2.0 ::
src/BaseServiceEntityInlineTemplate.php
24 25 26 27 28 29 30 | public function generateFile( $directory , $filename , $content ) { $fileSystem = \Drupal::service( 'file_system' ); if (! is_dir ( $directory )) { if ( $fileSystem -> mkdir ( $directory , 0777, true) === false) { \Drupal::messenger()->addMessage(t( 'Failed to create directory ' . $directory ), 'error' ); return false; |
20.05.2020
yandex_yml 8.x-1.1 ::
src/YandexYmlGeneratorInterface.php
18 19 20 21 22 23 24 25 26 | * The path where to save the file. */ /** * Generates result and return result from memory. * * @ return string * The current file contents from buffer. |
20.05.2020
yandex_yml 8.x-1.1 ::
src/YandexYmlGenerator.php
84 85 86 87 88 89 90 91 92 | * leading dashes for path. */ $this ->prepareTemporaryFile() ->setWriter() ->buildData(); $this ->fileSystem-> copy ( $this ->tempFilePath, |
Pages
- « first
- ‹ previous
- 1
- 2
- 3