Exemple #1
0
 public function test_set_disallowed_content()
 {
     $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
     $disallowed_content = new ReflectionProperty($upload, 'disallowed_content');
     $disallowed_content->setAccessible(true);
     $upload->set_disallowed_content(array('foo'));
     $this->assertEquals(array('foo'), $disallowed_content->getValue($upload));
     $upload->set_disallowed_content(array('foo', 'bar', 'meh'));
     $this->assertEquals(array('foo', 'bar', 'meh'), $disallowed_content->getValue($upload));
     $upload->set_disallowed_content('');
     $this->assertEquals(array('foo', 'bar', 'meh'), $disallowed_content->getValue($upload));
     $this->assertINstanceOf('\\phpbb\\files\\upload', $upload->set_disallowed_content(array()));
     $this->assertEquals(array(), $disallowed_content->getValue($upload));
     $upload->reset_vars();
     $this->assertEquals(array(), $disallowed_content->getValue($upload));
 }