1--TEST--
2Testing ftp_set_option erros while setting up
3--CREDITS--
4Gabriel Caruso (carusogabriel34@gmail.com)
5--SKIPIF--
6<?php require 'skipif.inc'; ?>
7--FILE--
8<?php
9require 'server.inc';
10define('FOO_BAR', 10);
11
12$ftp = ftp_connect('127.0.0.1', $port);
13ftp_login($ftp, 'user', 'pass');
14$ftp or die("Couldn't connect to the server");
15
16var_dump(ftp_set_option($ftp, FTP_TIMEOUT_SEC, 0));
17var_dump(ftp_set_option($ftp, FTP_TIMEOUT_SEC, '0'));
18var_dump(ftp_set_option($ftp, FTP_USEPASVADDRESS, ['1']));
19var_dump(ftp_set_option($ftp, FTP_AUTOSEEK, 'true'));
20var_dump(ftp_set_option($ftp, FOO_BAR, 1));
21?>
22--EXPECTF--
23Warning: ftp_set_option(): Timeout has to be greater than 0 in %s on line %d
24bool(false)
25
26Warning: ftp_set_option(): Option TIMEOUT_SEC expects value of type int, string given in %s on line %d
27bool(false)
28
29Warning: ftp_set_option(): Option USEPASVADDRESS expects value of type bool, array given in %s on line %d
30bool(false)
31
32Warning: ftp_set_option(): Option AUTOSEEK expects value of type bool, string given in %s on line %d
33bool(false)
34
35Warning: ftp_set_option(): Unknown option '10' in %s on line %d
36bool(false)
37