TestRouteProvider example

$this->fixtures->dropTables(Database::getConnection());

    parent::tearDown();
  }

  /** * Confirms that the correct candidate outlines are generated. */
  public function testCandidateOutlines() {

    $connection = Database::getConnection();
    $provider = new TestRouteProvider($connection$this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');

    $parts = ['node', '5', 'edit'];

    $candidates = $provider->getCandidateOutlines($parts);

    $candidates = array_flip($candidates);

    $this->assertCount(7, $candidates, 'Correct number of candidates found');
    $this->assertArrayHasKey('/node/5/edit', $candidates);
    $this->assertArrayHasKey('/node/5/%', $candidates);
    $this->assertArrayHasKey('/node/%/edit', $candidates);
    
Home | Imprint | This part of the site doesn't use cookies.