Test the entity source specific cart functionality.
function testCart() {
$this
->loginAsTranslator(array(
'translate configuration',
));
// Test the source overview.
$this
->drupalGet('admin/structure/views/view/content/translate');
$this
->submitForm([], 'Add to cart');
$this
->drupalGet('admin/structure/types/manage/article/translate');
$this
->submitForm([], 'Add to cart');
// Test if the content and article are in the cart.
$this
->drupalGet('admin/tmgmt/cart');
$this
->assertSession()
->linkExists('Content view');
$this
->assertSession()
->linkExists('Article content type');
// Test the label on the source overivew.
$this
->drupalGet('admin/structure/views/view/content/translate');
$this
->assertSession()
->responseContains(t('There are @count items in the <a href=":url">translation cart</a> including the current item.', array(
'@count' => 2,
':url' => Url::fromRoute('tmgmt.cart')
->toString(),
)));
}