$build =
$bm->
bookTreeOutput($bm->
bookTreeAllData($bid));
$items =
$build['#items'
];
$this->
assertBookItemIsCorrectlyTranslated($items[$bid],
$langcode);
$this->
assertBookItemIsCorrectlyTranslated($items[$bid]['below'
][$bid + 1
],
$langcode);
$this->
assertBookItemIsCorrectlyTranslated($items[$bid]['below'
][$bid + 1
]['below'
][$bid + 3
],
$langcode);
$this->
assertBookItemIsCorrectlyTranslated($items[$bid]['below'
][$bid + 1
]['below'
][$bid + 4
],
$langcode);
$this->
assertBookItemIsCorrectlyTranslated($items[$bid]['below'
][$bid + 2
],
$langcode);
$this->
assertBookItemIsCorrectlyTranslated($items[$bid]['below'
][$bid + 2
]['below'
][$bid + 5
],
$langcode);
$this->
assertBookItemIsCorrectlyTranslated($items[$bid]['below'
][$bid + 2
]['below'
][$bid + 6
],
$langcode);
$toc =
$bm->
getTableOfContents($bid, 4
);
// Root entry does not have an indent.
$this->
assertToCEntryIsCorrectlyTranslated($toc,
$langcode,
$bid, ''
);
// The direct children of the root have one indent.
$this->
assertToCEntryIsCorrectlyTranslated($toc,
$langcode,
$bid + 1, '--'
);
$this->
assertToCEntryIsCorrectlyTranslated($toc,
$langcode,
$bid + 2, '--'
);
// Their children have two indents.
$this->
assertToCEntryIsCorrectlyTranslated($toc,
$langcode,
$bid + 3, '----'
);
$this->
assertToCEntryIsCorrectlyTranslated($toc,
$langcode,
$bid + 4, '----'
);
$this->
assertToCEntryIsCorrectlyTranslated($toc,
$langcode,
$bid + 5, '----'
);
$this->
assertToCEntryIsCorrectlyTranslated($toc,
$langcode,
$bid + 6, '----'
);
// $bid might be a string.
$this->
assertSame([$bid + 0,
$bid + 1,
$bid + 3,
$bid + 4,
$bid + 2,
$bid + 5,
$bid + 6
],
array_keys($toc));
} }