Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $yo = $this->getHelper('yo')->getYo();
     $url = $input->getArgument('url');
     $bag = null;
     $output->write('Yo <comment>`ALL`</comment>');
     if (filter_var($url, FILTER_VALIDATE_URL)) {
         $bag = new Link($url);
         $output->write(sprintf(' ~ <info>`%s`</info>', $bag->getValue()));
     }
     try {
         $yo->all($bag);
     } catch (\Exception $e) {
         $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
     }
 }
Пример #2
0
 /**
  * @param Ivory\HttpAdapter\HttpAdapterInterface $adapter
  */
 function it_sends_a_yo_to_all_subscribers_with_a_link($adapter)
 {
     $link = new Link('http://sbin.dk/');
     $adapter->send(sprintf('%s/yoall/', Yo::ENDPOINT), InternalRequestInterface::METHOD_POST, array(), array('api_token' => self::API_KEY, $link->getKey() => $link->getValue()))->willReturn(null);
     $this->all($link)->shouldReturn(null);
 }