1 | <?php |
||
17 | class FileFormSubmissionFieldTest extends TestCase |
||
18 | { |
||
19 | /** |
||
20 | * @var FileFormSubmissionField |
||
21 | */ |
||
22 | protected $object; |
||
23 | |||
24 | /** |
||
25 | * Sets up the fixture, for example, opens a network connection. |
||
26 | * This method is called before a test is executed. |
||
27 | */ |
||
28 | protected function setUp() |
||
29 | { |
||
30 | $this->object = new FileFormSubmissionField(); |
||
31 | } |
||
32 | |||
33 | public function testToString() |
||
34 | { |
||
35 | $stringValue = $this->object->__toString(); |
||
36 | $this->assertNotNull($stringValue); |
||
37 | $this->assertInternalType('string', $stringValue); |
||
|
|||
38 | } |
||
39 | |||
40 | public function testIsNull() |
||
41 | { |
||
42 | $file = new UploadedFile(__DIR__ . '/../../Resources/assets/example.jpg', 'example.jpg'); |
||
43 | |||
44 | $object = $this->object; |
||
45 | $this->assertTrue($object->isNull()); |
||
46 | $object->file = $file; |
||
47 | $this->assertFalse($object->isNull()); |
||
48 | } |
||
49 | |||
50 | public function testGetSafeFileName() |
||
51 | { |
||
52 | $file = new UploadedFile(__DIR__ . '/../../Resources/assets/example.jpg', 'the file name $@&.jpg'); |
||
53 | |||
54 | $object = $this->object; |
||
55 | $object->file = $file; |
||
56 | $safeName = $object->getSafeFileName(); |
||
57 | |||
58 | $this->assertEquals('the-file-name.jpeg', $safeName); |
||
59 | } |
||
60 | |||
61 | public function testGettersAndSetters() |
||
74 | |||
75 | public function testGetSubmissionTemplate() |
||
80 | |||
81 | public function testUpload() |
||
117 | } |
||
118 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.