function it_should_adjust_the_port_if_it_changes_in_the_domain_config(TcpSocket $tcp) { $tcp->connect('foo', 389, 1)->shouldBeCalled()->willReturn(true); $tcp->close()->shouldBeCalled(); $config = new DomainConfiguration('example.com'); $config->setServers(['foo']); $this->beConstructedWith($config, $tcp); $this->getServer()->shouldReturn('foo'); $config->setPort(9001); $tcp->connect('foo', 9001, 1)->shouldBeCalled()->willReturn(true); $this->getServer()->shouldReturn('foo'); }