FactoryTest.php 1012 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Test;
  12. use Composer\Factory;
  13. class FactoryTest extends TestCase
  14. {
  15. /**
  16. * @group TLS
  17. */
  18. public function testDefaultValuesAreAsExpected()
  19. {
  20. $ioMock = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
  21. $ioMock->expects($this->once())
  22. ->method("writeError")
  23. ->with($this->equalTo('<warning>You are running Composer with SSL/TLS protection disabled.</warning>'));
  24. $config = $this
  25. ->getMockBuilder('Composer\Config')
  26. ->getMock();
  27. $config->method('get')
  28. ->with($this->equalTo('disable-tls'))
  29. ->will($this->returnValue(true));
  30. Factory::createHttpDownloader($ioMock, $config);
  31. }
  32. }