<commit_before><?php

require_once 'AbstractBackendTest.php';

use iFixit\Matryoshka;

class McRouterTest extends AbstractBackendTest {
   protected function setUp() {
      if (!Matryoshka\McRouter::isAvailable()) {
         $this->markTestSkipped('Backend not available!');
      }

      return parent::setUp();
   }

   protected function getBackend() {
      $memcached = new Memcached();
      $memcached->addServer('localhost', 11211);
      $memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false);
      $memcached->setOption(Memcached::OPT_TCP_NODELAY, true);

      return Matryoshka\McRouter::create($memcached);
   }

   public function testMcRouter() {
      $backend = $this->getBackend();
      list($key, $value) = $this->getRandomKeyValue();
      $this->assertTrue($backend->set($key, $value, 1));
      // Wait for it to expire.
      sleep(2);

      $this->assertNull($backend->get($key));
   }
}<commit_msg>Make McrouterTest extend MemcachedTest<commit_after><?php

require_once 'MemcachedTest.php';

use iFixit\Matryoshka;

class McRouterTest extends MemcachedTest {
   protected function getBackend() {
      $memcached = new Memcached();
      $memcached->addServer('localhost', 11211);
      $memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false);
      $memcached->setOption(Memcached::OPT_TCP_NODELAY, true);

      return Matryoshka\McRouter::create($memcached);
   }
}
{'fraction_non_alphanumeric': 0.13981547196593327, 'fraction_numerical': 0.008516678495386799, 'mean_word_length': 4.090252707581228, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7622950', 'n_tokens_mistral': 445, 'n_tokens_neox': 439, 'n_words': 77}