Skip to content

Commit

Permalink
Fix testing of protected baseConfig in CakeSocket.
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Apr 4, 2010
1 parent 3c2e7a0 commit 3039645
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions cake/tests/cases/libs/cake_socket.test.php
Expand Up @@ -55,29 +55,28 @@ function tearDown() {
*/
function testConstruct() {
$this->Socket->__construct();
$baseConfig = $this->Socket->_baseConfig;
$this->assertIdentical($baseConfig, array(
$config = $this->Socket->config;
$this->assertIdentical($config, array(
'persistent' => false,
'host' => 'localhost',
'protocol' => 'tcp',
'protocol' => getprotobyname('tcp'),
'port' => 80,
'timeout' => 30
));

$this->Socket->reset();
$this->Socket->__construct(array('host' => 'foo-bar'));
$baseConfig['host'] = 'foo-bar';
$baseConfig['protocol'] = getprotobyname($baseConfig['protocol']);
$this->assertIdentical($this->Socket->config, $baseConfig);
$config['host'] = 'foo-bar';
$this->assertIdentical($this->Socket->config, $config);

$this->Socket = new CakeSocket(array('host' => 'www.cakephp.org', 'port' => 23, 'protocol' => 'udp'));
$baseConfig = $this->Socket->_baseConfig;
$config = $this->Socket->config;

$baseConfig['host'] = 'www.cakephp.org';
$baseConfig['port'] = 23;
$baseConfig['protocol'] = 17;
$config['host'] = 'www.cakephp.org';
$config['port'] = 23;
$config['protocol'] = 17;

$this->assertIdentical($this->Socket->config, $baseConfig);
$this->assertIdentical($this->Socket->config, $config);
}

/**
Expand Down

0 comments on commit 3039645

Please sign in to comment.