コード例 #1
0
ファイル: All.php プロジェクト: toin0u/yo-cli
 /**
  * {@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
ファイル: YoSpec.php プロジェクト: toin0u/yo
 /**
  * @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);
 }