use of org.wikipedia.page.Page in project apps-android-wikipedia by wikimedia.
the class ShareHandler method createFunnel.
private void createFunnel() {
WikipediaApp app = WikipediaApp.getInstance();
final Page page = fragment.getPage();
final PageProperties pageProperties = page.getPageProperties();
funnel = new ShareAFactFunnel(app, page.getTitle(), pageProperties.getPageId(), pageProperties.getRevisionId());
}
use of org.wikipedia.page.Page in project apps-android-wikipedia by wikimedia.
the class DescriptionEditClientTest method testIsEditAllowedNoWikiBaseItem.
@Test
public void testIsEditAllowedNoWikiBaseItem() {
WikiSite wiki = WikiSite.forLanguageCode("ru");
PageProperties props = mock(PageProperties.class);
when(props.getWikiBaseItem()).thenReturn(null);
Page page = new Page(new PageTitle("Test", wiki, null, null, props), Collections.<Section>emptyList(), props);
assertThat(DescriptionEditClient.isEditAllowed(page), is(false));
}
use of org.wikipedia.page.Page in project apps-android-wikipedia by wikimedia.
the class DescriptionEditClientTest method testIsEditAllowedSuccess.
@Test
public void testIsEditAllowedSuccess() {
WikiSite wiki = WikiSite.forLanguageCode("ru");
PageProperties props = mock(PageProperties.class);
when(props.getWikiBaseItem()).thenReturn("Q123");
when(props.canEdit()).thenReturn(true);
Page page = new Page(new PageTitle("Test", wiki, null, null, props), Collections.<Section>emptyList(), props);
assertThat(DescriptionEditClient.isEditAllowed(page), is(true));
}
Aggregations